Renew Your Token (JWT)
Endpoint
https://api.verifik.co/v2/auth/session
This method renews the access token generated with other login endpoints, with a validity period of 30 days. After this period, it is necessary to generate a new Access Token. The only parameter required for renewal is the previous token, as long as it has not expired. This service only renews tokens that are still valid.
Headers
| Name | Value |
|---|---|
| Authorization | <token> |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
origin | string | No | Defines the action to perform with the token. In this case, the action will be "refresh". |
expiresIn | number | No | Integer representing months: 1 = 1 month, 2 = 2 months, etc. |
Request
- JavaScript
import axios from 'axios';
const options = {
method: 'GET',
url: 'https://api.verifik.co/v2/auth/session',
params: {origin: 'refresh', expiresIn: 120},
headers: {
Authorization: '<token>'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
Response
- 200
{
"accessToken": "eyJhbGcpXVCJ9.eyJjbGllbnR...JZCIYiUzNjEaIWxYShWeBaRs",
"tokenType": "bearer"
}