API Authentication

To access the API you must provide a valid token on each access.

The API has been designed so that each user can generate their own token. The process is as follows:

Issue a post to the endpoint /api/sign-in with the following json body structure

{
  "email": "<email>",
  "password": "<password>"
}

Example:

curl -X 'POST' \
  'https://iotsimhub.net/api/sign-in' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "<email>",
  "password": "<password>"
}'

If the authentication is not successful, then an error will be returned:

{
  "errors": { "detail": "Unauthorized" }
}

A successful authentication will return a bearer token structure

{
  "token": "<token value>",
  "type_type": "Bearer"
}

On each subsequent request, include the HTTP header

Authorization: Bearer <token value>