How to get the Channel ID by Oauth token?

Hello there, I managed to authenticate via login on my app, and the URL returns the Token of the user who granted access, but how can I know the name of the channel or the user ID of the channel that logged in?

At this moment I only have the channel’s oauth token, I don’t have the name or user id. How to get them?

Call the Get users API: Reference | Twitch Developers

Or the validate token: Validating Tokens | Twitch Developers

Thank you so much, i believe the Validate way can help me.

but, the endpoint: is returnig me only this:


when he was suppose to return something like this:

  "client_id": "wbmytr93xzw8zbg0p1izqyzzc5mbiz",
  "login": "twitchdev",
  "scopes": [
  "user_id": "141981764",
  "expires_in": 5520838

Why is it not returning all the information?

Then you generated a client credentials token
Not a user token.

Im sorry i dont get it, the code on response url after login:


is not an user token? now i tried to use the Get Users endpoint and i got:

{“error”:“Bad Request”,“status”:400,“message”:“The id or login query parameter is required unless the request uses a user access token.”}

Well, i just want to return the channal name or the channel id from the code on the URL that the login returned to me,
Doesn’t this code work for that?

That code is a one use code to be exchanged for a token

Normally done as a server request as it requires the client secret to perform the code to token exchange.

I Got it!
so i have to POST this code on
to get the acesse token, and with this acess token i can use to get user name.

Thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.