postmantwitch

Following Twitch API parameters, but error as output


I am using the twitch API just to test it out to fetch the top games

I get my app access token after making an app by passing in a POST to:

https://id.twitch.tv/oauth2/token?client_id=<my client id>&client_secret=<my generated secret>&grant_type=client_credentials

I then take the access token (token_type: bearer) to the actual data fetching API and do a GET request on Postman to

https://api.twitch.tv/helix/games/top?Authorization=Bearer <access token form above>&client-id=<client-ID>

This is my output:

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

I have tried this with and without the client ID. The documentation here says that it can take an OAuth token or an app access token as the authorization parameter.

What gives?


Solution

  • The ClientID and Authorization items are headers not query string parameters

    So in postman you have provided them in the wrong place