Authentication
We provide two options for authentication in validating the API Requests:
- Bearer Token
- User Key
#
Getting the TokenThis token is generated using JWT (Json Web Tokens) to ensure a secure and strict way of transmitting information between requests.
You can get the Bearer Token simply by hitting the endpoint of our login API.
Endpoint:
{base-url}/api/v1/users/token
Payload:
body
{ "username": "user@email.com", "password": "secret"}
Response:
success
{ "access_token": "jwt-token-generated", "user_key": "user-key-generated", "token_type": "Bearer"}
failed
{ "detail": "Incorrect username or password"}
#
Implementing the Token#
Bearer TokenPut the value of access_token
into the Authorization Header of each requests.
Example:
Headers
{ "Authorization": <token_type> <access_token>}
#
User KeyPut the value of user_key
into the Authorization Header of each requests.
Example:
Headers
{ "Authorization": <user_key>}