"Invalid OAuth token"

Hi, I searched for similar issues. I actually had the Helix API working fine until recently when it just stopped. Did something change?

I’m using the curl request example from the documentation.
curl -X GET 'https://api.twitch.tv/helix/streams?user_login=xxx' -H 'Authorization: Bearer xxx' -H 'Client-Id: xxx'

curl -X GET 'https://api.twitch.tv/helix/users/channels' -H 'Authorization: Bearer xxx' -H 'Client-Id: xxx'

{"error":"Unauthorized","status":401,"message":"Invalid OAuth token"}

I even tried creating a new secret twice over a couple of days. And tried the Python example as well.

You are generating a token and not trying to use your client secret as a token?

Assuming when you copied the example from the docs, and changed the Token to your generated token.

This suggests the token has expired and needs to be renewed.

A token is either valid for 4 hours or 60 days depending on type.

You can use the validate API or a tool like Token Checker | Twitch API Example to test your token.

But the API already did this for you and is reporting the token as invalid

I just created a new secret and tried to validate it with the Token Checker. It says not valid.

Thanks for the quick reply.

A secret is not an oAuth token.

It must have expired after 60 days and I’m not using the same method I did. Thanks

https://id.twitch.tv/oauth2/authorize?response_type=token&client_id=<client id>&redirect_uri=http://localhost&scope=chat%3Aread+chat%3Aedit 

redirect_uri has to match

I forgot how complicated that had to be.

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