Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upretrieve user's email (again) #364
Comments
This comment has been minimized.
This comment has been minimized.
|
That looks correct. Make sure the access token was granted after email access was enabled. You might need to revoke access and authorize again. |
This comment has been minimized.
This comment has been minimized.
TheExcalibur
commented
Jun 15, 2015
|
I cleared everything on my twitter test account many times and renew the consumer_key and consumer_secret. Is there any function to get the email or just doing something like $user_infos->email (same way for screen_name) will work ? |
This comment has been minimized.
This comment has been minimized.
|
I would guess it would just be |
This comment has been minimized.
This comment has been minimized.
TheExcalibur
commented
Jun 16, 2015
|
ok thanks. If any news, I will inform you right here. |
TheExcalibur
closed this
Jun 16, 2015
This comment has been minimized.
This comment has been minimized.
SrPatinhas
commented
Dec 28, 2015
|
@TheExcalibur you get this working? as i saw the user need to have the account verified? could you help me out please? :) |
This comment has been minimized.
This comment has been minimized.
|
Yes, a Twitter profile will have to have a confirmed email address for this to work. Some users only sign up with their phone number. |
This comment has been minimized.
This comment has been minimized.
TheExcalibur
commented
Dec 28, 2015
|
Yes. It works with a verified account only |
This comment has been minimized.
This comment has been minimized.
|
Note that verified accounts are different from accounts with verified emails. Accounts with verified emails is what matters here. |
This comment has been minimized.
This comment has been minimized.
SrPatinhas
commented
Dec 29, 2015
|
@TheExcalibur @abraham so just do something like
and it will retrieve the email? |
This comment has been minimized.
This comment has been minimized.
|
Assuming the app has been whitelisted by Twitter to access users email addresses, yes, that looks like it should work. |
This comment has been minimized.
This comment has been minimized.
austinh
commented
Jan 12, 2016
|
I can't seem to get the email correctly, I have permission from twitter, and using just the GET RESP API works fine, but when using this API it doesnt seem to work. |
This comment has been minimized.
This comment has been minimized.
|
What do you mean by "this API"? Which REST API method works and what API method doesn't work? |
This comment has been minimized.
This comment has been minimized.
dandrits
commented
Jan 14, 2016
|
Hello @abraham I've tried what @SrPatinhas suggests by invoking $arr=$connection->get("account/verify_credentials", ['include_entities' => true, 'skip_status' => true, 'include_email' => true]); thx! |
This comment has been minimized.
This comment has been minimized.
|
If you are getting |
This comment has been minimized.
This comment has been minimized.
dandrits
commented
Jan 14, 2016
|
Do I have to change my access token or must I change my account's username/password |
This comment has been minimized.
This comment has been minimized.
|
The accounts access token being used is invalid. You need a new access token. |
This comment has been minimized.
This comment has been minimized.
dandrits
commented
Jan 14, 2016
|
OK thanks a lot!! |
This comment has been minimized.
This comment has been minimized.
dandrits
commented
Jan 15, 2016
|
@abraham I 've changed the account's token of my app. But the results are the same. I' ve followed the examples about thw api and just after creating a new connection to twitter using my consumer api key/secret using thank you for the help and your patience! |
This comment has been minimized.
This comment has been minimized.
|
It's probably not the app's consumer key/secret that is bad, it's probably the user's access token. Make sure you are following the full authentication process to get a user's access token. |
This comment has been minimized.
This comment has been minimized.
dandrits
commented
Jan 20, 2016
|
I'm sorry for my late response. The problem was a firewall issue and now it is solved. Thank you very much for the help! Keep up the great work!! |
This comment has been minimized.
This comment has been minimized.
minamoto19
commented
Mar 3, 2016
|
Just wanted to let people know that the code below doesn't always return the email address even if you are whitelisted and the user's email is verified. |
This comment has been minimized.
This comment has been minimized.
|
Interesting. |
abraham
reopened this
Mar 3, 2016
abraham
added
the
Task
label
Mar 3, 2016
This comment has been minimized.
This comment has been minimized.
dandrits
commented
Mar 3, 2016
|
hhm that's why sometimes I was getting results and some others not,interesting! |
This comment has been minimized.
This comment has been minimized.
usamaejaz
commented
Mar 6, 2016
|
Right. I also wasted a lot of time with this issue. Setting true to 'true' (string) gave the expected result. |
This comment has been minimized.
This comment has been minimized.
minamoto19
commented
Mar 7, 2016
|
@abraham |
This comment has been minimized.
This comment has been minimized.
|
I think it is an issue the library needs to fix. Twitter explicitly documents |
This comment has been minimized.
This comment has been minimized.
arifchenko
commented
Mar 8, 2016
|
Finally, i found the solution for 1.1 version. Find your OAuth.php file, on |
This comment has been minimized.
This comment has been minimized.
minamoto19
commented
Mar 8, 2016
|
@arifchenko |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
abuzant
commented
Mar 24, 2016
|
@abraham I have noticed a comment that says "if you're app is authorized to get the email, you will get it".. I am using the correct verion of the library and the (string) value for TRUE but still the email is noe being sent back and no errors at all. Everything works great but I am not getting the email, so How do I get my app to be authorized? Example usage of code: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
abuzant
commented
Mar 24, 2016
|
I can't be more shy of myself. I have been on that page since the morning and never saw that line about white-listing an application. I am so sorry and thank you so much. (thumbsup) |
This comment has been minimized.
This comment has been minimized.
daniel-seitz
commented
Jul 22, 2016
|
Trying to figure out how to programatically revoke our app's access since some of our users already granted the access before we were white listed for the email address. The user's experience is better if that is done on the back end. Is there a function in your lib? The Twitter doc says
Other than oauth2/invalidate_token - which is the wrong one - I can't find how... |
This comment has been minimized.
This comment has been minimized.
apuestaya
commented
Jan 4, 2017
|
finally, solved with this:
|
abraham
added this to the v1.0 milestone
Feb 23, 2017
This comment has been minimized.
This comment has been minimized.
vebinua
commented
Jun 20, 2017
|
I may still be using the old version but changing the parameter values from boolean to string indeed did the trick.
Thank you @abraham |
This comment has been minimized.
This comment has been minimized.
johnross7392
commented
Jul 11, 2017
|
I have confirmed my email address, checked the request email permission option and added the privacy policy and TOS urls... it even shows can request users email address in the app settings page, but still shows cannot view email address in my auth dialog box.. did i miss anything? |
This comment has been minimized.
This comment has been minimized.
razorsharpshady
commented
Mar 12, 2018
•
|
hey @abraham , please make the change in api for 'true'. |
This comment has been minimized.
This comment has been minimized.
deepanchakravarthi
commented
Mar 30, 2018
•
|
Hi Abraham, I tried it as per your documentation and comments. I didn't get email address. Could you please let me know - how can I get it? Thank you! For your info, still I'm getting the error -> [code] => 89 [message] => Invalid or expired token My Code: I have regenerated Consumer Key & Consumer Secret. |
This comment has been minimized.
This comment has been minimized.
razorsharpshady
commented
Mar 30, 2018
|
in twitter app settings u need to check on "Request email addresses from
users" in Additional permision. and use the library like in screenshot
…On Fri 30 Mar, 2018, 11:25 AM Deepan Chakravarthi. K, < ***@***.***> wrote:
Hi Abraham, I tried it as per your documentation and comments. I didn't
get email address. Could you please let me know - how can I get it? Thank
you!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#364 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATVyno7Ww99--9j-cL6fhxV7DVf8LaYYks5tjcjGgaJpZM4FDjei>
.
|
This comment has been minimized.
This comment has been minimized.
deepanchakravarthi
commented
Mar 30, 2018
•
|
@razorsharpshady Thank you for your comments |
This comment has been minimized.
This comment has been minimized.
deepanchakravarthi
commented
Mar 30, 2018
|
@abraham Regarding your comment, If you are getting 'code' => int 89 public 'message' => string 'Invalid or expired token.' then you need to get new credentials for the account. Yes I'm getting the same. I regenerated key and secret. But there is no change in response, I can get screen name and user_id using the access token. Could not get email address.. Kindly guide me to get it. Thank you! |
This comment has been minimized.
This comment has been minimized.
deepanchakravarthi
commented
Mar 30, 2018
•
|
Oh my god, finally I solved it. I had been struggling for the past 3 hours. :( My guys, I hope it helps for you if you get the same issues in the near future. :) My Code: (Error code) I used oauth_token and oauth_token_secret from access_token. It's working. |
This comment has been minimized.
This comment has been minimized.
razorsharpshady
commented
Mar 30, 2018
|
@deepanchakravarthi what wrong was u doing? |
This comment has been minimized.
This comment has been minimized.
deepanchakravarthi
commented
Mar 30, 2018
|
@razorsharpshady I used oauth_token and oauth_token_secret - session values instead of using access token. |

TheExcalibur commentedJun 15, 2015
Hi,
I've done every thing with Twitter policies to have my website on Twitter's whitelist.
(https://dev.twitter.com/rest/reference/get/account/verify_credentials)
My app tells me it's "OK", I can get the user's email. But when I make this, I can't find any email.
I did this:
Have you any suggestion to get it ?
Regards