GET
https://api.monetate.net/api/auth/v0/refresh/
Request to refresh a token for use in token authentication.
This endpoint has no request body, but requires authentication using a signed JWT. For example, in Python using the PyJWT library:
import jwt
import requests
import time
private_key = "== SECRET RSA KEY =="
payload = jwt.encode({
'username': 'api-xxx-yourname',
'iat': time.time()
}, private_key, algorithm='RS256')
authorization = "JWT {}".format(payload)
requests.get(refresh_url, headers={'Authorization': authorization})
The JWT should contain the username associated with the key and the creation time. The private key must be associated with an uploaded, active public key. The JWT must be encoded with one of the following algorithms:
Issuing this request provides a token which is valid until the indicated expiration time. The default time until expiration (of 1 hour) can be manually set by passing a ttl query parameter with the request. Valid values are in the inclusive range of 15 minutes to 12 hours.
Issuing this request does not cause any previously issued tokens to expire, they will continue to function.
To revoke a token prior to expiration, you must deactivate the public key associated with the token.
ttlintegerThe number of seconds until the requested token expires.
200The token was successfully generated.
401Unauthorized.
The request did not include a token, or the token provided was invalid. Please ensure that your token is correct and that the Authorization header is properly formatted.
403Forbidden.
The request included a token that has been revoked. Please contact your account administrator to generate a new token.
500Unknown error.
Please try again or contact your account manager for more information.
curl --request GET \
--url 'https://api.monetate.net/api/auth/v0/refresh/?ttl=3600' \
--header 'accept: application/json'
Request to refresh a token for use in token authentication.
This endpoint has no request body, but requires authentication using a signed JWT. For example, in Python using the PyJWT library:
import jwt
import requests
import time
private_key = "== SECRET RSA KEY =="
payload = jwt.encode({
'username': 'api-xxx-yourname',
'iat': time.time()
}, private_key, algorithm='RS256')
authorization = "JWT {}".format(payload)
requests.get(refresh_url, headers={'Authorization': authorization})
The JWT should contain the username associated with the key and the creation time. The private key must be associated with an uploaded, active public key. The JWT must be encoded with one of the following algorithms:
Issuing this request provides a token which is valid until the indicated expiration time. The default time until expiration (of 1 hour) can be manually set by passing a ttl query parameter with the request. Valid values are in the inclusive range of 15 minutes to 12 hours.
Issuing this request does not cause any previously issued tokens to expire, they will continue to function.
To revoke a token prior to expiration, you must deactivate the public key associated with the token.