The easiest way to use the API is through our official Python and Go SDKs. They handle authentication for you: they obtain an OAuth token from your credentials, renew it when it expires, and revoke it when you are done. They also take care of pagination, errors and retries.
The SDKs use the standard OAuth 2.0 flow, with no Bleemeo-specific step. If you work in another language, any OAuth 2.0 client library works, or you can make the HTTP calls yourself as shown below.
All requests use the public client ID 29a6c65e-8c9d-4c6e-b478-1c7ea99c34f2, with no client secret.
Step 1: Get a Token
Exchange your credentials for a token, using the password grant:
POST/o/token/
Exchange credentials for an access token and a refresh token
access_token — Token to send with your API requests
expires_in — Number of seconds the access token remains valid. The lifetime may change, so always rely on this field rather than a fixed duration
refresh_token — Token to get a new access token without sending your credentials again
Step 2: Make Authenticated Requests
Send the access token in the Authorization header:
Terminal window
curl-H"Authorization: Bearer 9Fk2..."\
https://api.bleemeo.com/v1/agent/
Step 3: Refresh the Token
When the access token expires, or when the API answers with a 401 status, get a new one with the refresh_token grant:
POST/o/token/
Get a new access token from a refresh token
Terminal window
curl-XPOST\
-dgrant_type=refresh_token\
-dclient_id=29a6c65e-8c9d-4c6e-b478-1c7ea99c34f2\
-drefresh_token=Xa7p...\
https://api.bleemeo.com/o/token/
The response has the same format as in step 1. It contains a new refresh token: keep it for the next refresh, as the previous one is no longer valid. If the refresh fails, authenticate again with your credentials.
Step 4: Revoke the Token
When your script is done, revoke the refresh token. This also revokes the related access token: