Sample request and response JSON payloads for the TollGuru Toll API and TollTally endpoints.
- Project Description
- Repository Structure
- Endpoints
- Usage
- Contributing
- License
- Contact
- Additional Resources
This repository provides sample JSON request bodies and response payloads for the TollGuru Toll API. Use these examples as a reference when building integrations — each file demonstrates a specific parameter combination or feature of the API.
The examples cover three API endpoints across the TollGuru and TollTally product suite:
- Toll calculation via origin, destination, and waypoints (TollGuru)
- Toll calculation via complete polyline (TollTally)
- Toll calculation via GPS track CSV upload (TollTally)
For API authentication and full endpoint documentation, visit the TollGuru API Documentation.
.
├── request-bodies/ # Sample JSON request payloads, organized by endpoint
│ ├── 01-Origin-Destination-Cost-Tradeoff/
│ ├── 02-Complete-Polyline-To-Toll/
│ └── 03-TollTally-GPS-Tracks-To-Toll/
└── responses/ # Corresponding sample JSON responses
├── 01-Origin-Destination-Cost-Tradeoff/
├── 02-Complete-Polyline-To-Toll/
└── 03-TollTally-GPS-Tracks-To-Toll/
Endpoint: /origin-destination-waypoints
Calculates toll costs, route details, and fuel expenses by specifying an origin, destination, and optional waypoints.
Endpoint: /complete-polyline-from-mapping-service
Calculates toll costs and route details by providing a route's complete polyline as an encoded string or as decoded coordinates.
Endpoint: /gps-tracks-csv-upload
Calculates toll costs and route details from GPS points uploaded as a CSV file. Supports both synchronous (small files) and asynchronous (large files) uploads.
Clone the repository and use the JSON files directly as request bodies in your API calls.
git clone https://github.com/mapup/tollguru-api-parameter-examples.git
cd tollguru-api-parameter-examplescurl -X POST <TOLLGURU_API_BASE_URL>/origin-destination-waypoints \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d @request-bodies/01-Origin-Destination-Cost-Tradeoff/01-address-as-string.jsonThe request body used (01-address-as-string.json):
{
"from": {
"address": "Walt Whitman Brg Philadelphia, PA 19148, USA"
},
"to": {
"address": "Ocean City, NJ 08226 USA"
},
"vehicle": {
"type": "2AxlesAuto"
}
}Replace YOUR_API_KEY with your actual TollGuru API key and TOLLGURU_API_BASE_URL with the base URL from the API documentation.
For the /gps-tracks-csv-upload endpoint, parameters are sent as query parameters alongside the CSV file upload. Utility scripts are provided to help generate cURL commands from the sample JSON parameter files:
python request-bodies/03-TollTally-GPS-Tracks-To-Toll/scripts/convert_json_params_to_curl.py \
01-sync-upload-for-small-files.json out.txtWe welcome contributions to this repository! If you have suggestions or improvements, please open an issue or submit a pull request.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
For any questions or support, please reach out to api-support@tollguru.com.
For full API documentation, refer to: