I get this error when I want to use the Get Moderators endpoint :
{"error":"Unauthorized","status":401,"message":"Insufficient authorization in token"}
I succeeded to use other endpoints, but I have issues with this one, and in the docs (available below), it says that the query parameter “broadcaster_id” must match the user_id in the auth token.
But in the auth token, there’s no user_id ? My Twitch account id is 90849777 but it doesn’t work
If your token doesn’t have a user id, then that means you used the Client Credentials flow and generated an App token, which isn’t associated with a user and so can’t have the scopes required to access endpoints that require permission from the user.
I’m making requests server-side, I think I already use the Auth Code flow because it works on other endpoints, but it’s especially with Get Moderators…
You’re token doesn’t doesn’t have a user id, and the expiration is too long for a token from the Auth Code flow.
Follow the process of one of the auth flows I linked above, and it’ll send you to Twitch where you can accept/deny the permissions being asked for, and the redirect you back to your redirect URI where you can finish the auth process.