Authentication

To use the HiQOR API, you need to authenticate your requests using JWT token authentication. This section explains how to obtain and use authentication tokens.

Obtaining an Authentication Token

To get an authentication token, use the following endpoint:

POST /storage/authenticate

Request Body

{
  "username": "your_username",
  "password": "your_password"
}

Response

If the credentials are valid, the API will return an authentication token. If not, it will return an "Unauthorized" error.

Example Request

curl -X POST https://7hh4csiioi.execute-api.us-west-2.amazonaws.com/default/storage/authenticate \
  -H "Content-Type: application/json" \
  -d '{"username": "your_username", "password": "your_password"}'

Example Response

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}

Using the Authentication Token

For all API calls, include the token in the Authorization header of your request, prefixed with "Bearer ":

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Note: Tokens expire periodically, and you must request a new one when this happens.

Error Responses

If authentication fails, you may receive one of the following responses:

Missing Token

{
  "message": "No authorization header present"
}

Invalid Token

{
  "message": "Invalid token"
}

Remember to keep your authentication token secure and do not share it publicly. If you suspect your token has been compromised, request a new one immediately.