Building requests for the Toll for Maps API
Before you can start using the API, you will need to obtain the authentication token.
The following headers will be required, where the word token must be replaced by the token obtained in the authentication process:
--header 'Content-Type: application/json' \ --header 'Authorization: Bearer token'
To use Toll for Maps, you need to send the request to the following endpoint, using the POST :
https://api.maplink.global/toll/v1/directions?vehicleType=TRUCK_WITH_TWO_DOUBLE_AXLES
In the body you must send the route processed by Google’s Directions API, that is, the response from the Directions API.
The Toll for Maps API has a single parameter that must be entered in the URL itself(query param):
vehicleType
– Type of vehicle you wish to obtain the toll value for. The default value if not entered isCAR
. Possible values are:CAR
MOTORCYCLE
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_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_NINE_DOUBLE_AXLES
TRUCK_WITH_TEN_DOUBLE_AXLES
Note: Only replies from Directions containing"travel_mode": "DRIVING"
will be processed."travel_mode": "transit|walking|bicycling"
types are not supported for toll processing.