【问题标题】:how to retrieve twitter user email using codebird.php如何使用 codebird.php 检索 Twitter 用户电子邮件
【发布时间】:2018-12-17 06:51:43
【问题描述】:

有没有办法我可以使用codebird.php 请求 twitter 用户电子邮件地址 avartarURL

目前,我只得到网名。

我正在做的是:

$reply = $this->client->oauth_requestToken(array('oauth_callback' => $this->clientCallback));

我目前正在学习的教程:

PartFour 这会让你从前 5 分钟就知道发生了什么。

【问题讨论】:

    标签: php codebird


    【解决方案1】:

    您可以通过调用 account/verify_credentials Twitter API 方法来请求用户的电子邮件地址,将可选的 include_email 参数设置为 1

    $reply = $cb->account_verifyCredentials([
      'include_email' => 1
    ]);
    print_r($reply);
    

    这仅适用于启用了向用户请求电子邮件地址选项的 Twitter 应用。

    developer.twitter.com 的应用权限下可以使用“向用户请求电子邮件地址”复选框。必须在应用程序设置中填写隐私政策 URL 和服务条款 URL 字段,以便电子邮件地址访问功能正常。如果启用,将通过oauth/authorize 对话框通知用户您的应用可以访问他们的电子邮件地址。

    请注意 - 您的应用将需要重新生成用户访问令牌,以便以前经过身份验证的用户访问他们的电子邮件地址。

    请注意 - 如果您在 developer.twitter.com 上登录您的 Twitter 帐户,则可以通过 Twitter 应用仪表板查看和编辑您现有的 Twitter apps

    【讨论】:

    • 谢谢。但它一开始没有用,我在长时间搜索here 后使用了这些array('include_entities' => 'true', 'skip_status' => 'true', 'include_email' => 'true') 参数,它起作用了。再次感谢!
    猜你喜欢
    • 1970-01-01
    • 2014-08-18
    • 2018-08-25
    • 2014-07-19
    • 2011-01-29
    • 2022-11-25
    • 1970-01-01
    • 1970-01-01
    • 2012-12-14
    相关资源
    最近更新 更多