Showing results for 
Search instead for 
Did you mean: 

Getting error 400 when adding a static route


I have been experimenting with the API from PowerShell using cURL in insecure mode.  I've been successful with my GET requests, but I am unable to successfully use a POST request to add a static route.


Here is the command I am using (with the private bits replaced):


     curl -Lkvi -H "X-Cisco-Meraki-API-Key: $privatesBits" \

     -H 'Content-Type: application/json' \

     -X POST \

     --data-binary \

     '{"name":"testing","subnet":"","gatewayIP":"","enabled":"true"}' \



I get an error 400: bad request back from the server:

     < HTTP/1.1 400 Bad Request


As well as this feedback:

     There was a problem in the JSON you submitted: not a number or other value at line 1, column 1      [parse.c:422]*

I have tested the same function in Postman with the same API key, URL, and json text with no problems.  That is all well and good, but I would prefer to execute these tasks from a PowerShell script.  What am I missing here?  Is it necessary for me to provide a certificate for these changes to work?  I get the same results using ConvertTo-Json in my script as well as when I hard code it.  Passing it directly to cURL at the CLI gives the same results as well.


Any guidance would be greatly appreciated.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: