What does the request for a new access_token using refresh_token returns ?

When someone requests for a access_token using the refresh_token, does it return the same JSON with new access_token as well as refresh_token? Or, just a new access_token with the refresh_token being the same which was issued for the first time?

(Please share a sample response, if possible!)

Also, as per the documentation:

‘Using access tokens after they get expired will result in an “Invalid Token Error”.’

Can someone please share sample response for the above case (i.e. using access tokens after they get expired) ?


@alfarhanzahedi, when you request a new access token using refresh token, a new access token along with new refresh token gets generated. Following is the sample request and response for the same:

Request for refresh token:

curl -X POST https://api.codechef.com/oauth/token -H ‘content-Type: application/json’ -d ‘{“grant_type”:“refresh_token” ,“refresh_token”:“70907c190601ee461c7ce91d83affc2f778bf2qq”, “client_id”:“07ddca54f4b9cfecb174eb30a24e0221”,“client_secret”:“f4b4fece86a2737fe9d6f9a7e845db21”}’

Response for the above request:

{“status”:“OK”,“result”:{“data”:{“access_token”:“483d3aec02d6ad6f5ef076bef5904d675cd1dd11”, “expires_in”:3600,“token_type”:“Bearer”,“scope”:“public”,

This is the sample response for the request made using expired access_token:

{“status”:“error”,“result”:{“errors”:[{“message”:“Unauthorized for this resource scope”,“code”:“unauthorized”}]}}