Finding an OAuth Token

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:

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 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!

This docs example is wrong

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

Thats in the next page down in the navigation

That covers the primary token types

1 Like

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!

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

1 Like

Thanks!!

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!

Why did you make a stack overflow post?

I could of replied here.

Your params should be headers

See this example script

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

Then you spam Stackoverflow instead. :stuck_out_tongue:

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.

You’re absolutely right

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

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