- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Restricted to 10 results per network query
Hi, I've got a simple powershell report that looks at a network and pulls all clients. For some reason it only pulls back 10 clients. I can use "select first" command and get 1-10 lines back but nothing more.. what am I missing?
E.G Currently using this to go through each network's clients and pull out only Netgears. If a netgear doesn't appear in first 10 clients pulled back the result is null and script moves to next network.
Solved! Go to solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assume you are using this API call...
https://developer.cisco.com/meraki/api-v1/get-network-clients/
If you look at the details you will see it defaults to 10 clients. You need to set the perPage parameter to get more per page, for this call it can be up to 5000 clients per page.
As you are only getting 10, it sounds like you are not handling multi-page responses, you need to do this otherwise if the number of clients exceeds the perPage value you still will not get all clients.
For info on pagination see... https://developer.cisco.com/meraki/api-v1/pagination/#pagination
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assume you are using this API call...
https://developer.cisco.com/meraki/api-v1/get-network-clients/
If you look at the details you will see it defaults to 10 clients. You need to set the perPage parameter to get more per page, for this call it can be up to 5000 clients per page.
As you are only getting 10, it sounds like you are not handling multi-page responses, you need to do this otherwise if the number of clients exceeds the perPage value you still will not get all clients.
For info on pagination see... https://developer.cisco.com/meraki/api-v1/pagination/#pagination
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using the simplest powershell to negate other possibilities:
$url = "https://api.meraki.com/api/v1/organizations/$OrgID/networks/$NetworkID/clients"
$Response = Invoke-RestMethod -Uri $url -Headers $headers -Method Get
$Response
Now just need to know how to apply the perPage option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can't help much with powershell as I don't use it, but this thread may be useful as it refers to a powershell module someone has created...
https://community.meraki.com/t5/Developers-APIs/Meraki-PowerShell-Module-All-Endpoints/m-p/214204
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Update your URL variable to include '?perPage=5000' or whatever number you're looking for. E.g.