Asynchronous Matrix Status
Purpose
This endpoint lets clients check the status of a matrix job they submitted.
Request data
HTTPS method: GET
- 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.
URL request format
All of the following parameters are required:
https://{baseURL}/routing/matrix/{versionNumber}/async/{matrixJobId}?key={Your_API_Key}
URL request example
https://api.tomtom.com/routing/matrix/2/async/00-00000000-0000-0000-0000-000000000000-0000?key={Your_API_Key}
curl command request format
curl 'https://{baseURL}/routing/matrix/{versionNumber}/async/{matrixJobId}?key={Your_API_Key}'
Request headers
The following table describes HTTP request headers of particular interest to Matrix Routing v2 service clients. Note: There are no required headers in this endpoint.
Optional headers | Description |
---|---|
Tracking-ID | Specifies an identifier for the request.
Value: An |
Request parameters
The following table describes the request parameters.
- Required parameters must be used or the call will fail.
- Optional parameters may be used.
- A parameter's data type is beneath its name.
Required parameters | Description |
---|---|
| Base URL for calling the API.
|
| The version of the service to call. |
| Id of the matrix job to check. It is provided in the response body of a
submission request. |
| An API Key valid for the requested service. |
Response data
HTTP status codes
Code | Meaning & possible causes |
---|---|
200 | Request was successful and information about a matrix job's current status will be returned to the client. |
403 | Forbidden: The API Key is missing, inactive, invalid, not entitled to use Matrix Routing v2 API, or exceeded the available quota. This can also occur when using HTTP instead of HTTPS. |
404 | The requested resource could not be found, possible reasons:
|
405 | Method Not Allowed: The client used an HTTP method other than GET. |
414 | Requested URI is too long: Indicates that the URI requested by the client is longer than the server is willing to interpret. |
429 | Too Many Requests: Quota was exceeded for the API Key. |
500 | An error occurred while processing the request. Please try again later. |
502 | Internal network connectivity issue. Please try again later. |
503 | Service currently unavailable. Please try again later. |
504 | Internal network connectivity issue or a request that has taken too long to complete. Please try again later. |
596 | Service not found. Request contains an incorrect FQDN and/or path. |
Response headers
The following table lists HTTP response headers of particular interest to Matrix Routing v2 service clients.
Header | Description |
---|---|
Access-Control-Expose-Headers | A comma separated list of HTTP header names that browsers are allowed to
access. |
Access-Control-Allow-Origin | A header instructing browsers to allow customer websites to contact the
Matrix Routing v2 service. |
Content-Encoding | The Matrix Routing v2 service applies gzip compression to the response
if it is requested by the client with the Accept-Encoding
header. |
Content-Type | The format of the response. |
Tracking-ID | An identifier for the request. If the Tracking-ID |
Successful response
1HTTP 200 OK2{3 "jobId": "unique matrix job id",4 "state": "Submitted" | "Validated" | "Completed" | "Failed",5 "detailedError": object6 "statistics": {7 "totalCount": integer,8 "successes": integer,9 "failures": integer,10 "failureDetails": [11 {12 "code": string,13 "count": integer14 },15 ...16 ]17 }18}
Example 1
Status of a job that has passed validation and is in processing:
1HTTP 200 OK2{3 "jobId": "00-00000000-0000-0000-0000-000000000000-0000",4 "state": "Validated"5}
Example 2
Status of a job that has failed validation because of an issue in the submission request body:
1HTTP 200 OK2{3 "jobId": "00-00000000-0000-0000-0000-000000000000-0000",4 "state": "Failed",5 "detailedError": {6 "code": "BAD_REQUEST",7 "message": "Bad Request",8 "details": [9 {10 "code": "BAD_ARGUMENT",11 "message": "Error(s) detected in POST body",12 "target": "postBody",13 "details": [14 {15 "code": "BAD_ARGUMENT",16 "message": "Expected minimum item count: 1, found: 0",17 "target": "postBody:#/origins"18 }19 ]20 }21 ]22 }23}
Example 3
Status of a completed job containing statistics and failed route details (if any).
1HTTP 200 OK2{3 "jobId": "00-00000000-0000-0000-0000-000000000000-0000",4 "state": "Completed",5 "statistics": {6 "totalCount": 1000,7 "successes": 997,8 "failures": 3,9 "failureDetails": [10 {11 "code": "MAP_MATCHING_FAILURE",12 "count": 113 },14 {15 "code": "UNKNOWN",16 "count": 217 }18 ]19 }20}
Successful response fields
Primary fields | |
---|---|
Field | Description |
| Unique matrix Job Id. |
| Possible values:
The value list of the Only When a job enters the When a job enters the |
| Optional field, present in an HTTP 200 response body only when the state
is The content of this object is defined the same as in the case of an
error response: |
| Optional field, present when the state is |
statistics object | |
Field | Description |
| Total number of routes within this matrix. |
| Number of successful routes within this matrix. |
| Number of failed routes within this matrix. |
| When there are any failed cells, this field contains the details about
the failure(s). |
failureDetails array | |
Field | Description |
| One of the defined error codes. |
| Number of failed routes within this matrix caused by errors having given |
Error response
1{2 "detailedError": {3 "code": string,4 "message": string,5 "details": [6 {7 "code": string,8 "message": string,9 "target": string,10 "details": [11 ...12 ],13 "innerError": {14 "code": string,15 "message": string,16 "innerError": {17 ...18 }19 }20 },21 ...22 ]23 }24}
1HTTP 404 NOT FOUND2{3 "detailedError": {4 "code": "MATRIX_NOT_FOUND",5 "message": "Matrix not found for provided id."6 }7}
Error response fields
Primary fields | |
---|---|
Field | Description |
| Detailed information about the error. |
detailedError object | |
Field | Description |
| One of the defined error codes. |
| A human-readable description of the error code. It is intended as an aid to developers and is not suitable for exposure to end users. |
| Optional. Target of the particular error. For example, a parameter name, a path to a JSON property, and others. Contents of this field may change over time. |
| Optional. |
| Optional. |
innerError object | |
Field | Description |
| One of the defined error codes. |
| Optional. A human-readable representation of the error code. It is intended as an aid to developers and is not suitable for exposure to end users. |
| Optional. A higher level of details about this error. |
Error code hierarchy
List of predefined, hierarchical, human-readable error codes.
- Top level codes relate to HTTP error codes.
- They may be refined by error codes in
details
orinnerError
. - Further levels of refinement are possible by nesting
innerError
insideinnerError
.
In the future, the list may be extended with additional codes. New or existing codes may be introduced as children of codes already present in the hierarchy. The application must be ready for the occurrence of an unknown error code (e.g., by stopping error processing at the last understood level of detail).
Each of the following error codes has a scope assigned. Scope assignment is subject to change and extension. Possible scopes are:
job
- the error code concerns the whole job.- It may be included in the optional
detailedError
structure.
- It may be included in the optional
cell
- the error code concerns failed processing of one of the matrix cells.- Codes in this scope may be included in the optional
failureDetails
array.
- Codes in this scope may be included in the optional
Error code | Description | Scope |
---|---|---|
MATRIX_NOT_FOUND | Top level code for requests which failed with an HTTP
|
|
NOT_FOUND | Top level code for requests which failed with an HTTP |
|
BAD_REQUEST | Top level code for requests which failed with an HTTP
|
|
INTERNAL_SERVER_ERROR | Top level code for requests which failed with an HTTP |
|
SERVICE_UNAVAILABLE | Top level code for requests which failed with an HTTP |
|
FORBIDDEN | Top level code for requests which failed with an HTTP |
|
| One of the request parameters did not pass validation.
The optional
|
|
OVER_TRANSACTION_LIMIT | Client has exceeded the transaction limit. |
|
MALFORMED_BODY | POST body is not properly formatted. |
|
ILLEGAL_PARAMETER | Unsupported request parameter was specified. |
|
MISSING_REQUIRED_PARAMETER | One of the required parameters was not provided. |
|
INVALID_PARAMETER_VALUE | The value of one of the parameters is invalid. |
|
UNKNOWN | Unknown error has occurred. |
|
MAP_MATCHING_FAILURE | One of the input points (origin, destination) could not be matched to the map because there is no known drivable section near this point. |
|
NO_ROUTE_FOUND | No valid route could be found for the given origin and destination pair. |
|
CELL_TIMEOUT | Failed to calculate route summary for the given origin and destination pair within timeout. |
|
OUT_OF_REGION | The distance between the given origin and destination pair is too long to calculate the route, considering other requested options. See the API Limitations table on the Asynchronous Matrix Submission page for more information. |
|