cancel
Showing results for 
Search instead for 
Did you mean: 

Google App Script to take a MV camera snapshot results in 404 error

Meraki Employee

Google App Script to take a MV camera snapshot results in 404 error

I am getting ERROR when trying to call UrlFetchApp.fetch(url,options) from Google App Script. 

 

var options = {
'method' : 'POST',
'headers': {'X-Cisco-Meraki-API-Key': xxxxxxxxx'},
'contentType': 'application/json'

};

 

option1=JSON.stringify(options);
Logger.log(option1);


var response = UrlFetchApp.fetch('https://api.meraki.com/api/v0/networks/L_xxxx84193406xxxxxx/cameras/xxxx-xxxx-xxxx/snapshot', options);

I am getting the error at line "var response = UrlFetchApp.fetch()"

 

2 REPLIES 2
Meraki Employee

Re: Google App Script to take a MV camera snapshot results in 404 error

Hi Felix, I finally got a chance to look into this, and the issue has to do how JavaScript/GApps script is handling CORS. The easiest/quickest fix here is to change your URL from https://api.meraki.com to use the shard number, for example https://n118.meraki.com instead.

Meraki Employee

Re: Google App Script to take a MV camera snapshot results in 404 error

Hi shay, thanks so much for solving my problem! I found out which shard I'm on from my dashboard url. Thanks so much. You are a genius!

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.