I am working on a script that I hope will be able to add URLs to MX group policy whitelists by API call.
We have ~100 remote locations with an MX firewall, a user PC, and a digital signage PC connected to a large display. Each site has a boilerplate Meraki group policy applied to the digital signage PC that blocks all traffic, except what is appended to the whitelist on the policy.
I have built out a script in powershell that is able to enumerate all MX devices in our organization, check each MX for this policy, and get the settings for this policy.
I've added on to this script, and am now trying to push new URLs out to the group policy whitelist for sites. I am testing against just one in particular, but am seeing unexpected results.
When checking the constructed request body in the script, I can see that the test URL is present (www.foo.com) and is included in the PUT request. When looking in the REST response after making the call, I do not see www.foo.com. I also checked in a browser at both the direct API URL, and the Dashboard for this policy, but it is not being added to either place.
On a hunch, I went to the Dashboard for this policy, and added www.bar.com to the whitelist, and waited for the configuration to synchronize. When I ran the script again and checked the REST response, I saw the same behavior above for www.foo.com, but I saw www.bar.com in the response.
I confirmed that I am using the PUT method for this call, and that my request parameters match what is required in the API documentation (https://developer.cisco.com/meraki/api-v1/#!update-network-group-policy).
It appears that the API is handling this request as a GET instead of a PUT, and I'm not sure how to proceed. Any advice or insight would be greatly appreciated.