Error on retrieving users... "Must provide a valid Client-ID or OAuth token"

I am trying a simple request to get some user by ID as specified in the API reference guide(https://dev.twitch.tv/docs/api/reference/#get-users). I have tried the GET request in a REST console with Authorization as the header name and Bearer myclientid as the header value and I get this response:
{
“error”: “Unauthorized”,
“status”: 401,
“message”: “Must provide a valid Client-ID or OAuth token”
}

I tried on my linux machine to do the following and get the same response:

curl -H ‘Authorization: Bearer myclientid’ -X GET ‘https://api.twitch.tv/helix/users?id=44322889

I’ve gone to my dashboard and triple checked my client id to make sure it’s correct. I’ve also tried using the Client ID of an entirely different project I had created years ago. What am I doing wrong?

Bearer is for authorized keys not for clientID’s

For ClientID just send

curl -H ‘Client-ID: myclientid’ -X GET ‘https://api.twitch.tv/helix/users?id=44322889’

1 Like

Thank you so much. I spent way too long trying to figure that out. Maybe the documents should mention this…

The Docs do explain this.

In the Getting Started section of the API docs https://dev.twitch.tv/docs/api/ the second step shows how to use your Client ID to make requests.

Also in the Guide section of the API docs https://dev.twitch.tv/docs/api/guide/#authentication it explains authentication and how User Access and App Access tokens are sent in requests.

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