This document guides you through the steps to obtain and manage your access tokens for the Albert API.
Pre-requisite: you must have a user account on the relevant Albert API to obtain an access token.
Get started by obtaining a temporary API key that will allow you to make initial requests. Replace <your email address>
and <your password>
with your credentials:
curl -X POST -H "Content-Type: application/json" -d '{"email":"<votre adresse email>","password":"<votre mot de passe>"}' https://albert-api-example/api/v2/sign_in
Save the obtained temporary API key in an environment variable to make it easier to use in future requests:
export ALBERT_API_KEY=<le jeton obtenu>
Once the temporary token is saved, you can create a permanent API token with the following command. Replace my_token_name
with a meaningful name for your token:
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ALBERT_API_KEY" -d '{"name":"my_token_name"}' https://albert-api-example/api/v2/user/token/new
To see all the tokens you have created, use this command:
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $ALBERT_API_KEY" https://albert-api-example/api/v2/user/token
To delete a specific token, replace $ALBERT_API_TOKEN
with the token you want to delete:
curl -X DELETE -H "Content-Type: application/json" -H "Authorization: Bearer $ALBERT_API_KEY" https://albert-api-example/api/v2/user/token/$ALBERT_API_TOKEN
Be careful to secure your tokens and not share them with anyone.