WS306 - Finish route
Our Route Completion service
This integration aims to open a request to close a route in Comprovai.
Authentication
- Calls will have transport-level authentication (Basic Authentication);
- Request
user/passwordfrom the account administrator.
Features
-
URL
<https://entregas-api.comprovei.com/v1/routes/finish> -
Method:
PATCH
This integration returns a protocol for monitoring - WS301
Request Example
{
"routes" : [{
"occurrence_date" : "String",
"route_number" : "String",
"route_date" : "String",
"driver" : "String",
"latitude": 0,
"longitude" : 0,
"device_model" : "String",
"device_id" : "String"
}]
}
Our JSON
- Routes parameter:
| Parameter | Type | Required | Description |
|---|---|---|---|
routes |
JSON array | Yes | Set of JSON. It must have at least one (1) JSON object with the fields from the Routes table. |
Routes
| Parameter | Type | Required | Description |
|---|---|---|---|
occurrence_date |
string | Yes | Route start date ('YYYY-MM-DD HH:mm:ss'). |
route_number |
string | Yes | Number given to the route in Comprovai. |
route_date |
string | Yes | Route date in Comprovei ('YYYY-MM-DD'). |
driver |
string | Yes | Driver Code*. |
latitude |
number | No | Latitude of the coordinate where the route was completed. |
longitude |
number | No | Longitude of the coordinate where the route was completed. |
device_model |
string | No | Model of the device used by the driver during the route. |
device_id |
string | No | Device ID used by the driver during the route. |
*
Same code sent when creating the route.
Response Example
-
Success:
-
Code: 202 Content:
{ "message" : "OK", "protocol" : "<protocol>" } -
Error:
-
Code: 400 Content:
{ "message" : "Foram encontrados erros em todas as rotas enviadas", "errors" : { "route_number" : <route_number>, "route_date" : <route_date>, "driver" : <driver>, "statusCode" : 4xx, "message" : <message> } } -
Code: 400 Content:
{ "message" : "Corpo da requisição está vazio" } -
Code: 400 Content:
{ "message" : "Campo route_number é obrigatório" } -
Code: 400 Content:
{ "message" : "Campo driver é obrigatório" } -
Code: 400 Content:
{ "message" : "Campo end_date é obrigatório" } -
Code: 400 Content:
{ "message" : "<Data> não é uma data válida" } -
Code: 400 Content:
{ "message" : "Latitude deve ser do tipo númerico" } -
Code: 400 Content:
{ "message" : "Longitude deve ser do tipo númerico" } -
Code: 401 Content:
"Unauthorized"