Skip to content

WS302 - Start route

Our Start of Route service

This integration aims to open the request to start a route in Comprovai.

Authentication

  • Calls will have transport-level authentication (Basic Authentication);
  • Request user / password from the account administrator.

Features

  • URL

    <https://entregas-api.comprovei.com/v1/routes/start>

  • Method:

PATCH

This integration returns a protocol for monitoring - WS301

Warning

All optional fields will be validated if sent, that is, they cannot be blank, if you do not wish to send the information, do not add the fields.

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 Mandatory 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" : "Todas as requisições apresentaram erros" 
          "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"`</br>
      }
    

  • 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"