cancel
Showing results for 
Search instead for 
Did you mean: 

Meraki Camera API Snapshot

Conversationalist

Meraki Camera API Snapshot

Hi,

 

I'm trying to take a snapshot by using the CURL giving the network id, the camera's serial number, and all the necessary data. However, when making the POST of the CURL, I get a 400 error Response.

 

HTTP ERROR 400
Problem accessing /cameras/live_snapshot. Reason:
     can't parse j son parameters: No content to map due to end-of-input

 

I'm not sure what the problem is exactly.

 

Thank You,

6 REPLIES 6
Kind of a big deal

Re: Meraki Camera API Snapshot

Can you post the curl command you're using? Be sure to redact your API key, serial and network ID.

Conversationalist

Re: Meraki Camera API Snapshot

Hi,

 

I'm using Python requests:

 

headers = {
                 'X-Cisco-Meraki-API-Key': API_KEY,
                 'Content-Type': 'application/json',
}

 

response = requests.post('https://api.meraki.com/api/v0/networks/'+NET_ID+'/cameras/'+SERIAL_CAM1+'/snapshot', headers=headers)

Kind of a big deal

Re: Meraki Camera API Snapshot

It looks like the API doc is wrong. remove the content-type json stuff and it works for me.

 

headers = {
                 'X-Cisco-Meraki-API-Key': API_KEY,
}
requests.post('https://api.meraki.com/api/v0/networks/<netID>/cameras/<serial>/snapshot', headers=headers)

Or

 

curl -L -H 'X-Cisco-Meraki-API-Key: <api_key>' -X POST 'https://api.meraki.com/api/v0/networks/<Net_ID>/cameras/<serial>/snapshot'
Conversationalist

Re: Meraki Camera API Snapshot

Thank you very much, now it works correctly Smiley Very Happy

Kind of a big deal

Re: Meraki Camera API Snapshot

Hey @TonyC  @CameronMoody  FYI looks like the API doc for Camera snapshots might have an error in it.

 

https://api.meraki.com/api_docs#generate-a-snapshot-of-what-the-camera-sees-at-the-specified-time-an...

 

Sorry if this isn't you guys, but I thought the API guy and the doc guy would be good places to start Smiley Happy

Meraki Employee

Re: Meraki Camera API Snapshot

Thanks for the report, we have reproduced and will address. For now omitting the application-type header appears to address as @jdsilva indicated
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.