Hey folks - I’m having trouble requesting channel info from the
https://api.twitch.tv/kraken/channel/ endpoint using the OAuth Client Credentials Flow.
client_secret and the OAuth access token only has the
channel_read scope, so feel free to copy-paste examples.
Here’s the cURL request getting the access token:
curl -X POST https://api.twitch.tv/kraken/oauth2/token?client_id=ri04jcik58c8pt9jj8wcol85jrv3t7&client_secret=asdfasdfasdf&grant_type=client_credentials&scope=channel_read
Along with the response:
Cool, got my access token. Hitting the
https://api.twitch.tv/kraken/ endpoint just to verify that the token is valid, and has the correct scopes:
curl -H 'Authorization: OAuth e1bbk2ryuhqydcelkpfc5n5qascmxd' \ -H 'Accept: application/vnd.twitchtv.v5+json' \ -H 'Client-ID: ri04jcik58c8pt9jj8wcol85jrv3t7' \ -X GET 'https://api.twitch.tv/kraken/'
And the response, indicating that it’s valid and has the
Now, trying to get my channel info from the
curl -H 'Authorization: OAuth e1bbk2ryuhqydcelkpfc5n5qascmxd' \ -H 'Accept: application/vnd.twitchtv.v5+json' \ -H 'Client-ID: ri04jcik58c8pt9jj8wcol85jrv3t7' \ -X GET 'https://api.twitch.tv/kraken/channel/'
Womp womp. I have a hunch that this might not work with the OAuth Client Credentials flow, but I figured I’d post here to see if anyone had a definite answer, or if I’m just missing something crucial.
I can get this done using some of the other auth methods, but as the app I’m building is server-side only I figure I’d give this a shot.
Appreciate any thoughts that you guys have. Cheers!