- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Limited search
Hi,
I am doing a search of all my MDM devices associated with a network.
I have more than 1000 devices associated but the API only lets me see 1000. Is there a way to remove this restriction?
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("X-Cisco-Meraki-API-Key", $API_key)
$response = Invoke-RestMethod "https://api-mp.meraki.com/api/v1/networks/${Net_ID}/sm/devices?perPage=1000" -Method 'GET' -Headers $headers -Body $body
return $response
Solved! Go to solution.
- Labels:
-
Dashboard API
-
Scanning API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Limiting the number of items returned in an API is normal, and common, as otherwise you could end up making a call that takes a long time to process, and returns a huge amount of data. The most you can return in this instance is 1,000 devices, and then you have to make a second call, with appropriate pagination details, to get the next 1,000 and so on.
More detail on how pagination works within the API can be found here https://developer.cisco.com/meraki/api-v1/#!pagination/how-does-pagination-work-in-the-dashboard-api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That retrieves the first "page" of 1,000 entries. Then you call it again with the startingAfter/endingBefore parameters.
https://developer.cisco.com/meraki/api-v1/#!get-network-sm-devices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the information. But I don't understand from where I can get this token to do the filter.
For example in my network I have 2000 clients, so how do I define the filter to see all the devices if the perPage option has a limitation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Limiting the number of items returned in an API is normal, and common, as otherwise you could end up making a call that takes a long time to process, and returns a huge amount of data. The most you can return in this instance is 1,000 devices, and then you have to make a second call, with appropriate pagination details, to get the next 1,000 and so on.
More detail on how pagination works within the API can be found here https://developer.cisco.com/meraki/api-v1/#!pagination/how-does-pagination-work-in-the-dashboard-api
