Analysis Partial Trips Result

Service version: 1
Last edit: 2022.08.22

Purpose

Get a partial trips result 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.
  • Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.

Format

post
URL request format
https://{baseURL}/origindestination/{versionNumber}/analysis/flowmatrix/{id}/result/partial/trips?key={Your_API_Key}&dateRange={dateRange}&timeRange={timeRange}

Example

post
URL request example
https://api.tomtom.com/origindestination/1/analysis/flowmatrix/123/result/partial/trips?key={Your_API_Key}&dateRange=0&timeRange=0

Required parameters

Required parameters

Description

baseURL
string

The base URL for calling TomTom services.


Value: api.tomtom.com

versionNumber
string

Version of the service to call.


Value: The current value is 1.

id
integer

Analysis number id.


Value: The analysis number id.

key
string

Authorization key for access to the API.


Value: Your valid API Key.

dateRange
integer

Index of the date range.


Value: Example: 0

timeRange
integer

Index of the time range.


Value: Example: 0

Required POST headers

Header

Value

Content-Type

application/json

Request POST body example

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

Request POST body stucture

Field

Description

origins

List of region indexes where trips started.

destinations

List of region indexes where trips ended.

vias

List of region indexes where trips went through.

Response data

This response will return information about the number of trips which started at 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. External region is indexed as the last one and is equal to the number of defined regions (there is no External region for the passMatrix enabled option)

Response 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:
[0,0,0,100] - [Origin region index (number), Destination region index (number), Via region index (number), Amount of trips (number)]

Reponse structure

Field

Description

links
array

An array of links between regions.

Errors

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

Response codes

Code

Meaning & possible causes

201

Created

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found