Teyz
1
Hello here !
I’m working an nodejs API to retrieve subscribe but I have a problem.
I have already recovered my berear token with : https://id.twitch.tv/oauth2/token with scope : channel:read:subscriptions
But when i call : https://api.twitch.tv/helix/subscriptions i have this message :
“message”: “Missing scope: channel:read:subscriptions or channel_subscriptions”
I don’t understand why I have this message 
Thanks mate
Dist
2
Did you use the correct OAuth flow for a user token? It must be the Authorization Code, or Implicit flow, client credentials will not work.
Teyz
3
I used this :
I want to get all user subs for my nodejs API
Dist
4
You can’t use the Client Credentials flow. That is for an App token, and does not represent a user.
To access private information, such as a channels subscriber list, you need that broadcaster to go through the Authorization Code flow if making requests on your server, or the Implicit flow if making requests client-side from a browser.
Teyz
5
In any case, the user will necessarily have to have a form to accept ?
Dist
6
Yes, for all User token flows it requires sending the user the Twitch auth URL so that they can see what permissions (scopes) you are requesting, and that they can explicitly allow/deny that connection to your app.
Teyz
8
@Dist I have a stupid question but I didn’t find where I can get my broadcaster_id ?
Dist
9
You can use the Get Users, or Validate Token endpoints with your OAuth token, and it will return the user associated with that token, including their id.
1 Like
Teyz
11
@Dist
I have an other question, I want to create a EventSub for channel.subscribe but I dont know how to generate the secret in transport

It always return me a

Thanks for helping !
Dist
12
The secret is whatever you want it to be. Whatever string you define as the secret is what Twitch will use to sign each notification they send to you, that way you can use that secret so validate all notifications.
Teyz
13
So I don’t understand why i have a 400 with ‘Bad transport’ with this
Dist
14
The fields appear good, the only thing I can suggest is use double quotes " instead of single ' as single quotes is invalid JSON.
Teyz
15
Yeah its work !
I double the quotes and I change Content-Type for application/json
system
Closed
16
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.