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.
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.