Skip to main content
POST
/
oauth
/
token
Request or refresh an OAuth token
curl --request POST \
  --url https://api-dev.narrative.io/oauth/token \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data grant_type=refresh_token \
  --data client_id=zzzzzzzzzzzzz \
  --data refresh_token=yyyyyyyyyyy
{
  "access_token": "xxxxxxxxxxx",
  "access_token_expires_in": 3600,
  "refresh_token": "yyyyyyyyyyy",
  "refresh_token_expires_in": 14400
}

Authorizations

Authorization
string
header
required

Security scheme for requesting and refreshing tokens using the /auth/token endpoint. Uses basic authentication with client_id as the username and client_secret as the password.

Body

application/x-www-form-urlencoded

Request or refresh token

grant_type
enum<string>
required
Available options:
refresh_token,
client_credentials
Example:

"refresh_token"

client_id
string

A client specific identifier provided by Narrative

Example:

"zzzzzzzzzzzzz"

refresh_token
string

The token used to refresh the API session. Required if grant_type is refresh_token

Example:

"yyyyyyyyyyy"

Response

200 - application/json

Refreshed token

access_token
string
required

The access token

Example:

"xxxxxxxxxxx"

access_token_expires_in
integer
required

The TTL of the access_token in seconds

Example:

3600

refresh_token
string
required

The refresh token

Example:

"yyyyyyyyyyy"

refresh_token_expires_in
integer
required

The TTL of the refresh_token in seconds

Example:

14400