cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Limited search

SOLVED
Here to help

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

1 ACCEPTED SOLUTION

Accepted Solutions
Head in the Cloud

Re: Limited search

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
Kind of a big deal

Re: Limited search

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 

Here to help

Re: Limited search

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

 

Head in the Cloud

Re: Limited search

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

Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.