Samsara Telematics Integration with NextBillion.ai
In the following sections, we'll go over how to integrate Samsara Telematics with the NextBillion.ai 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.
Prerequisites
Before integrating Samsara Telematics and NextBillion.ai'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 NextBillion.ai
Check that you have a valid API key from NextBillion.ai. This key will be used to provide secure authentication when interacting with NextBillion.ai'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 NextBillion.ai’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 NextBillion.ai's optimization capabilities for improved fleet management.
Connect and Import Data from Samsara
To effectively leverage the capabilities of both Samsara's telematics and NextBillion.ai'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 NextBillion.ai platform. This guide will walk you through the steps of pulling addresses, assets (vehicles), drivers, and addresses from Samsara and integrating them with Nextbillion.ai’s Route Optimization API.
Login to NextBillion.ai Account
Begin by logging into your NextBillion.ai 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 NextBillion.ai
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.
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.
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.
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 NextBillion.ai's Route Optimization API, create optimization jobs.
POST API Request
The following API request sends data to NextBillion.ai’s Route Optimization API to create optimization jobs based on certain parameters. The response confirms the creation of jobs.
Post API Response
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.
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 NextBillion.ai 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.
By following these steps, you establish a robust data pipeline between Samsara's telematics and NextBillion.ai'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.