Skip to main content

POST /truck/6.0.1/global

OpenAPI Specification

2GIS Navigation API (6.0.0)

Route by truck

Building a route for a truck

Truck Directions API allows you to build a truck route.

query Parameters
key
required
string

Developer API key

Request Body schema: */*
required

Request parameters

required
Array of objects (RequestPoint)
integer or null <long>

Date and time to use instead of the current date and time. Specified as Unix time.

integer or null
Default: 1

Number of alternative routes to be built in addition to the main route

Locale (string) or null
string or null

Start point name

string or null

End point name

TruckRequestType (string) or null
Array of RequestOption (strings) or RequestOption (string) or null
Array of RequestFilter (strings) or RequestFilter (string) or null
boolean or null

If true, the route may include driving on closed roads.

OutputType (string) or null
Array of objects (ExcludeObject)

An array of areas to avoid when building a route. Not more than 25 areas.

boolean or null

If true, an indoor route will be included in the result (for pedestrian routes).

boolean or null

If true, altitude information will be included in the response.

Array of HardFilter (strings) or HardFilter (string) or null
number or null

Average speed limit, km/h

boolean or null

Enrich the answer with information about edges coloring.

TruckParams (object) or null
Array of integers or null

Identifier of a pass for a zone (array of numbers).

Responses

Response Schema: application/json
type
required
string (ResponseType)
Enum: "result" "error"

Response type:

  • result - Success result,
  • error - Error,

required
object (DirectionsTruckRequestModel)

Truck DirectionsAPI query.

string or null

Error message

status
required
string (StatusType)
Enum: "OK" "FAIL" "POINT_EXCLUDED" "ROUTE_NOT_FOUND" "ROUTE_DOES_NOT_EXISTS" "ATTRACT_FAIL"

Request status:

  • OK - route was successfully calculated,
  • FAIL - an unknown error occurred when calculating the route,
  • POINT_EXCLUDED - one of the points was excluded by the excluded objects,
  • ROUTE_NOT_FOUND - the route could not be build on the current data of the road graph,
  • ROUTE_DOES_NOT_EXISTS - the route between points on the road graph doesn't exist,
  • ATTRACT_FAIL - an error occurred while attracting the points: one of the points is more than 10 km away from the road graph,

required
Array of objects (TruckResultItem)

Response samples

Content type
application/json
{
  • "type": "result",
  • "query": {
    • "alternative": 0,
    • "exclude": [
      ],
    • "locale": "ru",
    • "need_altitudes": true,
    • "point_a_name": "Source",
    • "point_b_name": "Target",
    • "points": [
      ],
    • "type": "jam"
    },
  • "message": "string",
  • "status": "OK",
  • "result": [
    • {
      }
    ]
}