POST
/
cube
Create
curl --request POST \
  --url https://routing.solvice.io/cube \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "coordinates": [
    [
      4.9,
      50.2
    ],
    [
      4.8,
      50.4
    ],
    [
      5,
      50.9
    ],
    [
      5.05,
      50.9
    ]
  ],
  "sources": [
    0,
    1,
    2,
    3
  ],
  "destinations": [
    0,
    1,
    2,
    3
  ]
}'
{
  "id": 123,
  "status": "IN_PROGRESS",
  "errorMessage": "<string>",
  "responseType": "<string>",
  "hash": 123,
  "cubeResponseId": 123,
  "updatedAt": "<string>",
  "createdAt": "<string>"
}
Request a distance matrix with the asynchronous /cube endpoint. In the result you can find the table response id to fetch in /cube/{response_id}. For very large matrices (eg 2000x2000 and more), the /cube/{request_id}/progress endpoint can provide more information.

Authorizations

Authorization
string
header
required

Api Key based authentication (apikey)

Body

application/json

Cube Dto

coordinates
number[][] | null
required

The coordinates this request will use, coordinates as [{lon},{lat}] values, in decimal degrees.

Minimum length: 2
sources
integer[] | null

An array of index elements (0 <= integer < #coordinates) to use location with given index as source. Default is to use all.

destinations
integer[] | null

An array of index elements (0 <= integer < #coordinates) to use location with given index as destination. Default is to use all.

vehicleType
enum<string> | null

The vehicle type for which the table is requested

Available options:
CAR,
BIKE,
TRUCK,
ELECTRIC_CAR,
ELECTRIC_BIKE
date
string<date> | null

The date for which you want to calculate the cube. This will take into account predictive travel time based on TomTom data. Format YYYY-MM-DD. Default is current date.

Examples:

"2022-03-10T00:00:00.000Z"

responseType
string | null

Specifies the type of response to return. Can be 'coefficients' (return polynomial coefficients, default) or 'matrix' (return travel time matrices).

Response

OK

id
integer

Cube id.

status
enum<string> | null

Cube status (IN_PROGRESS, SUCCEEDED, FAILED).

Available options:
IN_PROGRESS,
AGGREGATING,
SUCCEEDED,
FAILED
errorMessage
string | null

Error message if the Cube failed.

responseType
string | null

Type of the Cube response, e.g., 'coefficients'.

hash
integer | null

Hash of the Cube request

cubeResponseId
integer

Cube response id.

updatedAt
string | null

Last update time of the Cube.

createdAt
string | null

Creation time of the Cube.