Analysis Partial Histogram Result
Request
Get partial histogram result by sending a POST request.
https://api.tomtom.com/origindestination/1/analysis/<id>/result/partial/histogram?key=<apiKey>&dateRange=<dateRange>&timeRange=<timeRange>&type=<type>
Example
https://api.tomtom.com/origindestination/1/analysis/1/result/partial/trips?key=test-api-key&dateRange=0&timeRange=0&type=HOURS_OF_DAY
Required POST Headers
Header | Value |
---|---|
Content-Type | application/json |
Parameters
Parameter | Description |
---|---|
apiKey | Authorization key for access to the API. |
dateRange | Index of date range. |
timeRange | Index of time range. |
type | Type of histogram. One of the following values:
|
Request body stucture
Field | Description |
---|---|
origins | List of regions' indexes where trips started |
destinations | List of regions' indexes where trips ended |
vias | List of regions' indexes where trips went through |
Request body example
{
"origins": [0,1,2,3],
"destinations": [4,5,6,7,8],
"vias": [10]
}
Response
This response will return array where each index is histogram’s bucket with information about number of trips which started in given origin, went through given vias and ended in given destinations. The array size depends on histogram type you choose:
type | size of array |
---|---|
HOURS_OF_DAY | 24 |
DURATIONS | 10 |
LENGHTS | 17 |
Response structure
Response contains array of numbers. Each value is a number of trips which started in given origins, went through given vias and ended in given destinations
Result interpretation example
[20, 40, 30, 340, 2137, 320, 30, 20, 10, 1000]
Result is an array of numbers where each index is a histogram’s bucket. Above example is a DURATIONS histogram, which has 10 buckets. First entry is a number of trips which durations was between 0 and 20 minutes, second entry is 20-40 minutes and so on, where last entry shows number of trips which duration was more than 180 minutes.
Errors
If there is an error in the supplied parameters or any other internal problem an error response is generated in the requested format.
Code | Reason |
---|---|
201 | Created |
400 | Bad request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |