Validate an AccessToken with new API

Hi
I am currently validating a user’s access token via “https://api.twitch.tv/kraken
I am using RestSharp and this works correctly.

var client = new RestClient(“https://api.twitch.tv/kraken”);
var twitchValidateRequest = new RestRequest($"?oauth_token={####TwitchAccessToken####}");
var twitchValidateResponse = client.Execute<List<Model.Twitch.TwitchValidateRootObject>>(twitchValidateRequest);
*** twitchValidateResponse.Data[0].token.valid will now show if the access token is valid or not

I want to do the same with the new API
What is the equivalent URL for the new API so I can do this?
Anything else different?

Is valid for v3/v5 (kraken) and Helix

Thanks but if I replace https://api.twitch.tv/kraken with https://id.twitch.tv/oauth2/validate in my above sample I get a 404 when trying to validate. Any idea?

Please read the documentation.

As per the documentation you must perform the request like so:

curl -H "Authorization: OAuth <access token>" https://id.twitch.tv/oauth2/validate

You must pass the authorisation via a header not as a query string argument. Most if not all of Helix/New API doesn’t accept Auth by query string argument

Thank you, it’s working now.

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