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

**URL:** <https://discuss.dev.twitch.com/t/bug-api-v2-not-retrieving-correct-datas-when-passing-access-token-in-url/4259>\
**Category:** API\
**Created:** [December 27, 2015, 2:17am UTC](https://discuss.dev.twitch.com/t/bug-api-v2-not-retrieving-correct-datas-when-passing-access-token-in-url/4259 "2015-12-27T02:17:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![catuss\_a](https://avatars.discourse-cdn.com/v4/letter/c/6bbea6/32.png) [@catuss\_a](https://discuss.dev.twitch.com/u/catuss_a)\
**Post date:** [December 27, 2015, 2:17am UTC](https://discuss.dev.twitch.com/t/bug-api-v2-not-retrieving-correct-datas-when-passing-access-token-in-url/4259/1 "2015-12-27T02:17:25Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![matt\_thomas](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/matt_thomas/32/710_2.png) [@matt\_thomas](https://discuss.dev.twitch.com/u/matt_thomas)\
**Post date:** [December 27, 2015, 7:05am UTC](https://discuss.dev.twitch.com/t/bug-api-v2-not-retrieving-correct-datas-when-passing-access-token-in-url/4259/2 "2015-12-27T07:05:16Z")

</div>

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

[Currently Known Kraken API Issues](https://discuss.dev.twitch.com/t/currently-known-kraken-api-issues/2177)

As per [Authenticated API Requests](https://github.com/justintv/Twitch-API/blob/master/authentication.md) - 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/](https://api.twitch.tv/kraken/)

> Send token as URL parameter:
> 
> > curl [https://api.twitch.tv/kraken?oauth\_token=](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](https://api.twitch.tv/kraken/channels/cevtest15/commercial)

---

<div class="post-metadata">

**Author:** ![catuss\_a](https://avatars.discourse-cdn.com/v4/letter/c/6bbea6/32.png) [@catuss\_a](https://discuss.dev.twitch.com/u/catuss_a)\
**Post date:** [December 27, 2015, 5:24pm UTC](https://discuss.dev.twitch.com/t/bug-api-v2-not-retrieving-correct-datas-when-passing-access-token-in-url/4259/3 "2015-12-27T17:24:02Z")

</div>

thanks for your answer 🙂

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [January 26, 2016, 5:24pm UTC](https://discuss.dev.twitch.com/t/bug-api-v2-not-retrieving-correct-datas-when-passing-access-token-in-url/4259/4 "2016-01-26T17:24:07Z")

</div>

Closed on January 26, 2016, 5:24pm UTC

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