Trip

List of parameters

Mandatory parameters

  • points – Array of objects, where each object represents a stop on the route with the following fields:
    • siteId – Stop point identifier.
    • latitude – Latitude coordinate in decimal degrees.
    • longitude – Longitude coordinate in decimal degrees.

Example:

{
"points": [
        {
            "siteId": "Point 1-Extrema",
            "latitude": -22.859246,
            "longitude": -46.339289
        },
        {
            "siteId": "Point 2-Betim",
            "latitude": -19.985117,
            "longitude": -44.202667
        }
    ]
}

Optional parameters

  • calculationMode – Indicates the calculation mode for routing. Supports types:
    • THE_FASTEST – Consider it the fastest way. Default value.
    • THE_SHORTEST – Consider the route with the lowest mileage.
  • avoidanceTypes – Indicates that the route will have to deviate from certain types of road system elements. Allowed values are:
    • TUNNELS – The route will bypass tunnels;
    • BRIDGES – The route will bypass bridges;
    • FERRIES – The route will bypass ferries.
  • avoidanceBehavior – Indicates what the route planner’s behavior should be if the route has road elements that must be avoided declared in avoidanceTypes. Allowed values are:
    • FAIL – Default API behavior if the parameter is not provided. If it is not possible to complete a route without passing through an element to be avoided, an error message will be returned. For example, an error message will be returned when using "avoidanceTypes":["FERRIES"] on a route where one of the points can only be reached by ferry;
    • STRONG – The elements will be avoided, but if it is not possible to complete the route without passing through any of the elements, the route will still be returned. For example, a route where one of the points can only be accessed by ferry will be returned even using "avoidanceTypes":["FERRIES"] ;
    • RELAXED – Road elements will not be completely avoided, but the route with the least amount of these elements will be prioritized.
  • toll – Indicates that the route must report the toll calculation. The following parameters must be entered:
    • vehicleType – Text defining the type of vehicle to be considered when calculating the toll. The possible values are:
      • MOTORCYCLE
      • CAR
      • CAR_WITH_THREE_SIMPLE_AXLES
      • CAR_WITH_FOUR_SIMPLE_AXLES
      • BUS_WITH_TWO_DOUBLE_AXLES
      • BUS_WITH_THREE_DOUBLE_AXLES
      • BUS_WITH_FOUR_DOUBLE_AXLES
      • BUS_WITH_FIVE_DOUBLE_AXLES
      • TRUCK_WITH_NINE_DOUBLE_AXLES
      • TRUCK_WITH_TWO_SINGLE_AXIS
      • TRUCK_WITH_TWO_DOUBLE_AXLES
      • TRUCK_WITH_THREE_DOUBLE_AXLES
      • TRUCK_WITH_FOUR_DOUBLE_AXLES
      • TRUCK_WITH_FIVE_DOUBLE_AXLES
      • TRUCK_WITH_SIX_DOUBLE_AXLES
      • TRUCK_WITH_SEVEN_DOUBLE_AXLES
      • TRUCK_WITH_EIGHT_DOUBLE_AXLES
      • TRUCK_WITH_TEN_DOUBLE_AXLES
  • crossedBorders – Only for routes in Brazil. Indicates that some information about the route should also be returned:
    • level – It will return the cities or states that the route crosses. Possible values:
      • CITY – Return to the cities crossed by the route.
      • STATE – Returns the states crossed by the route.
      • NONE – The parameter will not be used.
    • reverseGeocode – The Reverse Geocode API will be used to return more information about important points on the route. Possible values:
      • START_END – The fields startAddress and endAddress will be returned with information on the first and last points on the route.
      • START_END_LEGS – The field firstPointAddress will be returned within each leg (section of the route), with information on the starting point of the leg in question.
  • callback – Only available in Asynchronous Trip. It contains the callback data, which is a webhook URL for receiving the problem’s calculation events. The possible arguments are:
    • url – URL with the address that will receive the callback.
    • user – Text with the user name if the webhook requires authentication.
    • password – Password text in case the endpoint needs authentication.
  • restrictionZones – Array with the text of the name of the restriction area previously registered in the Restriction Zone API
  • place – Used to return points of interest (POIs) on the route. The following parameters must be entered:
    • bufferRouteInMeters – Integer with the search radius of points of interest along the route. Limit of 500 meters.
    • bufferStoppingPointsInMeters – Integer with the search radius for points of interest at the stops. Limit of 500 meters.
    • onlyMyPlaces – Boolean value that indicates whether only establishments from your own base will be returned or whether the service’s native base should also be used. To find out more, consult the POIs API documentation.
    • categories – Array with the categories of the desired establishments.
    • subCategories – (Optional) Array with the subcategories of the desired establishments.

Below is an example with all the optional parameters:

{
     "calculationMode": "THE_FASTEST",
     "points": [
        {
            "siteId": "Point 1-Extrema",
            "latitude": -22.859246,
            "longitude": -46.339289
        },
        {
            "siteId": "Point 2-Betim",
            "latitude": -19.985117,
            "longitude": -44.202667
        }
    ],
    "avoidanceTypes":["FERRIES"], 
    "avoidanceBehavior": "STRONG",   
    "toll": {
        "vehicleType": "CAR"
    },
    "place": {
        "categories": [
            "ALIMENTOS_E_BEBIDAS",
            "ACADEMIAS"
        ],
        "bufferRouteInMeters": 500,
        "bufferStoppingPointsInMeters": 500,
        "onlyMyPlaces": true,
    },
    "crossedBorders": {
        "level": "CITY",
        "reverseGeocode": "START_END_LEGS"
    },
    "restrictionZones": [
        "MG_BR381_530_km_AltCentl_5_75",
        "MG_BR381_620_km_AltCentl_5_61"
    ],
 }