Skip to main content

Token

1 endpoint

POST /tokens Obtain a JWT token

Obtain an JWT token to interact with the API. Header must include API Basic Auth while the body must include the grant_type (password | refresh_token) and the associated credentials. If the userId field is provided, the access token will only allow operations for that specific user.

Request Body

grant_type required
string (enum)
username
string
password
string
refresh_token
string
userId
string
If the userId field is provided, the access token will only allow operations for that specific user.

Responses

201
POST https://api.qa.onyze.pro/v1/tokens
Request body
{
"grant_type": "password",
"username": "your username",
"password": "your password",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"userId": "EebUdiv1t"
}
Response 201
{
"id": "d8vJIh-H",
"createdAt": "2018-08-17T17:04:55.626Z",
"updatedAt": "2018-08-21T18:24:17.185Z",
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": "86400",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"client": {
"id": "d8vJIh-H",
"createdAt": "2018-08-17T17:04:55.626Z",
"updatedAt": "2018-08-21T18:24:17.185Z",
"name": "client name",
"email": "client@example.com",
"audience": [
"general"
]
},
"userId": "EebUdiv1t"
}