API request
Preparing source data
Prepare source data in JSON format, taking into account its features and restrictions.
Use the parameters described in the Parameter list section. Make sure that the required parameters are included in the request: to learn which parameters are mandatory, see the list.
Object/array | Description | Required |
---|---|---|
locations |
Location parameters | Yes |
employees |
Employees and vehicles | Yes |
options |
Global options | Yes |
zones |
Geofences | No |
JSON structure
{
"locations": [
// Describes locations.
],
"employees": [
// Describes mobile employees.
],
"options": {
// Describes planning options.
},
"zones": [
// Describes geofences (optional object).
]
}
API request
Below is a sample request for the cURL command-line utility.
curl -X POST "https://courier.yandex.com/vrs/api/v1/calendar_planning/tasks?apikey=<my-api-key>" -d @task.json
where my-api-key
is the API key. The signature must be passed in the X-YaCourier-Signature
request header.
The response should be:
202 Accepted
{
"id": "task_id",
"status": "queued",
"message": "Task queued"
}
Request parameters
Parameter name | Type | Description |
---|---|---|
apikey |
string | API access key |
lang |
string | Request language |
Response parameters
Parameter name | Type | Description |
---|---|---|
id |
string | Unique task ID |
status |
object | Object containing the task status history |
message |
string | Text message about the task status |
Response codes
Code | Description |
---|---|
202 |
The request is being processed |
400 |
The API key doesn't match the key specified in the task |
401 |
Missing API key |
402 |
The API key is blocked |
422 |
Invalid request body structure |
429 |
Too many requests |
500 |
Server error during request processing |
Analyzing the resulting solution
Typical errors returned by the API request are described in the Error handling section.
Was the article helpful?
Previous