Back to All

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:

{
  "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:

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

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