I can not get the user's email address

oauth

#1

I can not get my email address.
Is it because the user’s email address is not published?
Or is it a matter of source code?

Answering when asking questions to support@twitter.com
Thank you for your inquiry.
We can verify the app that has all the required authority to request the user’s email ID xxxxxxxxxxxxxxxxxxxxxxxxx.

User information
User name [XXXXXXXX]
E-mail address [E-mail address will not be published]

Public Async Function RegisterTop_Twitter(oauth_token As String, oauth_verifier As String, id As String, denied As String) As Task(Of ActionResult)
Dim Tokens As CoreTweet.Tokens = Nothing
Dim oAuthSession = TryCast(TempData(“OAuthSession”), CoreTweet.OAuth.OAuthSession)
Tokens = CoreTweet.OAuth.GetTokens(oAuthSession, oauth_verifier)
'GET account/verify_credentials
Dim userResponse = Tokens.Account.VerifyCredentials(False, True, True)
Dim snsEmail As String = userResponse.Email
End Function


#2

I’m not familiar with the code you’re using there, as I’ve not used CoreTweet .NET before - the Twitter API actually requires that the parameter for include_email be a String value, and I think CoreTweet may be treating it as a Boolean.

The alternative reason might be that the account does not have a verified email address associated with the user object.


#3

The mail address has already been confirmed.
Can I publish my email address?


#4

In this case I suspect that the library you are using is not calling the API correctly. I have not been able to verify this for myself.


#5

Are you able to use any alternative libraries, or use your user token with a tool like twurl to check if the email address pulls through?


#6

Do not use CoreTweet.NET

Https://api.twitter.com/1.1/account/verify_credentials.json

? Include_email = true

I got a mail address.
Thank you very much.


#7

Great, glad to hear this is working for you now! You may want to let the devs of CoreTweet.NET know that their code might need updating.