Twitch API saying "Bad Request"

I’m trying to use the twitch api (testing with https://reqbin.com/)
with my headers:

Client-ID: myclientidwhichIcreatedyesterday
Authorization: Bearer myrealtokenIjustvalidadedit

and a get request to:
https://api.twitch.tv/helix/users?login=fredthewaffl
(my twitch account)
but I get this error:

{
    "error": "Bad Request",
    "status": 400,
    "message": "Must provide an ID, Login or OAuth Token."
}

does anyone know how I can fix this?
did I type the headers wrong?

Sounds like something is overriding the login query parameter and reqbin is not sending the request you think it is.

Since if the token is invalid you’d get a 401.

And just checking you did generate a user or app access token, and you are not using your ClientSecret as a token? (Which shouldn’t generate a 400 here but a 401 with clientID mistmatch, but worth checking)

I generated the token via posting to this url:

https://id.twitch.tv/oauth2/token?client_id=<redacted>&client_secret=<redacted>&grant_type=client_credentials&scope=user:read:email

And I could validate it
(https://id.twitch.tv/oauth2/validate)

Authorization: Bearer <redacted>

This is useless as client_credentials can’t have scopes on them (so you won’t get the email address in the response anyway), as it doesn’t represent a user

This suggests something is causing ?login=fredthewaffl to not be sent with your request using this tool.

So the error of

{
    "error": "Bad Request",
    "status": 400,
    "message": "Must provide an ID, Login or OAuth Token."
}

means, it got the token, but no ID or login. And couldn’t lookup the user that belongs to the token as the token is of type “App Access”

reqbin is probably messing with your request and it’s not calling what you think it’s calling.

As everything you are doing looks correct, so reqbin must be at fault.

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