Adding depots
Before getting started, the company should set up a list of depots that deliveries are made from. The depot marks the starting location for a route.
Note.
Use your company ID to access the Track & Trace API. If you don't have an ID, contact us.
- Routing workspace
-
- Open the routing workspace.
- In the menu on the left, go to.
- Click Create a depot.
- Enter the depot's information and click Create.
- API
-
Send a request to the depots-batch resource. The request must contain information about the depots.
To send API requests via Postman, you can use the RouteQ API collection.
Attention. The specification contains required fields for existing objects, but there are more fields for new objects. When you add new objects by sending a request to thedepots-batch
resource, fill in all of the fields that are required for the depots resource.Request
cURL
curl -H "Content-Type: application/json" -H "Authorization: Auth your-token" -X POST -d @<File_path_in_UTF-8_encoding> https://courier.yandex.ru/api/v1/companies/<your-company-id>/depots-batch
Copied to clipboardFile
[ { "number":"111", "name":"Depot 1", "address":"476 5th Avenue", "lat": 73.9823, "lon": 40.7532, "time_interval":"10-22" }, { "number":"112", "name":"Depot 2", "address":"477 5th Avenue", "lat": 73.9824, "lon": 40.7533, "time_interval":"11:00 - 23:00" } ]
Copied to clipboardcURL
curl -H "Content-Type: application/json" -H "Authorization: Auth your-OAuth-token" -X POST -d '[{"number":"111", "name":"Depot 1", "address":"476 5th Avenue", "lat": 73.9823, "lon": 40.7532, "time_interval":"10-22"}, {"number":"112", "name":"Depot 2", "address":"477 5th Avenue", "lat": 73.9824, "lon": 40.7533, "time_interval":"11:00 - 23:00"}]' https://courier.yandex.ru/api/v1/companies/<your-company-id>/depots-batch
Copied to clipboardResult:
{ "inserted": 2, "updated": 0 }