How to consume APIs?
As an API consumer, you want to use an API published on the portal and you wonder what you must do? Here are the very main steps to follow and some example that you can reuse on your own to do so.
Summary
Request credentials
To consume an API exposed on the portal you will need to use credentials coming from a trusted authorization server such as Auth0.
To be granted with such credentials, you will need to request them to your AXA Partners business referent.
Retrieve a token
Once you get scopes attribution confirmation you can generate your token. A valid token is mandatory to consume protected endpoints.
To get more details on this point, refer to the authentication documentation.
Use the token in an API request
Now that you have your token you can make your endpoint request. Here is an example of a POST request including the token:
curl -X POST \
https://apis.axa-assistance.com/sales/v2/individual/travel/quotes_requests \
-H 'authorization: Bearer eyJ0xxx[...]xxxxxaWbNLmg4bA5X-ruhRZb5ZUisssApQBFL_0usUfTfg' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
[BODY Request]
}'
You can use Postman to test your request and also get code sample (Python, C#, ...).