Skip to main content
POST
/
cube
/
sync
Create cube (sync)
curl --request POST \
  --url https://routing.solvice.io/cube/sync \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "coordinates": [
    [
      123
    ]
  ],
  "sources": [
    123
  ],
  "destinations": [
    123
  ],
  "vehicleType": "CAR",
  "date": "2022-03-10T00:00:00.000Z",
  "responseType": "<string>"
}
'
{
  "tableId": 123,
  "durations": [
    [
      123
    ]
  ],
  "distances": [
    [
      123
    ]
  ],
  "sources": [
    {
      "hint": "<string>",
      "distance": 123,
      "name": "<string>",
      "location": [
        123
      ]
    }
  ],
  "destinations": [
    {
      "hint": "<string>",
      "distance": 123,
      "name": "<string>",
      "location": [
        123
      ]
    }
  ],
  "durationSlices": [
    [
      [
        123
      ]
    ]
  ],
  "coefficients": [
    [
      [
        123
      ]
    ]
  ],
  "slices": [
    {
      "sliceNumber": 123,
      "startHour": 123,
      "endHour": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

API key authentication. Include your API key in the Authorization header.

Body

application/json

Cube Dto

coordinates
number<double>[][] | null
required

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

Minimum array length: 2
sources
integer<int32>[] | null

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

destinations
integer<int32>[] | 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.

Example:

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

responseType
string | null

Specifies the type of response to return. Currently only 'matrix' is supported (returns travel time matrices for each time slice).

Response

Get cube response directly.

Cube Response

tableId
integer<int64>

Table response id. Not to be confused with table request id.

durations
number<double>[][] | null

Time distance matrix. In order of sources to destinations indexes in request.

distances
number<double>[][] | null

Distance matrix. In order of sources to destinations indexes in request.

sources
object[] | null

Actual sources snapped to map.

destinations
object[] | null

Actual destinations snapped to map.

durationSlices
number<double>[][][] | null

Time distance matrix. In order of sources to destinations indexes in request.

coefficients
number<double>[][][] | null

Travel Time cube. In order of sources to destinations indexes in request. Inner array is list of 6 coefficients.

slices
object[] | null

Time slice information indicating which time periods each slice represents.