Waybill
This API is used to retrieve information about agents’ waybills (tasks) for a specified period.
With it, you can:
— get a list of tasks assigned to each agent
— view planned and actual execution times
— check task statuses and details for route points
How to get data
Method
GET
Request address
To get the data, use the address: https://tasks.<server_address>/backend/public/get_waybill_for_pilot
Request parameters
-
from_ts— start time of the selection period (Unix timestamp, e.g., 1536181200)
-
to_ts— end time of the selection period (Unix timestamp, e.g., 1538773200)
-
agents— list of agent IDs separated by commas (e.g., 13128,13130,21055)
Example request
https://tasks.<server_address>/backend/public/get_waybill_for_pilot?from_ts=1536181200&to_ts=1538773200&agents=13128,13130,21055
|
Response
{
"success": true,
"msg": "",
"items": [
{
"agent_id": 13128,
"c_begin_time": "1536200000",
"c_end_time": "1536210000",
"c_information": "{\"route\":\"Route №54\",\"driver\":\"Ivanov I.I.\"}",
"c_initiator": "Dispatcher",
"c_progress_time": "1536200500",
"c_running_time": "1536200300",
"c_status_id": 2,
"c_status_name": "Completed",
"id": 98765,
"points_info": [
{
"point_id": 1,
"lat": "55.7558",
"lon": "37.6173",
"visited_at": "1536200600"
}
]
}
]
}
|
In response to the API request, the following is returned:
-
success — execution result (true = success, false = error)
-
msg — error message (if any)
-
items — array of task data
For each task:
-
agent_id — agent identifier
-
c_begin_time — planned task start time
-
c_end_time — actual task end time
-
c_information — string with additional task info (JSON, depends on the template)
-
c_initiator — initiator (who created the task)
-
c_progress_time — actual time of the first point visit
-
c_running_time — actual time of departure to start the task
-
c_status_id — task status ID
-
c_status_name — task status description
-
id — task identifier in the PTM system
-
points_info — array with details of visited route points:
-
point_id — route point ID
-
lat — latitude of the point
-
lon — longitude of the point
-
visited_at — timestamp when the point was visited