I’m requesting help because i’m stacking with a problem : i’m developing a telegram bot that automatically kick user that is not subscribed to a channel,in this moment i use the channel csv subscriber list.
Now, what i want to achieve is : get the list of subscriber from the twitch api, i alredy have the client_secret and client_id of the twitch channel of which I want to get the subscriber list and i have alredy tested the api to obtain the token
GET https://id.twitch.tv/oauth2/authorize
?client_id=<your client ID>
&redirect_uri=<your registered redirect URI>
&response_type=code
&scope=<space-separated list of scopes>
but when i use thi endpoint and pass the token i get 401 Unauthorized
That would suggest you didn’t complete step 3 of oAuth and exchange the code for a token.
3) On your server, get an access token by making this request:
POST https://id.twitch.tv/oauth2/token
?client_id=<your client ID>
&client_secret=<your client secret>
&code=<authorization code received above>
&grant_type=authorization_code
&redirect_uri=<your registered redirect URI>
Here is a sample request:
POST https://id.twitch.tv/oauth2/token
?client_id=uo6dggojyb8d6soh92zknwmi5ej1q2
&client_secret=nyo51xcdrerl8z9m56w9w6wg
&code=394a8bc98028f39660e53025de824134fb46313
&grant_type=authorization_code
&redirect_uri=http://localhost
Exchange the ?code for a token (and refresh token)
In order to get access to the broadcasters subscription list, you need permission from the broadcaster. So the braodcaster has to login in order to grant that access