Account/verify_credentials NOT return email

oauth
api

#1

Hi, i’m developing my first twitter app. I need only to read real name, birthday and email of a user that log in my app.
I use the “account/verify_credentials” call but i don’t receive the user email.

I have tried with some account but there is not email field. In my app settings i’ve checked the option to get access to email and on authorization login screen is written that i will get access to email but returned json do not contain email address.

I’ve read that birthday not is a returned value but this is not mandatory for me. I need only real name and email. why can not I access the user’s email address?

Thanks and sorry for my english


#2

What language and/or client library are you using?

Note that only verified email addresses will be returned. If the user has never clicked through the verification link in the email they were sent after signup, or after changing the email address on their account, the email will not be treated as verified and will never be returned in the API.

You’re correct that birthday is not returned in the API.


#3

Thanks for reply.
I’m using script of this tutorial http://www.codexworld.com/login-with-twitter-using-php/.

How do I know if the email of my twitter account is verified? I can re-verify my email address?

UPDATE: I’ve updated my script code using Abraham TwitterOauth but my call to verify_credentials not reutnr email. I’ve specified include_email = true. Any ideas?

UPDATE 2: There’s an error on Twitter documentation. ‘include_email’ must be string not boolean. Passing it as string now i obtain email address on verify_credentials call


#4

Hi.
Help to figure out.
I build OAuth autorization on PHP using Symfony and this bundle https://github.com/hwi/HWIOAuthBundle
It sends correct requests. My account email is verified, but I still no reciev email in repsonse.
Not enough explanation about fields what returned in response at all.

part of response

{
  'id': 836496318726037504,
  'id_str': '836496318726037504',
   ....
  'verified': false,                      // what does it mean, and why???
  'protected': false,                     // what does it mean?
  ....
}

so, it is not clear!
If I requied email, even it is not verified, at least I would like get key email in response which shows, that request processed correctly (or some thing like that).


#5

The verified field is whether the account is verified (has a blue tick). The protected field is whether the account is private / not viewable on Twitter except to approved users.

Can you provide the call you’re making to the verify_credentials endpoint as an example?


#6

Sure.

GET https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true

#7

So just to confirm - you’ve configured your application settings to request email access; you’re authenticated with your user token (since updating the app settings) and saw the reference to email permission in the OAuth dialog; and you’re calling with that URL. Are you doing anything in PHP to specify the type of the include_email parameter? it needs to be a string.


#8

Are you doing anything in PHP to specify the type of the include_email parameter?
You can see source https://github.com/hwi/HWIOAuthBundle/blob/master/OAuth/ResourceOwner/TwitterResourceOwner.php line 40
So, it is string. Maybe something with my account?


#9

I’m not familiar with the whole of that framework but at the end of that file it seems to also be checked as a bool.

I’d suggest using a test tool like twurl to auth against your account, and then try running the verifiy_credentials call again.


#10

method configureOptions is setting up default fields of that service, it does not effect the direct request.

tool like twurl

thanks for that


#11

I tested

twurl authorize --consumer-key {%MY_KEY%} --consumer-secret {%MY_SECRET%}
twurl /1.1/account/verify_credentials.json?include_email=true

and no email.

But while getting PIN on https://api.twitter.com/oauth/authorize I had notice that I can not get email. why???


#12

For Any one see this problem in twitter Api As I Faced

The Solution Is :

$parameters['include_email'] = "true";

Twitter Api need value as string not bool it’s very strange behavior but it work