BUG API V2 ? not retrieving correct datas when passing access token in url

Hello !

I’ve been using the twitch api v2 recently and I’ve noticed after some hours that I wasn’t receiving the datas I was actually expecting.
I can reproduce it simply this way:

curl -H 'Accept: application/vnd.twitchtv.v2+json' -H 'Authorization: OAuth *******************' -X GET https://api.twitch.tv/kraken/streams/followed

This request above actually works fine but when I pass the access_token this way:

curl -H 'Accept: application/vnd.twitchtv.v2+json'  -X GET https://api.twitch.tv/kraken/streams/followed?oauth_token=*************

It often sends me random streams that I don’t even know about and sometimes returns the correct datas. Here is a list of the channel names I had to mess with:

["iateyourpie", "spikevegeta", "tharixer", "ivan", "bawkbasoup", "yuna92raichu", "nozlar", "eswoogi", "insanebb", "bubblesdelfuego", "acmlm", "tessiro", "morse66", "palkey", "cantoutfapme", "shadow_dog", "dbx", "kaiine", "millnium", "chelney1", "endyswe", "jokaah", "trogdor", "kazuki2433", "tarnsmandw", "nevanos", "kawainl", "medrybw", "kehanort", "boundingrey", "uhtrance", "zodanor", "garrison_tt", "soloman231", "deadrobots", "hagspam", "sephjul", "kingson1991"]

I’d like to know whether passing the OAuth token directly in the url is just a bad practice / deprecated, or the api behaviors went wrong?

Thanks for you time!

I believe you are referencing known issues, it was previously fixed but seems to have came back.

Currently Known Kraken API Issues

As per Authenticated API Requests - Placing the OAuth in the URL is acceptable. The incorrect output is just a bug.

When an API request requires authentication, you can send the access token you obtained above in any of the following ways:

Send token as header:

curl -H “Authorization: OAuth [access token]” https://api.twitch.tv/kraken/

Send token as URL parameter:

curl https://api.twitch.tv/kraken?oauth_token=[access token]

Send token in the HTTP body (cannot be used with GET and DELETE methods)

curl -d ‘oauth_token=[access token]’ https://api.twitch.tv/kraken/channels/cevtest15/commercial

thanks for your answer :slight_smile:

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