<?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 Re: API returning 404 in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411269#M1991</link>
    <description>HI Michael&lt;BR /&gt;&lt;BR /&gt;The network id is not the ID you see in the dashboard or somewhere else, you can get it by listing networks from your org with a call to:&lt;BR /&gt;&lt;BR /&gt;/organizations/[organizationId]/networks&lt;BR /&gt;&lt;BR /&gt;You can get a list of orgs you manage by calling:&lt;BR /&gt;&lt;BR /&gt;/organizations&lt;BR /&gt;&lt;BR /&gt;Also please change your API key *now* since you posted it here and everyone with that key can now access your network via API and make changes (!)&lt;BR /&gt;&lt;BR /&gt;The network ID looks similar to: L_123456789123456789&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers!</description>
    <pubDate>Wed, 04 Apr 2018 14:37:57 GMT</pubDate>
    <dc:creator>hoempf</dc:creator>
    <dc:date>2018-04-04T14:37:57Z</dc:date>
    <item>
      <title>API returning 404</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411268#M1990</link>
      <description>&lt;P&gt;I am trying to leverage the API to write a script that will periodically check the last connected date for our SM devices.&lt;/P&gt;&lt;P&gt;I happen to be using Powershell, though you tell me if it matters and I still consider myself a bginner when it comes to REST, but I have worked with it.&lt;/P&gt;&lt;P&gt;My first issue is that I'm not sure what format the network id should be in. My network ID is something like 123-456-0789, so I tried that in the URL and I also tried &lt;SPAN&gt;1234560789, but neither made any difference.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Below is my code, followed by the error I am seeing:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;    $MerakiApiKey = "32d000fa9c0ce60d4e000cd4d00001b00000053d"
    $MerakiUrl = "https://api.meraki.com/api/v0/networks/1234560789/sm/devices?fields=ip,lastConnected&amp;amp;scope=all"
    $headers = @{}
    $headers.Add("X-Cisco-Meraki-API-KEY",$MerakiApiKey)
    $headers.Add("Content-Type","application/json")
Invoke-RestMethod -Method Get -Uri $MerakiUrl -Headers $headers&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;Invoke-RestMethod : The remote server returned an error: (404) Not Found.&lt;BR /&gt;At line:1 char:1&lt;BR /&gt;+ Invoke-RestMethod -Method Get -Uri $MerakiUrl -Headers $headers&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException&lt;BR /&gt;+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 14:31:23 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411268#M1990</guid>
      <dc:creator>Michael-873494</dc:creator>
      <dc:date>2018-04-04T14:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: API returning 404</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411269#M1991</link>
      <description>HI Michael&lt;BR /&gt;&lt;BR /&gt;The network id is not the ID you see in the dashboard or somewhere else, you can get it by listing networks from your org with a call to:&lt;BR /&gt;&lt;BR /&gt;/organizations/[organizationId]/networks&lt;BR /&gt;&lt;BR /&gt;You can get a list of orgs you manage by calling:&lt;BR /&gt;&lt;BR /&gt;/organizations&lt;BR /&gt;&lt;BR /&gt;Also please change your API key *now* since you posted it here and everyone with that key can now access your network via API and make changes (!)&lt;BR /&gt;&lt;BR /&gt;The network ID looks similar to: L_123456789123456789&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers!</description>
      <pubDate>Wed, 04 Apr 2018 14:37:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411269#M1991</guid>
      <dc:creator>hoempf</dc:creator>
      <dc:date>2018-04-04T14:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: API returning 404</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411270#M1992</link>
      <description>&lt;P&gt;I was wondering about the OrgID and Network ID, but I didn't see where to get them. Thank you very much!&lt;/P&gt;&lt;P&gt;That API key isn't the real one, no worries!&lt;/P&gt;&lt;P&gt;Now the error I see is:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;Server error&lt;BR /&gt;The server encountered an error and could not complete your request. A message has been sent to our engineering and support teams to notify us of the problem, and we will fix it as soon as possible.&lt;BR /&gt;The Cisco Meraki Dashboard is temporarily unavailable, but rest assured your Meraki equipment is still running and network operation has not been interrupted. Learn more about Meraki's out-of-band control.&lt;BR /&gt; &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 14:46:28 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411270#M1992</guid>
      <dc:creator>Michael-873494</dc:creator>
      <dc:date>2018-04-04T14:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: API returning 404</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411271#M1993</link>
      <description>&lt;P&gt;Awesome, glad to hear about the API key &lt;SPAN class="lia-unicode-emoji" title=":winking_face:"&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So either the Meraki server where your org is hosted really has problems now or you malformed the request. In the latter case I think you should get another error, but not sure since it never failed on me with this error message &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Also you might want to consider using the shard URL like "n172.meraki.com" instead of "api.meraki.com". In my experience using the shard node directly works better than following redirects.&lt;/P&gt;&lt;P&gt;I hope that helps &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;P.S. Do not worry too much about REST, the API is IMHO fundamentally not RESTful on so many levels (that's a whole different topic[1]). I think it's better to call it JSON API over HTTPS for a better understanding on how it works. Basically you throw JSON at it and it replies in JSON, pretty basic. It's not worse or better than a real REST API, just a different approach.&lt;/P&gt;&lt;P&gt;[1] &lt;A href="https://dzone.com/articles/5-easy-to-spot-tells-that-your-rest-api-is-not-res" target="_blank" rel="nofollow noopener noreferrer"&gt;https://dzone.com/articles/5-easy-to-spot-tells-that-your-rest-api-is-not-res&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 15:34:13 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411271#M1993</guid>
      <dc:creator>hoempf</dc:creator>
      <dc:date>2018-04-04T15:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: API returning 404</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411272#M1994</link>
      <description>&lt;P&gt;I did try the shared url and got the same error. I will try again tomorrow I guess and see if it changes.&lt;/P&gt;&lt;P&gt;Based on the code I posted, do you see anything that should make it malformed?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 16:31:48 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411272#M1994</guid>
      <dc:creator>Michael-873494</dc:creator>
      <dc:date>2018-04-04T16:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: API returning 404</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411273#M1995</link>
      <description>I don‘t have a lot of experience with Powershell but I‘d say it looks good so far.</description>
      <pubDate>Wed, 04 Apr 2018 19:34:37 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411273#M1995</guid>
      <dc:creator>hoempf</dc:creator>
      <dc:date>2018-04-04T19:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: API returning 404</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411274#M1996</link>
      <description>&lt;P&gt;&lt;A href="https://community.meraki.com/t5/user/viewprofilepage/user-id/5858"&gt;@Michael-873494&lt;/A&gt;&lt;/P&gt;&lt;P&gt;We utilize the API exclusively with PS in our environment and I do not see an issue with your code. You would want to try the shard URL as previously suggested as well as &lt;A href="https://dashboard.meraki.com/api/... " target="_blank" rel="nofollow noopener noreferrer"&gt;https://dashboard.meraki.com/api/... &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 15:20:40 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411274#M1996</guid>
      <dc:creator>alex_g</dc:creator>
      <dc:date>2018-04-05T15:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: API returning 404</title>
      <link>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411275#M1997</link>
      <description>&lt;P&gt;The final issue I had, turned out to have to do with the "scope=All". Adding the scope parameter causes the error I reported, though I am not sure why and tech support doesn't know either.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 22:13:46 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/api-returning-404/m-p/5411275#M1997</guid>
      <dc:creator>Michael-873494</dc:creator>
      <dc:date>2018-04-13T22:13:46Z</dc:date>
    </item>
  </channel>
</rss>

