Report creation
Purpose
Create an Area Analytics report by sending a POST request.
Request data
HTTPS method: POST
For ease of viewing and identification:
- Constants and parameters enclosed in curly brackets { } must be replaced with their values.
- See the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
Format
https://{baseURL}/areaanalytics/reports?key={Your_API_Key}
Example
https://api.tomtom.com/areaanalytics/reports?key={Your-API-Key}
Request parameters
Required parameters | Description |
---|---|
| The base URL for calling TomTom services. Value: |
| Authorization key for access to the API. Value: Your valid API key. |
Request POST body example
1{2 "name": "Amsterdam",3 "startDate": "2024-08-06",4 "endDate": "2024-08-06",5 "hours": [6 7,7 88 ],9 "frcs": [10 0,11 1,12 2,13 3,14 4,15 516 ],17 "dataTypes": [18 "NETWORK_LENGTH",19 "CONGESTION_LEVEL",20 "FREE_FLOW_SPEED",21 "TRAVEL_TIME",22 "SPEED"23 ],24 "features": [25 {26 "type": "Feature",27 "properties": {28 "name": "Amsterdam",29 "timezone": "Europe/Amsterdam"30 },31 "geometry": {32 "coordinates": [33 [34 [35 4.896128,36 52.38240237 ],38 [39 4.875701,40 52.36845941 ],42 [43 4.923611,44 52.3634145 ],46 [47 4.896128,48 52.38240249 ]50 ]51 ],52 "type": "Polygon"53 }54 }55 ]56}
Request POST body fields
Required fields | Description |
---|---|
| Name of the report. |
| Start date of the analysis in |
| End date of the analysis in |
| List of data types to analyze.
|
| Set defining the frequency levels to include. |
| Set of integers representing the hours to analyze. |
| List of region definitions. |
Required POST headers
Header | Value |
---|---|
|
Regions definition format
Regions should be defined as a GeoJSON Feature Object. Each feature can only contain the following types of geometries: Polygon
, MultiPolygon
. You may define the feature properties called name
and timezone
for every region. Otherwise, they will be generated automatically.
Response data
This response will return information about the created area analytics report. The following table describes all of the fields that can appear in a response.
Response structure
Field | Description |
---|---|
| Report ID for the created area analytics. Processing is asynchronous. Report ID may be used for fetching response using /results endpoint |
Errors
If the supplied parameters are invalid or an internal error occurs, the API returns an error response in the requested format.
Response codes
Code | Meaning & possible causes |
---|---|
| Created |
| Bad Request |
| Unauthorized |
| Forbidden |
| Not Found |