Refresh Your Tokens
Your access token has a short lifespan. When it expires, you will start receiving 401 error responses from the API that looks like this.
Jwt expired Error
{
"message": "jwt expired",
"kind": "TokenError",
"statusCode": 401
}
This is when your refresh token comes into play.
- To get a new pair of tokens, make a POST request to the refresh endpoint see API Docs with your refresh token.
- The server will invalidate the old refresh token, return a new pair of access and refresh tokens.
Take care
You should only use your secret key to get a new refresh token if the current refresh token has expired.
And there you have it! You've successfully navigated our authentication system. With these steps, you should be able to smoothly interact with our developers API. Always remember to secure your secret key, access token, and refresh token.