Token expiration
Tokens are stored on the server and remain valid for 10 minutes from the time they are generated, except for personal access tokens, whose validity is defined at creation.
For non-PAT tokens, each time a token is used in a request, its expiry time is refreshed and updated to 10 miniyhoutes after the request time. A token can be kept alive by refreshing it for up to 24 hours, after which it expires automatically.
Once a token has expired, any requests made with that token will fail. To prevent method calls from failing, you should check whether the token is still valid using one of the available validation endpoints.
Available methods
TokenValid
TokenValidA POST method that accepts the token either in the request header or in the request body.
This method always returns a 200 response code. The validation result is included in the response body. See the examples for valid and invalid response formats.
VerifyToken
VerifyTokenA GET method that accepts the token in the request headers only.
This method returns:
-
200for valid tokens -
401for invalid or expired tokens
TokenValid
// POST https://api.maximizer.com/octopus/TokenValid
// Authorization: Bearer <token>
{
}Example: Valid token response
// Request →
// POST https://api.maximizer.com/octopus/TokenValid
// Authorization: Bearer <token>
{
}// Response ←
{
"Code": 0
}Example: Invalid/expired token response
// Request →
// POST https://api.maximizer.com/octopus/TokenValid
// Authorization: Bearer <token>
{
}// Response ←
{
"Code": -1,
"Msg": [
"Token is invalid"
]
}VerifyToken
// GET https://api.maximizer.com/octopus/VerifyToken
// Authorization: Bearer <token>
Example: Valid token response
// Request →
// GET https://api.maximizer.com/octopus/VerifyToken
// Authorization: Bearer <token>
// Response ←
Example: Invalid/expired token response
// Request →
// GET https://api.maximizer.com/octopus/VerifyToken
// Authorization: Bearer <token>
// Response ←
