How to use getUsers endpoint?

I’m trying to get 1 userid with
https://api.twitch.tv/helix/users?login=candybomberz

using postman I use noAuth as authentication
and I’m using my Client-Id: <client id>
as header

I’m getting following response:

{
    "error": "Unauthorized",
    "status": 401,
    "message": "OAuth token is missing"
}

From what I’ve read on the forum using client-id as header should be enough,
what am I doing wrong?

I’ve read this topic:

and it states using header with client-id should be enough, is that outdated?

That post you’ve linked is 4 years old, so yes it’s out of date. All API requests require an OAuth token now, as shown in the documentation for the Get Users endpoint.

You can get an OAuth token by following the Authentication Documentation and choosing whichever auth flow best suits your application.

Yeah, now that I figured out how to use the “OAuth client credentials flow”, I just got myself an access token and the twitch4j method for getUser is working with that access token as first parameter.

I was a bit confused because I tried to go the website https://id.twitch.tv/oauth2/token
and it showed “404 page not found”, so for a second I thought that endpoint was outdated aswell, but you have to use postman or some http client to POST to it, then it returns normal error messages and once you give it valid parameters you actually get a token in your response.

I was trying all kinds of auth tokens with the twitch4j method for getUser and all returned a response saying invalid auth token which was very confusing.

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