I am trying to update the MX L7 firewall rules and am getting a 400 Bad Request. If I compare what my variable looks like that I am using to do the update via the API to what it looks like if I update it in the dashboard and get the rules it appears to be the same. Below it the main part of the code. It reads through the existing rules and if the rule I need isn't there is adds it. Same issue with V0 or V1; this code is currently using V1.
I have been using the shard approach for the last year and half or so since Meraki added the redirects, doesn't seem like Powershell likes it from a Security point of view. I get the following error when using https://api.meraki.com: "The remote server returned an error: (308) Permanent Redirect".
I tried https:/api-mp.meraki.com: and got the same error as using the shard: "The remote server returned an error: (400) Bad Request." Although this looks like it will solve having to use Shard, we will give it a try in one of my other scripts.
Hi @MarkMoore! I reviewed your code and didn't see where API key was being passed with the appropriate API key header. Where is the API key being appended to your request--inside $headers I presume? If so, what's the structure of that variable?
Please remember to not share your actual API key in your response--just curious where/how it's added to the request.