Samsara Telematics Integration with

In the following sections, we'll go over how to integrate Samsara Telematics with the Route Optimization API. Each step will be detailed to ensure a successful and efficient integration process, from obtaining API keys and setting up authentication to designing data pipelines and interpreting response data.


Before integrating Samsara Telematics and's Route Optimization API, make sure you have the following prerequisites in place:

Samsara API Token with Read/Write Permissions

Obtain a valid API token with both read and write scopes from your Samsara account. This token will be used to gain secure access to and retrieve data from your Samsara telematics system.

API Key from

Check that you have a valid API key from This key will be used to provide secure authentication when interacting with's services.

Samsara Asset Tracker

Ensure that the Samsara asset tracker is properly installed and configured on your drivers' vehicles. This device will transmit real-time telematics data that will be integrated with’s Route Optimization API.

By ensuring that these prerequisites are met, you will pave the way for a smooth and secure integration, allowing you to leverage the combined power of Samsara's telematics insights and's optimization capabilities for improved fleet management.

Connect and Import Data from Samsara

To effectively leverage the capabilities of both Samsara's telematics and's Route Optimization API, a seamless data integration process is required. You can unlock the power of advanced route optimization by pulling critical information from your Samsara account and orchestrating a smooth connection to the platform. This guide will walk you through the steps of pulling addresses, assets (vehicles), drivers, and addresses from Samsara and integrating them with’s Route Optimization API.

Login to Account

Begin by logging into your account. This is your central hub for managing and accessing your API keys. API key is required to authenticate the requests made by the user.

Integrating Samsara Telematics with

To integrate Samsara Telematics with your NCC dashboard, Contact support. We will help you navigate through the process.

Pull List of Addresses

Initiate a data pull from Samsara to extract a list of addresses where your deliveries or pickups are planned. These addresses are crucial for accurate route optimization.

API Request

1# Fetch addresses from Samsara Telematics Dashboard
2curl --request GET \
3 --url

API Response

2 "data": "[...]",
3 "pagination": "{...}"

Upon the successful retrieval of the address list, the frontend shall look like as the dashboard depicted below.


Fetch Asset (Vehicle) Information

Retrieve a list of your assets, which represent your vehicles. This information will be used to optimize routes based on vehicle capacity and other parameters.

1curl --request GET \
2 --url

The following image depicts the dashboard with vehicles data.


Obtain Driver Details

Extract the data regarding your drivers, including their availability, name and other details. This ensures that route assignments align with driver capabilities.

1curl --request GET \
2 --url

The drivers data will look like the following dashboard upon successfull retrieval.


The integrated dashboard will look something like this after successfully fetching all the necessary data.


Create Jobs with Route Optimization API

Using's Route Optimization API, create optimization jobs.

POST API Request

The following API request sends data to’s Route Optimization API to create optimization jobs based on certain parameters. The response confirms the creation of jobs.

2 "request": {
3 "url": "<your_api_key>",
4 "method": "POST",
5 "body": "{...}",
6 "headers": "{...}"
7 },
8 "response": "{...}"

Post API Response

2 "id": "2bda4ef824fa6c290e82b626ed85a8b3",
3 "message": "Optimization job created",
4 "status": "Ok"

Example JSON Response

2 "result": {
3 "code": 0,
4 "summary": "{...}",
6 "routes": "[...]"
7 },
8 "status": "Ok",
9 "message": ""

Integration with Route Optimization API

After successfully pulling the necessary data from Samsara, integrate the fetched data with Route Optimization using the following API endpoint.


Map the fetched Samsara data to the respective API parameters. Configure optimization settings such as shift start and end time, service time, and start and end location coordinates.

2 btnSendSamsara.setDisabled(true);
3 let locations = [];
4 let jobs = [];
5 let shipments = [];
6 vehicles = [];
7 veh_attr = [];
8 stop_attr = [];

Trigger Route Optimization API

After successfully fetching the data to Route optimization API, trigger the API to generate optimized routes.

The following API request sends data to the server to optimize routes for vehicles using the POST method.


The following code block prepares the required data (vehicles, shipments, jobs, locations) and configuration (routing mode), then triggers the optimization process.

Note: It is required to specify the routing mode. If not specified, the API will optimize the routes for default routing mode car. The API supports truck and car as routing modes.

1let options = {
2 routing: {
3 mode: 'car',
4 },
7localStorage.setValue('vehiclesNBAI', vehicles)
8localStorage.setValue('shipmentsNBAI', shipments)
9localStorage.setValue('jobsNBAI', jobs)
10localStorage.setValue('locationsNBAI', locations)
11localStorage.setValue('nbaiOptions', options)
12localStorage.setValue('nbaiVRPResult', null)

By following these steps, you establish a robust data pipeline between Samsara's telematics and's Route Optimization API. This integration empowers you to transform your vehicle fleet management with precise and efficient route planning, dynamically adapting to real-world conditions and driving operational excellence.