Snapshot API not working 404

Solved
Rafaetero
Getting noticed

Snapshot API not working 404

Hello there

 

I am trying to make a POST request using node to the snapshot API for the MV22 camera 


But i only manage to get a 404

 

This is the URL i am using

 

```

https://api.meraki.com/api/v0/networks/NETWORK/cameras/SERIAL/snapshot

```

Any help would be appreciated, because i don't find the answer

1 Accepted Solution
Rafaetero
Getting noticed

Ok, after using the shard url it started returning a 400, so then I removed the content type application/json and it worked.

This returns me the URL for the snapshot, after trying to make a GET request to this url it gives me a 404 error again. I don't find any documentation at all about how to get this snapshot or what headers does it expect

 

The problem seems to be that when you request a snapshot, this snapshot is not inmediately available, you have to wait 5 seconds before being able to download it through a GET request. 


So what i did is to wait 5 seconds after requesting the snapshot, then fetching it, and it works


To summarize:

- Request the snapshot to the Shard url

- Do not use content type, there is a bug

- Wait 5 seconds

- Download image

View solution in original post

10 Replies 10
BrechtSchamp
Kind of a big deal

What are you calling it from?  Code? Postman?

 

Have you tried calling it using the specific shard url?

Rafaetero
Getting noticed

From code, which one is the shard url?

jdsilva
Kind of a big deal

This sounds familiar...

BrechtSchamp
Kind of a big deal

It's a more specific one with a number.  See the note about "redirect" on this link :

https://documentation.meraki.com/zGeneral_Administration/Other_Topics/The_Cisco_Meraki_Dashboard_API

jdsilva
Kind of a big deal

Rafaetero
Getting noticed

Ok, after using the shard url it started returning a 400, so then I removed the content type application/json and it worked.

This returns me the URL for the snapshot, after trying to make a GET request to this url it gives me a 404 error again. I don't find any documentation at all about how to get this snapshot or what headers does it expect

 

The problem seems to be that when you request a snapshot, this snapshot is not inmediately available, you have to wait 5 seconds before being able to download it through a GET request. 


So what i did is to wait 5 seconds after requesting the snapshot, then fetching it, and it works


To summarize:

- Request the snapshot to the Shard url

- Do not use content type, there is a bug

- Wait 5 seconds

- Download image

schasegleason
Here to help

Thank you!!!
It would really be nice for this to be added in documentation somewhere.
BrechtSchamp
Kind of a big deal

Thanks for reporting back!

BruceHopkins
Just browsing

Hi folks, well, as of today, the API is currently returning a 404 when I perform a GET on the URL of the image returned in the JSON response from the Camera Snapshot API.

 

I waited much longer than  5 seconds to try to GET the image. The URL to the image was in the format of:

 

https://spn3.meraki.com/stream/jpeg/snapshot/b9a47b53df1a68b9VHN2Q1NmNlZTYxO......

Linus
Just browsing

Not sending the content-type header is not a good idea. If you don't send it the post body is ignored, meaning the timestamp is ignored, so you get a snapshot from now instead of the timestamp you send.

Get notified when there are additional replies to this discussion.