Authentication
API Authentication
To access the Adastra Toll API, you need to authenticate your requests using an API key. This key verifies that you have permission to use the API.
Obtaining Your API Key
To obtain an API key, please send a request to api-request@adastrai.com with the following information:
- Your Name
- Your Company/Organization (if applicable)
- Your Intended Use Case for the API
- Your Contact Information
We will review your request and provide you with an API key if appropriate.
Important: Keep your API key secure and do not share it with unauthorized individuals.
Using Your API Key
You need to include your API key in every API request. For the Toll endpoint, the API key is passed as a query parameter in the URL, and other parameters are passed in the body as a JSON object. For the Report endpoint, the API key and secret are passed as query parameters in the URL.
Using Your API Key
You need to include your API key in every API request by appending it to the URL as a query parameter named key
.
Example Request (Toll Endpoint):
https://api.adastrai.com/toll?key=YOUR_API_KEY
The request body should be a JSON object containing the following parameters:
{
"vehicleTypeId": "1",
"lang": "en",
"mapsource": "google",
"expandTollsData": true,
"departureTime": "2024-12-18T20:11:08.726Z",
"steps": "40.90855,29.31515;40.90878,29.31577;40.90878,29.31578;40.90922,29.31678;....."
}
Replace YOUR_API_KEY with your actual API key. The other parameters can be changed depending on your needs.
Example Request (Report Endpoint):
For the report endpoint, you’ll also need to include your secret key as well as your key as query parameters:
https://api.adastrai.com/report?key=YOUR_API_KEY&secret=YOUR_SECRET_KEY&reportName=all&timeCriteria=d