cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4707
Views
1
Helpful
3
Replies

Limited search

Kenneth_rf
Community Member

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

1 Accepted Solution

Accepted Solutions

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

View solution in original post

3 Replies 3

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

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

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

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