Contexte
ProAbono is built around an “API-First” approach based on the REST architecture style. This means that all the features offered are also accessible via API.
In order to secure the access to the data, you have to provide an authentication key for each call. To simplify the use the authentication system is based on the Basic Access method, but since the credentials are sent unencrypted, the authentication is necessarily secured via HTTPS.
The keys are only available from the BackOffice interface.
Note:
Please note! For security reasons, the requests must be made from Server to Server.
Process
1) Go to the APIs dedicated area
- Click on “Integration” from the left menu.
- Then click on the “API” button from the sub-menu.
2) Retrieve the keys
Once on the dedicated page, you just have to get the keys:
La “Agent key” corresponds to the Basic Access “Username” field.
La “API key” correspond to the Basic Access “Password” field.
Note : The “Endpoint API” field corresponds only to the live API.
3) add authentication information into Headers
To build the authentication key.
- concatenate agent key with api key separated with “:”
ex: if agent key =c7fa57b8-4861-4857
and API key =f6797af1-791b-40b1
then result isc7fa57b8-4861-4857:f6797af1-791b-40b1
- Base-64 encode the result string
YzdmYTU3YjgtNDg2MS00ODU3OmY2Nzk3YWYxLTc5MWItNDBiMQ==
- Use the encoded string in the request headers.
Authorization: Basic YzdmYTU3YjgtNDg2MS00ODU3OmY2Nzk3YWYxLTc5MWItNDBiMQ==
Sample request with Curl Curl:
AUTH=$(echo -ne "$AGENT_KEY:$API_KEY" | base64 --wrap 0)
curl \
--header "Content-Type: application/json" \
--header "Authorization: Basic $AUTH" \
--request POST \
--data '{"Email":"john@doe.com", "Name":"Mr Doe"}' \
https://xxxx.proabono.com/v1/Customer