Community
timestamp - api.samsara.com/v1/fleet/assets/locations
Hello! is there a parameter that can be used to retrieve only the most recent data (or filter by timestamp for example) when making a call to api.samsara.com/v1/fleet/assets/locations?
Posted by Erin Schan about 3 years ago
Get all camera media always returns the same image
Hello,
I noticed that the "Get all camera media" endpoint always returns the exact same image URLs for frontFacing and for driverFacing respectively within a response, even though the captureTime timestamps change. The URLs are identical. Modifying the endTime (not the startTime) may change the image returned.
I think there's something wrong on your end. Potentially, the image corresponding to the acquired image closest to the endTime parameter is the one returned for all timestamp within the startTime-endTime timespan.
Sample:
```javascript
{
"captureTime": "2021-02-22T17:18:04.187Z",
"url": "https://s3.eu.samsara.com/samsara-eu-dashcam-videos/redacted
}
{
"captureTime": "2021-02-22T17:23:05.186Z",
"url": "https://s3.eu.samsara.com/samsara-eu-dashcam-videos/redacted
}
{
"captureTime": "2021-02-22T17:28:05.187Z",
"url": "https://s3.eu.samsara.com/samsara-eu-dashcam-videos/redacted
}
{
"captureTime": "2021-02-22T17:33:05.187Z",
"url": "https://s3.eu.samsara.com/samsara-eu-dashcam-videos/redacted
}
{
"captureTime": "2021-02-22T17:33:59.187Z",
"url": "https://s3.eu.samsara.com/samsara-eu-dashcam-videos/redacted
}
```
This output is obtained from the following command line:
```shell
curl --location --request GET 'https://api.eu.samsara.com/fleet/vehicles/cameras/media/history?startTime=2021-02-22T00:00:00.000Z&endTime=2021-02-22T23:59:59.999Z' \
--header 'Authorization: Bearer REDACTED' | jq -r '.data[0].cameras[0].images[] | {captureTime: .captureTime, url: .imageData[] | select(.cameraView == "frontFacing") | .url}'
```
Note: all redacted URLs are identical, which is the issue explained above. Changing the endTime may yield another image
```shell
curl --location --request GET 'https://api.eu.samsara.com/fleet/vehicles/cameras/media/history?startTime=2021-02-22T00:00:00.000Z&endTime=2021-02-22T13:59:59.999Z' \
--header 'Authorization: Bearer REDACTED' | jq -r '.data[0].cameras[0].images[] | {captureTime: .captureTime, url: .imageData[] | select(.cameraView == "frontFacing") | .url}'
```
Additional question: is there a way to request the immediate capture of a new snapshot from the dashcam (front and driver)? This is very important for our use case.
If not, what is the capture frequency? Looking at the captureTime timestamps, it's irregular: 5 minutes seems to be the baseline frequency but sometimes it's more frequent. Can snapshots be automatically be taken when engine is turned off?
Thank you
Posted by Guillem Mazarico over 3 years ago
Updating Odometer
After replacing an engine, ECM, or dash component, How do we update the odometer readin in Samsara.
Posted by Mike Bilic over 2 years ago
Show the real time position of some vehicle in a map
Hey there. I'm new with Samsara, I was wondering if it's possible that we can show the real-time position of some vehicle on a map.
Beside, if it's possible to use the Samsara's map
Finally, if there is an API to do this.
Thanks in advance.
Posted by Diego Checcarelli over 2 years ago
camera parameter issue
Hi I'm currently trying to use
https://api.samsara.com/fleet/vehicles/cameras/media/history
but having issues with startTime and endTime parameters
I set it as close as I can but it says missing from query string.
python 3.x
camera = 'https://api.samsara.com/fleet/vehicles/cameras/media/history'
headers = {
"Accept": "application/json",
"Authorization": "Bearer <<token>>",
"startTime": "2021-02-14T00:00:00Z",
"endTime": "2021-02-15T00:00:00Z"
}
response = requests.request("GET", camera, headers=headers)
print(response.text)
result:
<class 'str'>
2021-02-16T17:05:09Z 2021-02-16T17:05:09Z
{"message":"\"startTime\" is missing from query string; \"endTime\" is missing from query string","requestId":"74dcdd32-6e4ae656"}
Posted by Gujin over 3 years ago
ELD generated vs driver app created HOS log events
My company has been having a problem with drivers putting themselves into Driving status while the vehicle is stopped. In the detailed Hours of Service report available through the web site, it's possible to see whether a log entry was created by the ELD (and thus cannot be edited). Is this data available in some way through the API? If not, could it be added? I'd like to be able to flag Driving status entries that were not created by the ELD.
Posted by Dan Smith over 3 years ago
CORS Issue
I'm trying to pull data into my angular application, and for some reason I can't get around CORS. I'm sending the api key in the headers as Authorization.. not quite sure what i'm doing wrong here.
Posted by Jesse over 3 years ago
Log Recorded Location Field
What does the logRecordedLocation field represent in the HoursOfService pull?
Is that the location of the device the driver was using when the log changed or is that the location of the vehicle's gateway at the time of the log change?
Endpoint in question.
https://api.samsara.com/fleet/hos/logs
Thank you.
Posted by Geof Lee about 3 years ago
cycle
J'ai un chauffeur que nous ne sommes pas en mesure de modifier son cycle de travail pour le canada? Nous avons essayé plusieurs option mais le système conserve toujours les anciennes donnés les autres chauffeurs sont tous correct sauf celui-là , alors comment corriger la situation?
Posted by Andre Corriveau about 3 years ago
Address API
Hi,
Are there any plans to make the Address API more robust? Currently you can only query it with an Address ID.
Would like to be able to pass address fragments and have return values that represent possible matches, similar to how Google Maps / Bing Maps APIs work.
Presently, the only way I can think of is to query all addresses and then loop through them and do the location matching on my end; this isn't the end of the world, but it does feel like this should be done on the API instead.
Posted by Kiran Ramaswamy over 3 years ago