<?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: Using Powershell how to paginate thru pages. in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437567#M5973</link>
    <description>&lt;P&gt;Get GetBlueToothclients and Get NetworkEvents, no change same data coming down each time.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jul 2024 14:22:00 GMT</pubDate>
    <dc:creator>smeyer1</dc:creator>
    <dc:date>2024-07-16T14:22:00Z</dc:date>
    <item>
      <title>Using Powershell how to paginate thru pages.</title>
      <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437559#M5965</link>
      <description>&lt;P&gt;I am trying to get network events for last 30 days, the /network/{networkid}/events has a perPage value of 3 to 1000. The documentation is unclear how to pageinate the calls. Does anyone have a working example of pulling several pages of events and placing into a spreadsheet. &lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 15:57:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437559#M5965</guid>
      <dc:creator>smeyer1</dc:creator>
      <dc:date>2024-07-15T15:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using Powershell how to paginate thru pages.</title>
      <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437560#M5966</link>
      <description>&lt;P&gt;You can include this parameter to reduce the amount of pages:&lt;/P&gt;&lt;P&gt;- &lt;SPAN&gt;perPage: Range is 3 - 1000. Default is 10.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The entire explanation about how Pagination works in Meraki APIs, including an example, is here: &lt;A href="https://developer.cisco.com/meraki/api-v1/pagination/#pagination" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developer.cisco.com/meraki/api-v1/pagination/#pagination&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 22:53:47 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437560#M5966</guid>
      <dc:creator>riduque</dc:creator>
      <dc:date>2024-07-15T22:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using Powershell how to paginate thru pages.</title>
      <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437561#M5967</link>
      <description>&lt;P&gt;I have maxed out the permanent. WhatsApp need is how to get to the next 1000 entries&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 22:57:58 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437561#M5967</guid>
      <dc:creator>smeyer1</dc:creator>
      <dc:date>2024-07-15T22:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using Powershell how to paginate thru pages.</title>
      <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437562#M5968</link>
      <description>&lt;P&gt;Have you tried using this parameter in your query?&lt;/P&gt;&lt;PRE class="lia-code-sample language-markup"&gt;&lt;CODE&gt;perPage=1000&amp;amp;startingAfter=1001&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jul 2024 23:10:58 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437562#M5968</guid>
      <dc:creator>riduque</dc:creator>
      <dc:date>2024-07-15T23:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using Powershell how to paginate thru pages.</title>
      <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437563#M5969</link>
      <description>&lt;P&gt;Did you spot this bit from the link &lt;A href="https://community.meraki.com/t5/user/viewprofilepage/user-id/28188"&gt;@riduque&lt;/A&gt; supplied?&lt;BR /&gt;&lt;BR /&gt;"&lt;SPAN&gt;When you send an API request to a paginated operation, the number of records that are actually queried in the database is equal to the value of perPage. Then, the HTTP response will contain a custom header named Link. The Link header is a comma-separated list of &lt;/SPAN&gt;&lt;STRONG&gt;up to&lt;/STRONG&gt;&lt;SPAN&gt; 4 links: &lt;/SPAN&gt;first&lt;SPAN&gt;, &lt;/SPAN&gt;prev&lt;SPAN&gt;, &lt;/SPAN&gt;next&lt;SPAN&gt;, and &lt;/SPAN&gt;last&lt;SPAN&gt;. These links represent subsequent requests that can be used to navigate the paginated records. These links will include appropriate values for the startingAfter or endingBefore parameters in order to achieve this navigation. The exact format of the Link header might look something like:"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 07:41:53 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437563#M5969</guid>
      <dc:creator>Philip D'Ath</dc:creator>
      <dc:date>2024-07-16T07:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using Powershell how to paginate thru pages.</title>
      <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437564#M5970</link>
      <description>&lt;P&gt;Going sideways - have you considered using the Meraki Python SDK for this?  It does all the pagination automatically for you, so you can ignore the issue.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 07:43:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437564#M5970</guid>
      <dc:creator>Philip D'Ath</dc:creator>
      <dc:date>2024-07-16T07:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using Powershell how to paginate thru pages.</title>
      <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437565#M5971</link>
      <description>&lt;P&gt;There is no links returned in the response. This is why documentation is not very well.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 12:11:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437565#M5971</guid>
      <dc:creator>smeyer1</dc:creator>
      <dc:date>2024-07-16T12:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using Powershell how to paginate thru pages.</title>
      <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437566#M5972</link>
      <description>&lt;P&gt;Unforturnately is has to be written in powershell.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 12:11:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437566#M5972</guid>
      <dc:creator>smeyer1</dc:creator>
      <dc:date>2024-07-16T12:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using Powershell how to paginate thru pages.</title>
      <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437567#M5973</link>
      <description>&lt;P&gt;Get GetBlueToothclients and Get NetworkEvents, no change same data coming down each time.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 14:22:00 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437567#M5973</guid>
      <dc:creator>smeyer1</dc:creator>
      <dc:date>2024-07-16T14:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using Powershell how to paginate thru pages.</title>
      <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437568#M5974</link>
      <description>&lt;P&gt;Just happend to have a similar issue. I came up with this function. Hope this helps&lt;/P&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Function Get-Clients {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;param (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;        [Parameter(mandatory=$true)]$MerakiApiKey,&lt;/DIV&gt;&lt;DIV&gt;        [Parameter(mandatory=$true)]$networkId,&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$perPage = "50"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;    )&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$headers = @{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"X-Cisco-Meraki-API-Key" = $MerakiapiKey&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Content-Type" = "application/json"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Accept" = "application/json"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$ClientBody = @{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;perPage = $perPage&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$clientsurl = "&lt;A href="https://api.meraki.com/api/v1/networks/$networkId/clients" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api.meraki.com/api/v1/networks/$networkId/clients&lt;/A&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$AllClientData = $null&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;    do {&lt;/DIV&gt;&lt;DIV&gt;        Write-Host "Requesting clients from $clientsurl"&lt;/DIV&gt;&lt;DIV&gt;        $result = Invoke-WebRequest -Uri $clientsurl -Headers $Headers -Body $ClientBody&lt;/DIV&gt;&lt;DIV&gt;        $AllClientData += $result.Content | ConvertFrom-Json&lt;/DIV&gt;&lt;DIV&gt;        &lt;/DIV&gt;&lt;DIV&gt;        $clientsurl = $result.RelationLink.next&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;    } until ($clientsurl -notlike "&lt;A href="https://api.meraki.com/*" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api.meraki.com/*&lt;/A&gt;")&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return $AllClientData&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;    &lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Jul 2024 08:21:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437568#M5974</guid>
      <dc:creator>JasperAspect</dc:creator>
      <dc:date>2024-07-23T08:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using Powershell how to paginate thru pages.</title>
      <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437569#M5975</link>
      <description>&lt;P&gt;thanks, what i found out from your answer is that Invoke-RestMethod only returns a JSON object, and does not allow you access to the Headers in the response. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 15:05:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437569#M5975</guid>
      <dc:creator>smeyer1</dc:creator>
      <dc:date>2024-07-23T15:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using Powershell how to paginate thru pages.</title>
      <link>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437570#M5976</link>
      <description>&lt;P&gt;This doesnt work, does the same thing as perPage=1000&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 21:29:11 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/using-powershell-how-to-paginate-thru-pages/m-p/5437570#M5976</guid>
      <dc:creator>uvega</dc:creator>
      <dc:date>2025-05-15T21:29:11Z</dc:date>
    </item>
  </channel>
</rss>

