All pages
Powered by GitBook
1 of 1

Loading...

Refresh JSON Web Token

Here, you can learn how to make an API call to refresh a valid JSON Web Token. Once you execute the call successfully, you will receive a JSON Web Token with new expiration time.

You can use the refresh JSON Web Token endpoint to renew a valid token of an employee or customer. For renewal, provide the respective token as the value for the x-auth-token header parameter.

Sample API call

To refresh a valid JSON Web Token, make the following API call.

Sample request

Below is an example request body of the API call to refresh a valid JSON Web Token.

https://auth-api.sandbox.tuumplatform.com/api/v1/authorise/refresh
curl -X POST 'https://auth-api.sandbox.tuumplatform.com/api/v1/authorise/refresh' \
-H 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDctMjhUMTA6MDM6MjEiLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHAiOjE2OTA1Mzg2MDF9.vOLapdiXflbGV4c2pJnziQzgJzP1MYPPBcdk4wIZdoM' \
-d ''

This POST request does not have a body.

Sample response

Below you find an example response body to the API call above.

Response
{
    "errors": null,
    "validationErrors": null,
    "data": {
        "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDctMjhUMTA6MDM6MjEiLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHAiOjE2OTA1Mzg2MDF9.vOLapdiXflbGV4c2pJnziQzgJzP1MYPPBcdk4wIZdoM"
    }
}

Result

The response will contain a fresh JSON Web Token with an updated expiration time.

You can keep making API calls using the renewed JSON Web Token.

https://auth-api.sandbox.tuumplatform.com/api/v1/authorise/refresh

Learn more about the endpoint in the Tuum developer portal.

refresh JSON token