Authentication
This guide describes how to authenticate Aria’s API to integrate our services into your application.
We support two methods:
- OAuth2 with
client_credentials
flow - API Key (Still supported but we strongly recommend you to use OAuth2 as this could become deprecated some day)
Using OAuth2
Steps
- Generate an Application to obtain a Client ID and a Client Secret on your dashboard
- Obtain an
access_token
- Send the
access_token
in your API request
Generate the Application
Login to your dashboard, and navigate to the Settings view. Click on the "Applications & Clés API" tab and click on the "Générer une application" button.
Obtain the access_token
access_token
Get an access_token
by making this request:
curl -XPOST \
https://auth.helloaria.eu/oauth/token \
-H 'content-type: application/json' \
-d'{
"client_id": "${YOUR_CLIENT_ID}",
"client_secret": "${YOUR_CLIENT_SECRET}",
"audience": "${ARIA_AUDIENCE}",
"grant_type": "client_credentials"
}'
where:
${YOUR_CLIENT_ID}
is your Application "Client ID" visible on the dashboard${YOUR_CLIENT_SECRET}
is your Application "Client Secret" visible on the dashboard${ARIA_AUDIENCE}
is:<https://api.helloaria.eu
> in production<https://api.sandbox.helloaria.eu
> in sandbox
The response looks like this:
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsIm...",
"scope": "legacy:readonly legacy:readwrite legacy:manager",
"expires_in": 86400,
"token_type": "Bearer"
}
Notes:
- The token expires in
expires_in
seconds. - You must cache the
access_token
and only generate a new one when it expires: you cannot generate an infinite number of tokens!
Send the access_token
access_token
Every time you make an API call, be sure you send your access_token
via the Authorization
header.
Here's a sample request to fetch your Company
informations:
curl -XGET 'https://makaluapi.helloaria.eu/companies/me' \
-H 'Authorization: Bearer ${access_token}'
Using API Key (Still supported and will slowly become deprecated)
Steps
- Generate an API Key on your dashboard
- Send the API Key in your API request
Generate the API Key
Login to your dashboard, and navigate to the Settings view. Click on the "Applications & Clés API" tab and click on the "Générer une nouvelle clé" button.
Send the API Key
Every time you make an API call, be sure you send your API Key via the X-API-Key
header.
Here's a sample request to fetch your Company
informations:
curl -XGET 'https://makaluapi.helloaria.eu/companies/me' \
-H 'X-API-Key: ${apiKey}'
Updated 8 months ago