cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
107
Views
0
Helpful
4
Replies

Get Snapshot Image

Elanp
Community Member

I am able to generate a snapshot of a camera using the /devices/{serial}/camera/generateSnapshot endpoint and receive a 202 response with a snapshot url and expiry time. However when I make a GET request to the snapshot url that was returned, it gives me a 400 error with a response of

'<?xml version="1.0" encoding="iso-8859-1"?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n <head>\n <title>400 Bad Request</title>\n </head>\n <body>\n <h1>400 Bad Request</h1>\n </body>\n</html>'

How do I get the actual image bytes once it is generated?

Thank you

4 Replies 4

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

I find that the snapshot is not available immediately after calling generateSnapshot.  You have to wait for the camera to generate it and then upload it.  Think of generateSnapshot more like a queued request.

You'll need to implement a delay and retry logic to fetch it.

Elanp
Community Member

Thank you Philip,

Do you know what I can expect for a standard snapshot generation time? I am creating a wait for 10-15 minutes, but am still getting a 400. Additionally, I will be trying to generate snapshots for multiple cameras simultaneously. Will this cause any performance issues? Can you elaborate as to the general expectations I should have regarding the snapshot generation performance?

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

15 to 120s.

Once you have the snapshot URL, try loading it in your web browser.

You can generate lots of snapshot requests for different cameras at the same time.

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

I found some old code that I wrote a long time ago.  This used the old API, so the code no longer works "as-is", the concepts are still the same.

Actually, looking at it again - it might still work.

 

https://ifm.net.nz/cookbooks/meraki-icu.html