Community
how to connect a script to samsara api
i have copied your script code and put my samsara key api, but when it runs an error of authentication appeared
Access to fetch at 'https://api.samsara.com/fleet/vehicles' from origin 'http://localhost' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
how can i do for connect my php system?
script type="text/javascript">
const options = {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: 'Bearer MY_SAMSARA_KEY'
}
};
fetch('https://api.samsara.com/fleet/vehicles', options)
.then(response => console.log(response))
.catch(err => console.error(err));
</script>
Posted by ricardo over 2 years ago
API Integration with ESRI GeoEvent
Has anyone used Samsara API on ESRI GeoEvent? I'm using ESRI GeoEvent to call Samsara API. The problem I have is that GeoEvent cannot make consecutive requests for multiple pages of data. It is required for all the results to be returned in one request. I’ve tried the recommendation on Samsara’s site(https://kb.samsara.com/hc/en-us/articles/360006667552-Integrating-with-ESRI-GIS) but had no luck. I got “POST not allowed on /v1/fleet/vehicles/locations (version 2021.06.09)” for the v1 version, and “invalid token” for the new version of the API.
Posted by Chi Zhang over 2 years ago
ETA Calculation
In [https://api.samsara.com/fleet/routes/{id}], how is the eta value being calculated? Is it coming straight from a Google Maps API? Using the vehicle's current speed along with posted speed limits? Any HOS considerations, truck routes, etc.?
Posted by Lucas Ketchum over 2 years ago
Welcome to the Samsara Developer Discussion Forum!
This is a place where you can crowd-source solutions and best practices for integrating with Samsara.
We encourage you to post questions, and please don't hesitate to chime in on someone else's post if you have a good solution!
The Samsara product team will be answering questions and moderating the forum.
Posted by Tyler Freckmann about 3 years ago
Create Custom Live Share Links
I'd like to generate a Live Share link through an API with a custom destination. Is this possible?
Please note I am not an API dev but before I go down the hole of putting one on this I'd like to know if it's even possible.
My Goal:
Send address and assigned vehicle asset data to Samasara (via Monday.com API) > Generate Live Share Link with custom route and expiration > Send back link to Monday.com with a webhook.
Posted by Kyle over 2 years ago
What source does the odometer reading from v1/fleet/list come from? OBDII or GPS calculation?
We recently released an update to our integration with Samsara and are now supporting both OBDII and GPS calculated meter values from Samsara from the V2 API. Out of curiosity, which of the two sources was feeding the odometer value in the V1 API endpoint "/fleet/list"?
Posted by Ben Weinberg about 3 years ago
Remote Driver App Sign out
I would like to use workflow feature. Our drivers never sign out of Samsara, no matter how many times we remind them. Given this, a workflow cannot be started.
Any ability to remotely sign out a driver in the app?
example. Driver in Off Duty or Sleeper Berth for 2hr and sign out is initiated.
or is there an option to set driver login session timeouts?
Posted by Peter Ragusa over 2 years ago
Driver Mileage
Is there a simple way to gather driver miles driven via API?
I see that I can use https://api.samsara.com/fleet/hos/daily-logs to get distanceTraveled, but it seems like we should be able to gather driver information in the https://api.samsara.com/fleet/drivers APIs as well. I would like to easily be able to pull a drivers miles/hours for a given time period.
Posted by David Moody over 1 year ago
Development / Sandbox site?
Hi all,
Quick question. Looking to add some features to our install of Samsara, using webhooks to communicate between Samsara and other systems we use.
Wondering if there is any way we can get a sandbox or development version of our Samsara account, so that we can test the changes without them going into production.
Thanks!
Posted by Kiran Ramaswamy over 2 years ago
How Can we show samsara map view
Hi
I work for a software development company we are using samasra integration for one of my client .they provide me api key which is working fine. my question is this how can we see map view of any particular truck when user click on any link in our tms software.??
Posted by ray over 1 year ago