The refresh endpoint may be used to request an updated JWT to be used for authorisation in other requests to this API. It expects a refresh token to be included as a Bearer token in an Authorization header. This token can be extracted from the original accessToken.
Responses
-
This request will return a JSON object containing the below values. The accessToken is the replacement JWT token to be used in all subsequent requests to this API until its expiry.
-
This request may generate a 400 Error if;
- Token presented in Authorization Header is invalid
- Token presented in Authorization Header is missing
- Any request type other than POST is used.
POST
/refresh
curl \
-X POST https://api.gift-stream.com/refresh \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NzA0MTU0ODgsImlzcyI6ImFwaS5naWZ0Y2FyZC5hcHBkZWxpdmVyYW5jZS5jb20iLCJuYmYiOjE2NzA0MTU0ODgsInVzZXJOYW1lIjoiY2hyaXNAaWlzOS5jby51ayIsImNsaWVudElkIjoiMiIsInRva2VuLXR5cGUiOiJSRUZSRVNIIn0.fCiB66HaX5EaM-2t43I_Kvg7W0Jsp6OLQ2HiUZV3kjTilLzfbKN23Ql_sz1OtiysaHIlLV31ORxfBXWOKDLsGw"
Response examples (200)
{
"message": "OK",
"timestamp": "integer",
"accessToken": "string",
"token-id": {
"type": "integer"
}
}
Response examples (200)
{
"timestamp": 42,
"message": "string",
"accessToken": "string",
"token-id": 42
}
Response examples (400)
{
"message": "Missing Token",
"timestamp": 1671029957
}
Response examples (400)
{
"message": "string"
}