Need help with Meraki Network devices End point pagination

Indirakumar
New here

Need help with Meraki Network devices End point pagination

Hi,

 

I am Indirakumar, I work in ServiceNow as developer, I have a requirement to pull all the network devices from meraki. We have 816 devices and it is growing in meraki. I used the below link in the postman to do testing.

 

https://api.meraki.com/api/v1/organizations/orgID/devices/statuses

 

Under the header I got the below the below paginated links, then i understood by default 1000 devices are allowed during REST api calls. 

 

<https://api.meraki.com/api/v1/organizations/orgID/devices/statuses?perPage=1000&startingAfter=0000-0000-0000>; rel=first, <https://api.meraki.com/api/v1/organizations/orgID/devices/statuses?endingBefore=ZZZZ-ZZZZ-ZZZZ&perPage=1000>; rel=last

 

Then we planned to paginate the REST calls by trying out the below link,

 

https://api.meraki.com/api/v1/organizations/orgID/devices/statuses?perPage=500&startingAfter=0; rel=first

 

But, it brought only 500 devices, it did not iterate to bring all the devices.

 

Please help me understand how exactly should the end points to be modifed to have a proper pagination, because the network device counts are increasing day by day.

 

Regards,

Indirakumar

1 Reply 1
alemabrahao
Kind of a big deal
Kind of a big deal

Check it out.

 

https://community.meraki.com/t5/Developers-APIs/Python-pagination-get-8000-devices/m-p/101593

I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.
Get notified when there are additional replies to this discussion.