For drivers not using the Yojee Driver App, reporting of task failure can be done via Yojee API
Use this endpoint to report a task as a Dispatcher.
- POST api/v3/dispatcher/task_groups/{task_group_id}/task/{id}/mark_as_failed
- API reference link: https://api-docs.yojee.com/#dispatcher-taskcontroller-mark_as_failed
Request Parameters
Parameter |
Required? |
Type |
Description |
access_token |
Yes |
String |
Access token |
company_slug |
Yes |
String |
Dispatcher company slug |
task_group_id |
Yes |
Integer |
Task Group Id |
id |
Yes |
Integer |
Task id |
descriptions |
Yes |
Body |
Task exception descriptions |
Request Sample cURL/Payload
curl -X POST "https://umbrella-dev.yojee.com/api/v3/dispatcher/task_groups/14095/task/24451/mark_as_failed" -H "accept: application/json" -H "ACCESS_TOKEN: pCVPeEEUuKnM7geUOcSLY2imA5l6YUdjymkApBDAAGY=" -H "COMPANY_SLUG: yojee" -H "content-type: application/json" -d "{\"descriptions\": [\"Wrong address\"]}"
Sample Response Body
Server Code Status: 200 => Task marked as failed by the Dispatcher
example value(s)
{
"data": {
"completion_time": "2019-06-20T01:45:45.342247Z",
"id": 24451,
"start_time": null,
"state": "failed",
"task_group_id": 14095
}
}