<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Getting error 400 when adding a static route in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/getting-error-400-when-adding-a-static-route/m-p/3424833#M9332</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have been experimenting with the API from PowerShell using cURL in insecure mode.&amp;nbsp; I've been successful with my GET requests, but I am unable to successfully use a POST request to add a static route.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is the command I am using (with the private bits replaced):&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curl -Lkvi -H "X-Cisco-Meraki-API-Key: $privatesBits" \&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -H 'Content-Type: application/json' \&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -X POST \&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --data-binary \&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '{"name":"testing","subnet":"192.168.4.13/32","gatewayIP":"192.168.248.9","enabled":"true"}' \&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://$n000.meraki.com/api/v0/networks/$privateBits/staticRoutes" target="_blank" rel="nofollow noopener"&gt;https://$n000.meraki.com/api/v0/networks/$privateBits/staticRoutes&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I get an error 400: bad request back from the server:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt; HTTP/1.1 400 Bad Request&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As well as this feedback:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; There was a problem in the JSON you submitted: not a number or other value at line 1, column 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [parse.c:422]*&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have tested the same function in Postman with the same API key, URL, and json text with no problems.&amp;nbsp; That is all well and good, but I would prefer to execute these tasks from a PowerShell script.&amp;nbsp; What am I missing here?&amp;nbsp; Is it necessary for me to provide a certificate for these changes to work?&amp;nbsp; I get the same results using ConvertTo-Json in my script as well as when I hard code it.&amp;nbsp; Passing it directly to cURL at the CLI gives the same results as well.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any guidance would be greatly appreciated.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 27 May 2022 23:00:45 GMT</pubDate>
    <dc:creator>jlivingston11</dc:creator>
    <dc:date>2022-05-27T23:00:45Z</dc:date>
    <item>
      <title>Getting error 400 when adding a static route</title>
      <link>https://community.cisco.com/t5/network-platform-api/getting-error-400-when-adding-a-static-route/m-p/3424833#M9332</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have been experimenting with the API from PowerShell using cURL in insecure mode.&amp;nbsp; I've been successful with my GET requests, but I am unable to successfully use a POST request to add a static route.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is the command I am using (with the private bits replaced):&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curl -Lkvi -H "X-Cisco-Meraki-API-Key: $privatesBits" \&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -H 'Content-Type: application/json' \&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -X POST \&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --data-binary \&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '{"name":"testing","subnet":"192.168.4.13/32","gatewayIP":"192.168.248.9","enabled":"true"}' \&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://$n000.meraki.com/api/v0/networks/$privateBits/staticRoutes" target="_blank" rel="nofollow noopener"&gt;https://$n000.meraki.com/api/v0/networks/$privateBits/staticRoutes&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I get an error 400: bad request back from the server:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt; HTTP/1.1 400 Bad Request&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As well as this feedback:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; There was a problem in the JSON you submitted: not a number or other value at line 1, column 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [parse.c:422]*&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have tested the same function in Postman with the same API key, URL, and json text with no problems.&amp;nbsp; That is all well and good, but I would prefer to execute these tasks from a PowerShell script.&amp;nbsp; What am I missing here?&amp;nbsp; Is it necessary for me to provide a certificate for these changes to work?&amp;nbsp; I get the same results using ConvertTo-Json in my script as well as when I hard code it.&amp;nbsp; Passing it directly to cURL at the CLI gives the same results as well.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any guidance would be greatly appreciated.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 23:00:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/getting-error-400-when-adding-a-static-route/m-p/3424833#M9332</guid>
      <dc:creator>jlivingston11</dc:creator>
      <dc:date>2022-05-27T23:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error 400 when adding a static route</title>
      <link>https://community.cisco.com/t5/network-platform-api/getting-error-400-when-adding-a-static-route/m-p/4196896#M9333</link>
      <description>&lt;P&gt;Ive seen a problem that's maybe related, try escaping the double quotes. See if that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;reference:&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/55788754/cisco-aci-authentication-with-curl-doesnt-work" target="_blank"&gt;https://stackoverflow.com/questions/55788754/cisco-aci-authentication-with-curl-doesnt-work&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/4514199/how-to-send-double-quote-in-d-parameter-for-curl-exe/15828662#15828662" target="_blank"&gt;https://stackoverflow.com/questions/4514199/how-to-send-double-quote-in-d-parameter-for-curl-exe/15828662#15828662&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 20:30:42 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/getting-error-400-when-adding-a-static-route/m-p/4196896#M9333</guid>
      <dc:creator>mcmanamyn</dc:creator>
      <dc:date>2020-12-10T20:30:42Z</dc:date>
    </item>
  </channel>
</rss>

