TollGuru Logo

Toll API FAQs

Last updated on May 12, 2023

Tolls using GPS tracks

How to receive tolls for GPS tracks in csv format?

curl --location 'https://apis.tollguru.com/toll/v2/gps-tracks-csv-upload' \
--header 'x-api-key: xxxxxx\
--header 'Content-Type: text/csv' \
--data '@/path_to_file_.csv'

How to receive tolls for GPS tracks covering a very long route?

Make a request with the “isAsync” flag set to “true” in the parameters.

This request will return a response containing a request ID and a requested timestamp. The request ID uniquely identifies your request in the API’s system and can be used to retrieve the response later.

curl --location 'https://apis.tollguru.com/toll/v2/gps-tracks-csv-upload?isAsync=true' \
--header 'x-api-key: xxxxxx \
--header 'Content-Type: text/csv' \
--data '@/path_to_file_.csv'

Wait for some time, and then send the request ID and requested timestamp as the request body to the download endpoint. This will trigger the API to retrieve the response to your initial request and send it back to you for download.

curl --location 'https://apis.tollguru.com/toll/v2/gps-tracks-csv-download' \
--header 'x-api-key: xxxxxxxxx \
--header 'Content-Type: application/json' \
--data '{
"status": "OK",
"requestId": "9da544ae-5178-4ff9-a0c3-359bc4d76204",
"requestedTimestamp": "2023-05-11T10:31:34.514Z"
}'

How to add and customize a vehicle?

Vehicle object should be constructed in the same way as that for other requests. But it should be set in params of the request body

Also note: the object must be in URI encoded format prior to sending a request. It is possible to encode it Online Web Toolkit - URL Encode/Decode

For North America

    {
        "type": "4AxlesTruck",
        "height": {
            "value": 10,
            "unit": "feet"
        },
        "weight": {
            "value": 20000,
            "unit": "pound"
        }
    }

For Europe

    {
        "type": "4AxlesTruck",
        "weight": {
            "value": 18,
            "unit": "ton"
        },
        "height": {
            "value": 20,
            "unit": "meter"
        },
        "axles": 4,
        "emissionClass": "euro_6"
     }

Curl for the same:

curl --location --request POST 'https://apis.tollguru.com/toll/v2/gps-tracks-csv-upload?isAsync=true&vehicle=ENCODED_URI_OBJECT' \
--header 'x-api-key: xxxxxxx \
--header 'Content-Type: text/plain' \
--data '@/path_to_file_.csv'