I’m trying to get data from that user with OAuth authorization code flow.
I get my access_token in first response then i try to call the endpoint with it but i get a 401 in my log
I try to understand why but i miss the point.
Am i passing wrong params in header ?
I tried to find example of how i can accomplish that but didn’t find anything relevant
Thank you in advance for your time
You need a space between the token type and the token, it looks like your code will be sending them as
Bearer1234 rather than
AUTH.token_type returned by the APU is
Bearer is correct
‘Authorization’: 'Bearer ’ + AUTH.access_token
Oh right ! I really need to double check my code … Thank you
Then i have another question for you
With users?login=“xx” i can get the id of a certain streamer then i need to call streams/user_id=“xxxx” to know if the person is live or not but does there is a more simple way ?
Once i know the id of the person can i use it directly ? Or the id might change ?
The ID never changes
With helix you can
Theres no need to get the UserID first. But if the only thing you store is the username, when/if the username changes your code will break.
So when a user signs up, get and store their ID in a DB and use that all the time
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.