Email not returned with GetUsers

So basically for some reason when i do te getUsers with an access token, it returns all basic information unless the email. im using the scope “user:read:email”.
The interesting fact is that a couple months ago it used to work.
Here’s the code to get the access token:

Here’s the url generated:

Your redirect URI (that you are sending people to) doesn’t look right, since it start with instead of something like

as per my implicit auth example

Your PHP(?) code does look correct however. I’m assuming you are using the Users reutned oAuth token to call the users API (not speicifing a ID or login just the token) as the user lookup code isn’t in your screenshot.

At time of writing my implicit oAuth example is working. So there is a code fault somewhere yourside.

my url does start with
here : […]
the thing is that it works. It returns info about the user but definetly not the email

The URL is incomplete!

I’m thinking that you did not URL encode the redirect URI. So the problem is that you never actually requested the scope. As it gets tacked onto the end of your redirect URI instead of being correctly passed to Twitch


$url = '' . urlencode('https://yourredirect/') . '&scope=user:read:email'

so that should be the correct url?

the URL you copy pasted was

I provided my suggested fix, you need to urlencode your redirect URI

So your $params above becomes something like

$params = array(
    'client_id' => $this->client_id,
    'redirect_uri' => urlencode($redirectUri),
    'response_type' => 'code',
    'scope' => 'user:read:email',
    'state' => $_SESSION['twitch_stage']

anyways in my php code i do the htpp_build_query()
i have tried encoding the redirect but it goes wrong due to it being not valid

this I tried and it goes wrong

So what is the actual URL that your code is generating to redirect users to in order to authenticate?


Twitch text`

by the way now i added the scope user:edit to see what happens. Now this finally shows up:

it basically says that if the user authorizes it, my web will be able to:
->update that user profile
->get that user email.

After i do authorize, i still don’t get the email

here is basically the response from twitch:

That looks correct,

you then did call thje users API with the access token?

Something like

it is worth noting that if you have an access token for “temperrino” but “termperrino”'s email is not verified, then it won’t be returned (regardless of the scope) in the response as the email is not verified.

I think it is verified since it is my personal account and actually this of the email thing had already worked in my web but now it stoped working.
I’m going to double check that

Since it’s your account try against “not your code” on the relevant link on Twitch Implicit Auth Example

and see if it returns on my implcict auth example

As the endpoint is working fine for me here

it was the goddamit verify thing. Twitch somehow updated something and required a new verification. Fuking thank you gosh. Been so desperate i came here. Just thank you. Have a great day, week and life. God bless you

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.