Authenticate against the API (POST /token)

Authenticate against the API (POST /token) When talking to the API, a token is required. The token can be obtained from the token endpoint.

Request

POST /token

Example:

POST https://controller1.cluster:7050/token
Parameter Description
None -

Request header

Request body

Query parameters

Parameter Presence Type Description
username Mandatory string Username
password Mandatory string Configured password
{
  "username": "luna",
  "password": "luna"
}

Response body

{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwiZXhwIjoxNjY4ODQyMTQwfQ"
}

Response header

State Code Description
OK HTTP 201 Created Will be expected to be returned.
FAIL HTTP 401 Unauthorized Mandatory if the credentials are invalid
FAIL HTTP 400 Bad request Returned when the request is invalid (field definitions)
FAIL HTTP 503 Service unavailable This is returned when the backend is unavailable.