Codechef APi issue with Postman

I also having trouble in using codechef api’s from postman, before accessing any api you must be access token. To get access token I followed below process.

  1. authorization screen for postman collection First Image
  2. entered valid details needed for to get access token Second image
  3. redirected to login screen of code chef Third Image
  4. logged in and authorized the application Fourth image
  5. Then it will throw error stating that unsupported media type 415. Fifth Image

The reason behind this is content-type for POSt request id set to “application/x-www-form-urlencoded” but it should be application/json as stated in documentation.

My question is can you suggest a work-around to use it or proper steps to use it thourgh curl


your_client_id = your app’s client id.

your_client_secret = your app’s client secret.

your_redirect_uri = URL of your server to receive authorization token.

state_code = some random code for security.

If you want to use curl then

1.) Run this URL in your browser (
This will show a pop up window to login and select your scopes. This process will be done on client side.

2.) After client authentication, you will receive a code on your_redirect_uri. This code is Authorization code(your_authorization_code). Use this code to get access token for the user using this curl on your server.

curl -X POST -H ‘content-Type: application/json’ -d ‘{“grant_type”: “authorization_code”,“code”: “your_authorization_code”,“client_id”:“your_client_id”,“client_secret”:“your_client_secret”,“redirect_uri”:“your_redirect_uri”}’

3.) Now you will get accessToken and refreshToken for that user on your server.

For an example, you can use authorization in console with grant type “Authorization Code” of your test app.

Thanks for the response