POST /refresh

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.

Headers

  • Authorization string Required

    Bearer accessToken

Responses

  • 200

    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.

    Hide response attributes Show response attributes object
    • timestamp integer
    • message string
    • accessToken string
    • token-id integer
  • 400

    This request may generate a 400 Error if;

    1. Token presented in Authorization Header is invalid
    2. Token presented in Authorization Header is missing
    3. Any request type other than POST is used.
    Hide response attribute Show response attribute object
    • message string
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"
}