Gets VRP task routes import request status

Gets VRP task routes import request status. VRP task import is asynchronously, as it can take a long time. In case of request status is success, result will be provided in response.

Request

GET

https://courier.yandex.ru/api/v2/companies/{company_id}/routes:vrp-task-import/{id}

Path parameters

Name

Description

company_id*

Type: string

The ID of the company.

id*

Type: string

The ID of VRP task routes import request.

Responses

200 OK

VRP task routes import request status.

Body

application/json
{
    "id": "string",
    "status": "IN_PROGRESS",
    "create_time": 0,
    "update_time": 0,
    "error": {
        "message": "string"
    },
    "result": {
        "routes": [
            {
                "custom_fields": [
                    {
                        "key": "string",
                        "value": "string"
                    }
                ],
                "date": "string",
                "id": 0,
                "imei": 0,
                "rented_courier_id": "string",
                "imei_str": "string",
                "number": "string",
                "route_start": "string",
                "route_finish": "string",
                "routing_mode": "string",
                "tracking_start_h": 0,
                "courier_violated_route": false,
                "company_id": 0,
                "courier_id": 0,
                "depot_id": 0
            }
        ]
    }
}

Name

Description

create_time*

Type: number

UNIX timestamp of request creation.

id*

Type: string

The ID of asynchronous request.

status*

Type: RouteImportStatus

Status of request processing. ERROR: request processing error. Error description is presented in response. IN_PROGRESS: request is being processed. SUCCESS: request processing is completed. Result routes are presented in response.

Enum: IN_PROGRESS, SUCCESS, ERROR

update_time*

Type: number

UNIX timestamp of request status update.

error

Type: RoutesImportResponse_error

Present in ERROR status.

result

Type: RoutesImportResponse_result

Present in SUCCESS status.

RouteImportStatus

Status of request processing. ERROR: request processing error. Error description is presented in response. IN_PROGRESS: request is being processed. SUCCESS: request processing is completed. Result routes are presented in response.

Type

Description

RouteImportStatus

Enum: IN_PROGRESS, SUCCESS, ERROR

RoutesImportResponse_error

Present in ERROR status.

Name

Description

message*

Type: string

Human readable error description.

RoutesImportResponse_result

Present in SUCCESS status.

Name

Description

routes*

Type: Route[]

Imported routes.

Route

Name

Description

company_id

Type: integer<int64>

Company ID used in requests to the Track & Trace API.

courier_id

Type: integer<int64>

ID of the courier who delivers items on the route.

courier_violated_route

Type: boolean

Indicates if a courier visits orders' locations in the order that is different from the predefined order sequence.

custom_fields

Type: CustomField[]

List of route custom fields. Max number of custom fields is 10.

Min items: 0

Max items: 10

date

Type: string<date>

The date of the route in YYYY-MM-DD format. Cannot be changed if there are orders on route.

depot_id

Type: integer<int64>

ID of the depot where the route starts.

id

Type: integer

Route ID used in requests to the Track & Trace API.

imei

Type: integer

The number of the GPS tracker installed on the vehicle on the route.

imei_str

Type: string

String representation of numeric number of a GPS tracker. Should be used in case integer overflow of numeric number of a GPS tracker value in the programming language used. If defined in request, this takes precedence over the value of integer number of a GPS tracker field.

number

Type: string

Route number. Used for syncing with the delivery company's system.

rented_courier_id

Type: string

Rented courier ID used in requests to the Track & Trace API.

route_finish

Type: string

Route finish time relative to the date value, in the [d.]HH:MM:SS format. If specified, positions sent by GPS trackers and the app will be recorded only before the specified time.

route_start

Type: string

Route start time relative to the date value, in the [d.]HH:MM:SS format. If specified:

  • Positions sent by GPS trackers and the app will be recorded only after route_start - tracking_start_h.
  • Order history START event will be added to order history only after the specified time.
  • Order status change SMS notification messages, if enabled, will be sent to clients only after the specified time.

routing_mode

Type: string

Transportation method. Possible values:

  • driving - courier drives a car.
  • truck - courier drives a truck.
  • transit - courier uses public transport and walks.
  • walking - courier walks.

tracking_start_h

Type: integer<int32>

Route tracking will start tracking_start_h hours before route start. If route.route_start is specified, positions sent by GPS trackers and the app will be recorded only after route.route_start - route.tracking_start_h if route.tracking_start_h is specified, otherwise after route.route_start - company.tracking_start_h.

Min value: 0

Max value: 24

CustomField

Name

Description

key

Type: string

Key of custom field. Must correspond to one of route custom fields in company settings.

Max length: 255

value

Type: string

Value of custom field.

Max length: 255

401 Unauthorized

Authorization failed. Send the correct OAuth token in the authorization header.

403 Forbidden

You do not have access to this object.

422 Unprocessable Entity

Request with this id not found.

Body

application/json
{
    "message": "string",
    "incident_id": "string"
}

Name

Description

incident_id*

Type: string

Unique identifier of error incident. In case of API error, this identifier can be provided to support for investigation.

message*

Type: string

Human-readable error description.

504 Gateway Timeout

Server error during request processing.