I would like to update the group policy of a client using API in a google script. There is a nice API that should do the work: "Update Network Client Policy". In the google script I am using the UrlFetchApp.fetch() function to do the job. However, when I call this function with the correct values, the response is 200 (OK), but the policy is not actually changed. Using the same parameters in the Meraki Tool, the policy is correctly changed. So parameters are OK. Can anyone give me a hint where I go wrong? The script is as follows var apiKey = <key> var networkId = < networkId> var clientId = <clientId> var url = 'https://api.meraki.com/api/v0/networks/'+ networkId+'/clients/'+ clientId+'/policy' var body = { "mac": <mac address>, "devicePolicy": "Normal" }. var headers = { "Content-Type" : "application/json", "X-Cisco-Meraki-API-Key" : apiKey } var options = { "method" : "PUT", "headers" : headers, "payload" : JSON.stringify(body), } var response = UrlFetchApp.fetch(url, options) var responseCode = response.getResponseCode() var responseMessage = JSON.parse(response.getContentText()) After execution: responseCode = 200 responseMessage = { "mac" : <mac address> "type" : "Blocked" } So, no change in the policy.
... View more