400: Bad Request

When trying to get the access token I’m always running into that Bad Request 400 error. I’m not really sure what the grant_type is.

POST https://api.twitch.tv/kraken/oauth2/token

POST Body (URL-encoded)
client_id=<your client ID>
&client_secret=<your client secret>
&grant_type=authorization_code
&redirect_uri=<your registered redirect URI>
&code=<authorization code received above>

I do have the client id, the client secret, the redirect uri and the code. I tried using the code that I get from my redirect uri for the grant_type but it always gives me the bad request error. I also tried the oauth key but it didnt work. I really dont know what key to use and I hope somone can help me out.

Thank you in advance.

Grant type should be token for implicit or code for authorization grant flow

I dont get it. I need a “authorization code” for grant type. Where do I find this code? Is it the code that I’m writing in here? &code=<authorization code received above>

You have the grant_type correct for the authorization code flow. Could you share your code that you use to make the POST? There are lots of reasons why you might be getting a 400 returned.

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