API

Bleemeo exposes all its data thought a REST API.

The auto-generated API docs contains a list of the available endpoints with their parameters.

To use the API, you need to be authenticated. Two authentication methods are available:

  1. Basic authentication
  2. JSON Web Token

JSON Web Token

To generate a token you need to authenticate with your username and password to /v1/jwt-auth/ with a POST request :

$ curl -X POST -H "Content-Type: application/json" -d '{"username": "jon.snow@bleemeo.com","password":"WinterIsComing"}' https://api.bleemeo.com/v1/jwt-auth/

{"token":"eyJhbGciOiJeyJhbGciOiJ..."}

The API returns a JSON with a token property that you can use to make authenticated API calls. Example:

$ curl  -H 'Accept: application/json' -H "Authorization: JWT <YOUR_TOKEN>" https://api.bleemeo.com/v1/dashboard/

The token is valid for a period of 5 minutes. To refresh the token you need to make POST request to /v1/jwt-refresh/ with the current token:

$ curl -X POST -H "Content-Type: application/json" -d '{"token": "<YOUR_TOKEN>"}' https://api.bleemeo.com/v1/jwt-refresh/

{"token":"eytYWlsIjoic2lsdmVyZUBi..."}

You can refresh multiple times the token for a period of seven days after the authentication. After this delay, you will need to re-authenticate.