Overview
The integration with the Samsara API provides direct integration to drivers and the assets they are driving through an ELD device and a phone application. Revenova’s Fleet Management Module requires the use of Samsara ELD tracking.
Samsara provides “push” status updates to the TMS via a sites-based web service. Inbound packets from Samsara are stored in the Queued Transaction table and processed by the QueuedTransactionJob.
Setup
Enter Credentials
Enable the Samsara integration by completing the following steps.
Navigate to TMS Admin.
Select Credentials.
Select the Global Services tab.
Find Samsara in the list and open the card.
Check the Enabled box.
Enter the User ID and Password 1 into the text fields.
Set the Service URL to: https://api.samsara.com.
Set the Test Service URL to: https://api.samsara.com.
Click the Save button when finished.
User ID | Password 1 | Password 2 | Customer Number |
---|---|---|---|
"Revenova" | Required API Key |
Remote Site Settings
Upgrading from previous versions of the TMS may have outdated information. Check that the Remote Site Settings for the Samsara integration URL are up to date.
Click the Setup gear icon in the top right corner.
From the drop-down, click Setup.
In the Quick Find Toolbar type Remote Site Settings and click the link.
From the list of remote sites find Samsara and click the Edit link.
Partner Community Setup
The Samsara integration requires a webhook to send information into the TMS. Create an API Site to accept inbound traffic.
Create a Salesforce Site for API Guest User Access.
Set the public access for the Site.
Activate and Publish the Site.
Enter the API URL into the field for Inbound API Community URL under TMS Admin, in the Configuration section.
Add the following extension to the end of the URL to match the example below: /services/apexrest/rtms/tmslistener?org=[18-character org id]&source=Samsara&pwd=[credentials code field]
Contact Samsara support and provided them this "Post-back" URL to point at your listener.
{API Community URL}/services/apexrest/rtms/tmslistener?org=[18-character org id]&source=Samsara&pwd=[credentials code field]
Example: https://revenova.my.site.com/api/services/apexrest/rtms/tmslistener?org=00D180000008oA9EAI&source=Samsara&pwd=4wGFDgnT950Ovg1
The Samsara integration supports multiple stops for the same Account location.
The bi-directional integration is accomplished with three TMS processes.
The Fleet Management Job invokes API calls on the Samsara API.
Samsara pushes event packets to the application via the TMS Listener and Samsara Event Processor.
The Load LWC widget can send text messages to the driver via the Samsara phone application.
If the Customer is already using Samsara, it is likely that they have many Locations that can be imported into Revenova and create Account records using the Fleet Management Job.
See the Fleet Management Job for more information.
Samsara Portal Setup & Configuration
Required API Key/Token: API Tokens for secure access to the API can be viewed and created on the API Tokens Settings page. Below are instructions on how to set up an API token:
Log in to the Samsara Dashboard and navigate to Settings → API Tokens.
Click + Add an API Token to create a new token.
Enter Revenova Integration as the Name for the API token.
Select a Permission Scope for the API token. Give Full Admin access for this API Token. For Full Admin access, select the Global Read and the Global Write scopes under the Global Dropdown.
Enter a Name and Permission Scope.
Click Save.
Samsara Management Application Setup
Install Samsara ELD in all Fleet Asset tractors/trucks.
Install Samsara Driver Phone Application on all driver smart phones.
From the Samsara Management Application:
Add all driver documents using the names defined in the Customer Invoice Documents table.
The Customer Invoice Document table Synonyms field captures documents from drivers via the Samsara phone application. Existing users of Samsara may use document names that are different from Revenova definitions. Populate this field if this is the case.
Add the following required field to all driver document types:
Is Proof of Delivery (Yes or No)
Configure web hook for push alerts.
Configure your push alert types and thresholds.
From Settings → Fleet → Driver App review setup parameters.
From Settings → Fleet → Dispatch review setup parameters.
Troubleshooting
If the system administrator receives a Fleet Management email with a list of errors, '1) start() method error: invalid token---(rtms)' This means there are invalid Samsara credentials. The job should be stopped until valid credentials are entered.
1) start() method error: invalid token- - -(rtms)
Issue
When running the Fleet Management Job, system admin receives an email containing the following.
1) start() method error: invalid token---(rtms)
(2) start() method error: invalid token---(rtms)
(3) start() method error: invalid token---(rtms)
(4) start() method error: invalid token---(rtms)
(5) start() method error: invalid token---(rtms)
(6) start() method error: invalid token---(rtms)
(7) start() method error: Unexpected character ('r' (code 114)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at input location [1,2]---(System Code)
Resolution
The credentials for the Samsara integration are invalid. Stop the Fleet Management job and enter valid credentials. Start the Fleet Management Job when the credentials are updated.