how to retrieve twitter user email using codebird.php

别来无恙 提交于 2020-01-03 06:00:15

问题


Is there a way I can request twitter user email address, avartarURL using codebird.php

Currently, I only get the screen name.

What I am doing is:

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

The tutorial I am currently following:

PartFour This will give you a sense of what is going on from the first 5 min.


回答1:


You can request a user’s email address by calling the account/verify_credentials Twitter API method, setting the optional include_email parameter to 1:

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

This will only work for Twitter apps that have the option to request email addresses from users enabled.

The “Request email addresses from users” checkbox is available under the app permissions on developer.twitter.com. Privacy Policy URL and Terms of Service URL fields must be completed in the app settings in order for email address access to function. If enabled, users will be informed via the oauth/authorize dialog that your app can access their email address.

Please note - Your app will need to regenerate the user access tokens for previously authenticated users to access their email address.

Please note - You can view and edit your existing Twitter apps via the Twitter app dashboard if you are logged into your Twitter account on developer.twitter.com.



来源:https://stackoverflow.com/questions/53797163/how-to-retrieve-twitter-user-email-using-codebird-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!