Get 401 while getting api .mp4 link

Hi I’m using Twitch API to get the downloadable link I’m getting this error:


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

please tell me where I’m wrong because firstly it is working but from today it isn’t working

All requests need an OAuth token now for helix

Also, the Helix endpoint doesn’t return the MP4 URL. There is no documented download link API as or right now.

can you please tell me that how to get OAuth every time from API??

From the linked announcement thread

The documentation covers the available oAuth token types, and you can decide which token you need and go from there

ok i have to create oauth token everytime ?

oAuth tokens are valid for a number of seconds as described by the validate endpoint when checking the token or when obtaining the token the expires_in is in the response.

So you should resuse a token if the token is still valid, instead of making a new token for reach request

can you send me a request sample how i can get the token on api call please??

No, because I don’t know what kind of token you want

Please refer to the documentation to determine which kind of token you need. It sounds like you need an App Access Token, but I don’t know what your application/website/tool does, as if your application/website/tool has a logged in user, you’d use the Users oAuth token rather than an App Access Token

Covers the token types, and it’s following section covers what the responses/types are

i just need to do this call of Twitch API

https://api.twitch.tv/helix/clips?id=

That API endpoint supports any oAuth token since it’s not restricted. So you probably want an App Access Token, but I don’t know that for sure.

Covers how to get such a token. A post request to the endpoint

ok can i get the twitch clips preview by kraken API without getting the OAuth???

Kraken is deprecated and will be removed in the future. Currently Kraken doesn’t require oAuth

Thank you so much

If you happen to just be using an application like Insomnia to get the results from the API, then the only update you need to make is most likely in your Authorization tab. You would need to specify OAuth2, the authorization URL seen in the screenshot below, and your client id. Insomnia, for example, then has a create/refresh token button which is then automatically sent with your API request.

Everything else can stay the same; include the client id in your header and the id in the query parameters.

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