<?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 Help with Meraki API and Powershell in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/help-with-meraki-api-and-powershell/m-p/5398150#M132</link>
    <description>&lt;P&gt;I am having an issue using "Invoke-RestMethod" for Powershell to pull the clients (devices) list. I have setup the API and I am able to get some information like the Admins or the Network ID, Org ID, etc. I just can't seem to figure out how to pull my devices. I have looked at the documentation over and over and it is not working. I end up getting an Error 400: Bad request. &lt;BR /&gt;&lt;BR /&gt;Here is the documentation I followed to Get Clients: &lt;A href="https://developer.cisco.com/meraki/api-v1/#!get-network-clients" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developer.cisco.com/meraki/api-v1/#!get-network-clients&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is my Powershell script (scrubbed). Sorry, they don't have a code button for Powershell:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;$APIKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"&lt;BR /&gt;$orgid = "XXXXX"&lt;BR /&gt;$networkid = "N_XXXXXXXXXXXXXXXXXXXXXXXX"&lt;BR /&gt;$headers = @{&lt;BR /&gt;"Content-Type" = "application/json"&lt;BR /&gt;"Accept" = "application/json"&lt;BR /&gt;"X-Cisco-Meraki-API-Key" = $APIKey&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Invoke-RestMethod -Method Get -Uri "&lt;A href="https://api.meraki.com/api/v1/networks/$($networkid)/clients" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.meraki.com/api/v1/networks/$($networkid)/clients&lt;/A&gt;" -Headers $Headers&lt;/P&gt;&lt;P&gt;That is what I am thinking (per the documentation) should work. I am not sure where I am going wrong. I have Systems Manager only and I have devices that have been added to it. I would like that list.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-08-31_7-53-43.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/262522i32D51FF9A0D5C496/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Aug 2021 14:55:26 GMT</pubDate>
    <dc:creator>Christopheric12</dc:creator>
    <dc:date>2021-08-31T14:55:26Z</dc:date>
    <item>
      <title>Help with Meraki API and Powershell</title>
      <link>https://community.cisco.com/t5/network-platform-api/help-with-meraki-api-and-powershell/m-p/5398150#M132</link>
      <description>&lt;P&gt;I am having an issue using "Invoke-RestMethod" for Powershell to pull the clients (devices) list. I have setup the API and I am able to get some information like the Admins or the Network ID, Org ID, etc. I just can't seem to figure out how to pull my devices. I have looked at the documentation over and over and it is not working. I end up getting an Error 400: Bad request. &lt;BR /&gt;&lt;BR /&gt;Here is the documentation I followed to Get Clients: &lt;A href="https://developer.cisco.com/meraki/api-v1/#!get-network-clients" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developer.cisco.com/meraki/api-v1/#!get-network-clients&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is my Powershell script (scrubbed). Sorry, they don't have a code button for Powershell:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;$APIKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"&lt;BR /&gt;$orgid = "XXXXX"&lt;BR /&gt;$networkid = "N_XXXXXXXXXXXXXXXXXXXXXXXX"&lt;BR /&gt;$headers = @{&lt;BR /&gt;"Content-Type" = "application/json"&lt;BR /&gt;"Accept" = "application/json"&lt;BR /&gt;"X-Cisco-Meraki-API-Key" = $APIKey&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Invoke-RestMethod -Method Get -Uri "&lt;A href="https://api.meraki.com/api/v1/networks/$($networkid)/clients" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.meraki.com/api/v1/networks/$($networkid)/clients&lt;/A&gt;" -Headers $Headers&lt;/P&gt;&lt;P&gt;That is what I am thinking (per the documentation) should work. I am not sure where I am going wrong. I have Systems Manager only and I have devices that have been added to it. I would like that list.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-08-31_7-53-43.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/262522i32D51FF9A0D5C496/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 14:55:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/help-with-meraki-api-and-powershell/m-p/5398150#M132</guid>
      <dc:creator>Christopheric12</dc:creator>
      <dc:date>2021-08-31T14:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Meraki API and Powershell</title>
      <link>https://community.cisco.com/t5/network-platform-api/help-with-meraki-api-and-powershell/m-p/5398151#M133</link>
      <description>&lt;P&gt;That code runs just fine in a non-SM network so that endpoint is likely not meant for SM, and what you are actually looking for may be one of these&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.cisco.com/meraki/api-v1/#!get-network-sm-devices" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developer.cisco.com/meraki/api-v1/#!get-network-sm-devices&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.cisco.com/meraki/api-v1/#!get-network-sm-users" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developer.cisco.com/meraki/api-v1/#!get-network-sm-users&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 20:20:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/help-with-meraki-api-and-powershell/m-p/5398151#M133</guid>
      <dc:creator>matt_uc</dc:creator>
      <dc:date>2021-08-31T20:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Meraki API and Powershell</title>
      <link>https://community.cisco.com/t5/network-platform-api/help-with-meraki-api-and-powershell/m-p/5398152#M134</link>
      <description>&lt;P&gt;Exactly! If you want SM devices that's slightly different from network clients.&lt;/P&gt;&lt;H1 id="toc-hId-1814550972"&gt;Get Network Clients&lt;/H1&gt;&lt;P class=""&gt;&lt;STRONG&gt;Operation Id:&lt;/STRONG&gt;getNetworkClients&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;Description:&lt;/STRONG&gt;List the clients that have used this network in the timespan&lt;/P&gt;&lt;P class=""&gt; &lt;/P&gt;&lt;H1 id="toc-hId--737605989"&gt;Get Network Sm Devices&lt;/H1&gt;&lt;P class=""&gt;&lt;STRONG&gt;Operation Id:&lt;/STRONG&gt;getNetworkSmDevices&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;Description:&lt;/STRONG&gt;List the devices enrolled in an SM network with various specified fields and filters&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 20:22:49 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/help-with-meraki-api-and-powershell/m-p/5398152#M134</guid>
      <dc:creator>John-on-API</dc:creator>
      <dc:date>2021-08-31T20:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Meraki API and Powershell</title>
      <link>https://community.cisco.com/t5/network-platform-api/help-with-meraki-api-and-powershell/m-p/5398153#M135</link>
      <description>&lt;P&gt;I actually got it. I just needed to add "/sm/devices" and that worked&lt;BR /&gt;&lt;BR /&gt;Invoke-RestMethod -Method Get -Uri "&lt;A href="https://api.meraki.com/api/v1/networks/$($networkid)/sm/devices" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.meraki.com/api/v1/networks/$($networkid)/sm/devices&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 22:50:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/help-with-meraki-api-and-powershell/m-p/5398153#M135</guid>
      <dc:creator>Christopheric12</dc:creator>
      <dc:date>2021-08-31T22:50:03Z</dc:date>
    </item>
  </channel>
</rss>

