# Finding an OAuth Token

**URL:** <https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853>\
**Category:** API\
**Created:** [July 30, 2021, 11:14am UTC](https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853 "2021-07-30T11:14:29Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![reisu1337](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/reisu1337/32/13007_2.png) [@reisu1337](https://discuss.dev.twitch.com/u/reisu1337)\
**Post date:** [July 30, 2021, 11:14am UTC](https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853/1 "2021-07-30T11:14:29Z")

</div>

Hi! I am brand new to working with requests and APIs, and am trying to set up a simple GET request, using the example in the docs:

```auto
curl --location --request
GET 'https://api.twitch.tv/helix/search/channels?query=a_seagull' \
--header 'client-id: wbmytr93xzw8zbg0p1izqyzzc5mbiz' \
--header 'Authorization: Bearer 2gbdx6oar67tqtcmt49t3wpcgycthx'

```

I can’t work out how to get the authorisation token? In the [docs](https://dev.twitch.tv/docs/authentication/) under the heading “getting a token” it keeps referencing the “access token” but I can’t find a way to get one of those anywhere. Really sorry if this is a stupid question/has been asked before, any help will be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [July 30, 2021, 11:16am UTC](https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853/2 "2021-07-30T11:16:12Z")

</div>

This docs example is wrong

```auto
curl --location --request \
GET 'https://api.twitch.tv/helix/search/channels?query=a_seagull' \
--header 'client-id: wbmytr93xzw8zbg0p1izqyzzc5mbiz' \
--header 'Authorization: Bearer 2gbdx6oar67tqtcmt49t3wpcgycthx'

```

> [@reisu1337](#):
>
> I can’t work out how to get the authorisation token? In the [docs](https://dev.twitch.tv/docs/authentication/) under the heading “getting a token” it

Thats in the next page down in the navigation

> **[Getting OAuth Access Tokens](https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/)**
>
> Getting OAuth Access Tokens

That covers the primary token types

---

<div class="post-metadata">

**Author:** ![reisu1337](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/reisu1337/32/13007_2.png) [@reisu1337](https://discuss.dev.twitch.com/u/reisu1337)\
**Post date:** [July 30, 2021, 11:43am UTC](https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853/3 "2021-07-30T11:43:22Z")

</div>

Thank you! I’ve got the token now!  
My only other question is what the correct method of submitting the request that’s wrong in the docs? Thanks!

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [July 30, 2021, 11:44am UTC](https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853/4 "2021-07-30T11:44:29Z")

</div>

Missing `\` at the end of `curl --location --request`

---

<div class="post-metadata">

**Author:** ![reisu1337](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/reisu1337/32/13007_2.png) [@reisu1337](https://discuss.dev.twitch.com/u/reisu1337)\
**Post date:** [July 30, 2021, 11:44am UTC](https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853/5 "2021-07-30T11:44:47Z")

</div>

Thanks!!

---

<div class="post-metadata">

**Author:** ![reisu1337](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/reisu1337/32/13007_2.png) [@reisu1337](https://discuss.dev.twitch.com/u/reisu1337)\
**Post date:** [July 30, 2021, 8:13pm UTC](https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853/6 "2021-07-30T20:13:36Z")

</div>

Sorry to bring this back up. I’m generating the tokens but twitch isn’t accepting them. See this stackoverflow post for my issue. Thanks if you can help!

> <https://stackoverflow.com/questions/68595400/issues-accessing-twitch-api-through-python>

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [July 30, 2021, 8:16pm UTC](https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853/7 "2021-07-30T20:16:41Z")

</div>

Why did you make a stack overflow post?

I could of replied here.

Your params should be headers

See this example script

> **[twitch\_misc/authentication/app\_access\_tokens/python at main ·...](https://github.com/BarryCarlyon/twitch_misc/tree/main/authentication/app_access_tokens/python)**
>
> main/authentication/app\_access\_tokens/python

---

<div class="post-metadata">

**Author:** ![reisu1337](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/reisu1337/32/13007_2.png) [@reisu1337](https://discuss.dev.twitch.com/u/reisu1337)\
**Post date:** [July 30, 2021, 8:19pm UTC](https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853/8 "2021-07-30T20:19:50Z")

</div>

Thank you so much! Made the SO post because I didn’t want to spam the forum 😅  
This worked, spent all day getting frustrated.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [July 30, 2021, 8:21pm UTC](https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853/9 "2021-07-30T20:21:04Z")

</div>

> [@reisu1337](#):
>
> because I didn’t want to spam the forum 😅

Then you spam Stackoverflow instead. 😛

And theres usually people watching the forums, rather than watching Stackoverflow

Since you posted the SO 2 hours ago and got a forum reply here in three minutes instead.

---

<div class="post-metadata">

**Author:** ![reisu1337](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/reisu1337/32/13007_2.png) [@reisu1337](https://discuss.dev.twitch.com/u/reisu1337)\
**Post date:** [July 30, 2021, 8:23pm UTC](https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853/10 "2021-07-30T20:23:42Z")

</div>

> [@BarryCarlyon](#):
>
> Then you spam Stackoverflow instead. 😛

You’re absolutely right

> [@BarryCarlyon](#):
>
> Since you posted the SO 2 hours ago and got a forum reply here in three minutes instead.

Thank you so much, you’re more helpful than most people on the internet 😆

---

<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:** [August 29, 2021, 8:24pm UTC](https://discuss.dev.twitch.com/t/finding-an-oauth-token/32853/11 "2021-08-29T20:24:05Z")

</div>

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