Thanks, I followed the steps for the client credentials flow, and received a response like so:
{"access_token":"{the token}","expires_in":4897518,"scope":["channel_read"],"token_type":"bearer"}
However, when I substitute that token into the Authorization header in my original post, I get the following error:
{"error":"Unauthorized","status":401,"message":"invalid oauth token"}
Hmmm, ok. Maybe this is because it’s a bearer token, and the kraken API wants something else.
Alright, let’s try the Helix endpoint:
curl -H 'Authorization: Bearer {new bearer token}' \
-X GET 'https://api.twitch.tv/helix/users'
Response:
{"error":"Bad Request","status":400,"message":"Must provide an ID, Login or OAuth Token."}
Huh? The docs explicitly say that if neither ID not Login is specified, it will look up the user by the bearer token. Is this incorrect?
All I want to do is to look up the chat bot’s display name and channel ID, given a bearer token (or OAuth token from twitchapps.com/tmi). I do not need to look up any other user’s information. How do I accomplish this?
Thanks!