1. Authentication

1.1. Login

Endpoint: /auth/login
Method: POST
Description: Get a fresh access token and a refresh token
Request data:
Field Type Required
username string Yes
password string Yes
Response data:
Field Type
message string
message_type string
result
Object
- user_id: string
- access_token: string
- access_token_expiration: string
- refresh_token: string
- refresh_token_expiration: string
Request example:
curl -X 'POST' '{{ host_url }}auth/login' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"username": "exampleusername", "password": "examplepassword"}'

1.2. Refresh

Endpoint: /auth/refresh
Method: GET
Request header: Authorization: Bearer <refresh_token>
Description: Get a new, not fresh, access token
Response data:
Field Type
message string
message_type string
result
Object
- access_token: string
- access_token_expiration: string
Request example:
curl -X 'GET' '{{ host_url }}auth/refresh' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <refresh_token>'

1.3. Logout

Endpoint: /auth/logout
Method: GET
Request header: Authorization: Bearer <access_token>
Description: Revoke an access token
Response data:
Field Type
message string
message_type string
Request example:
curl -X 'GET' '{{ host_url }}auth/logout' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access_token>'