OAuth token is missing Works Locally But Not Live

This is strange … it works locally on my laptop but as soon as I upload to
webhost get a 401 when querying …
but the token generates ok

Got tokenstdClass Object ( [access_token] => 1o191c1xxxxxxxxxxxxxxx2k897 [expires_in] => 5227854 [token_type] => bearer )

However this is the response from my query

array(3) { ["error"]=> string(12) "Unauthorized" ["status"]=> int(401) ["message"]=> string(22) "OAuth token is missing" }

I’m querying https://api.twitch.tv/helix/search/channels?query=’.$catname.’&live_only=true&first=100
$catname is a predefined variable that url encodes the game name

Like I said it works fine on local host however it doesnt work in live
and yes I have added the correct url to the application request url as well :slight_smile:

It would be helpful if you show the code where you’re actually making the request, as the OAuth token is missing error is usually due to a missing/malformed Authorization header.

Additionally, why are you searching for channels with a category as a query? If you want to get live streams that are playing a specific game you should be using the Get Streams endpoint and specify the game_id param, as the Search Channels endpoint is for searching channel names/descriptions.

ahhh …
thanks for pointing out my stupidity … I upoaded the wrong file

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