Analysis Partial Trips Result

Service version: 1
Last edit: 2022.07.25

Purpose

Get a partial trips result by sending a POST request.

Request data

Format

POST
URL request example
https://api.tomtom.com/origindestination/1/analysis/flowmatrix/{id}/result/partial/trips?key={apiKey}&dateRange={dateRange}&timeRange={timeRange}

Example

POST
URL request example
https://api.tomtom.com/origindestination/1/analysis/flowmatrix/123/result/partial/trips?key=test-api-key&dateRange=0&timeRange=0

Required POST Headers

HeaderValue
Content-Typeapplication/json

Parameters

ParameterDescription
apiKeyAuthorization key for access to the API.
dateRangeIndex of the date range.
timeRangeIndex of the time range.

Request body stucture

FieldDescription
originsList of regions' indexes where trips started.
destinationsList of regions' indexes where trips ended.
viasList of regions' indexes where trips went through.

Request body example

POST
Request body - JSON
1{
2 "origins": [0,1,2,3],
3 "destinations": [4,5,6,7,8],
4 "vias": [10]
5}

Response data

This response will return information about the number of trips which started in a given origin, went through given vias, and ended in given origins. The following table describes all of the fields that can appear in a response.

Reponse structure

FieldDescription
linksAn array of links between regions.

Result interpretation example

POST
Response body - JSON
1{
2 "links": [[0,0,0,100], [0,1,1,200], ...]
3}

The result contains a list of 'links'. Each link contains information about trips between regions and looks like this: [Origin region index (number), Destination region index (number), Via region index (number), Amount of trips (number)]

Errors

If there is an error in the supplied parameters or any other internal problem, an error response is generated in the requested format.

HTTP Response Codes

CodeReason
201Created
400Bad request
401Unauthorized
403Forbidden
404Not Found