I am trying to use the UrlfetchApp.fetch ( 'put' ) method command in Google sheets to add a couple of blocked urls etc. I can do this failry easily in postman, but am not comming right in Google sheets. My Google Sheets script looks as follows: function myFunction() { var myHeaders = { 'x-cisco-meraki-api-key': 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy' }; var raw =JSON.stringify({ "allowedUrlPatterns":["http://www.example.org","http://help.com.au"], "blockedUrlPatterns":["http://www.example.com","http://www.betting.com"], "blockedUrlCategories":["meraki:contentFiltering/category/67","meraki:contentFiltering/category/70"], "urlCategoryListSize":"topSites" }); var requestOptions = { method: 'PUT', headers: myHeaders, body: raw, redirect: 'follow' }; var myurl = "https://api.meraki.com/api/v0/networks/N_xxxxxxxxxxxxxxxxxx/contentFiltering" Logger.log(requestOptions); var response = UrlFetchApp.fetch(myurl, requestOptions); Logger.log(response); Logger.log(response.getResponseCode()); } If you could give any suggestions/ help it would be greatly appreciated.
... View more