cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6665
Views
0
Helpful
7
Replies

meraki.DashboardAPI and pagination

JM2024
Community Member

Hi,
I am using the Python meraki.DashboardAPI and trying to read all policy objects of an organization.

Unfortunately I get "only" 5000 Objects back.
How can I do pagination with the merakiDashboardAPI?

Is there somewhere an examples?

Here is the code:

organizationPolicyObjects = dashboard.organizations.getOrganizationPolicyObjects(organizationId=orgID)

Thanks

Juergen

7 Replies 7

aleabrahao
Meraki Community All-Star
Meraki Community All-Star

Check it out.

Pagination - Meraki Dashboard API v1 - Cisco Meraki Developer Hub

I am not a Cisco 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.

I already tried this:

organizationPolicyObjects = dashboard.organizations.getOrganizationPolicyObjects(total_pages="all", perPage=1000, organizationId=orgID)
Unfortunately I get only 1000 objects back. It seems that "total_pages" is not working.

aleabrahao
Meraki Community All-Star
Meraki Community All-Star

That's the maximum number of entries you'll be able to obtain, I think you'll have to store it in a CSV.

Take a look at this.

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

I am not a Cisco 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.

Hi, thankyou for your answer.
This is using the standard REST-Meraki API. I think, that this will work.
I would like to use the meraki python library.

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

What happens if you use:

response = dashboard.organizations.getOrganizationPolicyObjects(
    organization_id, total_pages='all'
)

I took this from the example in the documentation:
https://developer.cisco.com/meraki/api-v1/get-organization-policy-objects/

JM2024
Community Member

So the main reason seems to be, that the Meraki-API does not work as usual when doing the API-call.
In the HTML-response is no "Link: xxxxx" added.
That´s maybe the reason, that the MerakiDashboardPythonLib is not working properly.
For me this is a bug. I opened a ticket for it.

Hey man, I know this thread is old, did you ever happen to figure this out? I am having the same issue with getting Policy Objects over 5000 (unable to paginate basically)