Hello,
Firstly, I’m going to prefix this message by saying, “I’m not a programmer; merely a hobbyist”. So please be gentle. I just hope I’m not doing something completely crazy.
So my issue if I’m getting an error after trying to use my access token when using users.
Here’s what I’m doing…
I’m validating my oauth token with this:
{ url: 'https://id.twitch.tv/oauth2/validate',
method: 'GET',
headers:
{ client_id: 'bt5v6ewrxkgfs8ewy1k3bl98zxkzj4e',
Authorization: 'OAuth <my oauth token is here>' } }
I then get this response:
{"client_id":"bt5v6ewrxkgfs8ewy1k3bl98zxkzj4e","login":"dodgyblaster","scopes":["user:read:email"],"user_id":"136678973","expires_in":0}
I then validate the app token with this:
{ url: 'https://id.twitch.tv/oauth2/validate',
method: 'GET',
headers:
{ client_id: 'bt5v6ewrxkgfs8ewy1k3bl98zxkzj4e',
Authorization: 'OAuth <my app token is here>' } }
I get this response:
{"client_id":"bt5v6ewrxkgfs8ewy1k3bl98zxkzj4e","scopes":["user:read:email"],"expires_in":5092880}
But when I go to use that app token with this:
{ url: 'https://api.twitch.tv/helix/users',
method: 'GET',
headers:
{ client_id: 'bt5v6ewrxkgfs8ewy1k3bl98zxkzj4e',
Authorization: 'Bearer <my app token same as the above>' },
qs: { id: 136678973 } }
I get this error response:
{"error":"Unauthorized","status":401,"message":"Client ID and OAuth token do not match"}
I’m clearly doing something wrong. But I’m not sure what.
Thanks in advance,
Dan