Are you using a User token, from the Auth Code or Implicit flow?
If the your token works fine for endpoints that don’t require user permissions, it’s likely you’ve used the Client Credentials flow and generated an App token, which can’t have scopes as it doesn’t represent a user.
Authorization Code and Implicit are the two OAuth flows that require user interaction, and explicitly granting permissions for your app based on the scopes you requested. The Auth Code flow is mainly for server-side requests, where as the Implicit flow is for client-side requests, such as a user on a website making requests from that webpage itself.
The User tokens from these flows allow you to use endpoints that require scopes. So if for example you wanted to get the subscriber list for broadcaster_id=1234, you would need user 1234 to go through one of those OAuth flows for your app and it will give you a User Access Token for that user, with the requested scopes.
The Client Credentials flow generates an App token, because it requires no user interaction there is no point at which a user is actually connecting to your app or explicitly agreeing to permissions, so these tokens are mostly used for making requests that do not require any permissions as they are a token that represents your app.
The documentation walks you through it step by step.
Essentially, it breaks down to:
Send the user to the auth URL in their browser.
The user will see a screen showing the name of your app and what permissions you’re requesting.
The user accepts those permissions and is sent back to your Redirect URI.
If you’re using the Auth Code flow, you’ll have a code that your server can exchange for that users token. If you’re using the Implicit flow the user will have the token in the URL hash which they can use on your site.
Sorry the thread is already closed, but I encountered the same issue. How is it then possible that there are bigger external twitch statistics page with subscriber counts even tho the user don’t actually gave them their permission? I mean it’s possible to get the followers I dont quite understand why the subscriber count would need their permission too. I understand that you would need that to get the actual user that subscribed, but for the total_count too?
And thus are inaccurate, as that data is incomplete.
Subscribe count means you can estimate how much money someone makes, and people in general don’t want you to know about their income. As thats private information.