Refreshing the Access Token

Access tokens expire in 5 minutes after generation. Once it expires, the refresh_token can be used to refresh it. Refresh tokens are valid for 90 days.

curl -D- -X POST <base_url>/api/v1/oauth/token \
    -u <CLIENT_ID>:<CLIENT_SECRET> \
    -H 'Content-Type: application/json'  \
    -d '{
            "grant_type" : "refresh_token",
            "refresh_token" : "<refresh_token>"
        }'

An example of a valid response:

{
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI797234J9.eyJ1c2VySWQiOiJmYTE4OTI3MS1mOTY1LTRmNWMtOTlmOS1lNDViNzNiYzI4MzkiLCJjbGllbnRJZCI6InZpaWEtZnBwIiwicm9sZSI6IkNsaWVudFVzZXIiLCJzZXNzaW9uSWQiOiJhZGIy097298234gtYWM4Yy1kYWM5Zjk0NTk3ZWQiLCJuYmYiOjE1Njc1MDAwOTQsImV4cCI6MTU2NzUwMzY5NCwiaWF0IjoxNTY3NTAwMDk0fQ.39njmCN97823498UbPXUiXl_SmWgnxM2x9phxhAxYI",
    "expires_in": 300,
    "redirect_uri": null,
    "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI797234J9.eyJ12Vy98762872344OTI3MS1mOTY1LTRmNWMtOTlmOS1lNDViNzNiYzI4MzkiLCJjbGllbnRJZCI6InZpaWEtZnBwIiwiY29uc2VudElkIjoiYTYyODExYWYtNzUxMS00ZWQ0LThiYTEtMjAwNzc2NGQ1MTIwIiwic2Vzc2lvbklkIjoiYWRiMjEyNmEtOTczZi00OWI4LWFjOGMtZGFjOWY5NDU5N2VkIiwicm9sZSI6IlJlZnJlc2hUb2tlbiI98o727934UwMDA5NCwiZXhwIjoxNTY4NzA5Njk0LCJpYXQiOjE1Njc1MDAwOTR9.6eBV4OH96782734HEQoMbB_9yedl_2JfzsiSNcwa0",
    "token_type": "bearer"
}

The new access_token and refresh_token can now be used for requests.

Last updated