I tried to use the following command from both .bat and .ps1 types of batch files (Windows CMD and Powershell), but they always throw error "Bad request: There was a problem in the JSON you submitted":
\bin>.\curl.exe --verbose -H "X-Cisco-Meraki-API-Key:~~~ed4c95773f7" -H "Content-Type:application/json" -X PUT --data-binary '{"applianceIp":"172.25.240.49","subnet":"172.25.240.48/29"}' "https://api.meraki.com/api/v0/networks/N_682~~~86331/vlans/801"
* Trying 209.206.57.36...
* TCP_NODELAY set
* Connected to api.meraki.com (209.206.57.36) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: ~~~\bin\curl-ca-bundle.crt
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Next protocol (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: OU=Domain Control Validated; CN=*.meraki.com
* start date: Aug 16 20:21:40 2016 GMT
* expire date: Sep 16 20:57:39 2019 GMT
* subjectAltName: host "api.meraki.com" matched cert's "*.meraki.com"
* issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certs.godaddy.com/repository/; CN=Go Daddy Secure Certificate Authority - G2
* SSL certificate verify ok.
> PUT /api/v0/networks/N_682~~~86331/vlans/801 HTTP/1.1
> Host: api.meraki.com
> User-Agent: curl/7.60.0
> Accept: */*
> X-Cisco-Meraki-API-Key:~~~ed4c95773f7
> Content-Type:application/json
> Content-Length: 53
>
* upload completely sent off: 53 out of 53 bytes
< HTTP/1.1 400 Bad Request
< Server: nginx
< Date: Fri, 08 Jun 2018 14:54:34 GMT
< Content-Type: */*; charset=utf-8
< Content-Length: 58
< Connection: keep-alive
< X-Request-Id: f209630c73f04174371cabe2f2d4ed74
< X-Runtime: 0.001298
< X-Rack-Cache: invalidate, pass
<
Bad request: There was a problem in the JSON you submitted
* Connection #0 to host api.meraki.com left intact
When using from Postman, everything works fine, so I cannot deduct the error reason from there.
With Kind Regards
Andreas Englisch