08-22-2023 10:37 AM
I'm having issues getting all the results when running API calls when I run them via the developer site and Postman. When I run "Get Organization Devices" its not displaying all devices (2100+). I tried the per-page param to 50 (max) and I'm still missing data. Any suggestions?
08-22-2023 10:46 AM
The call https://developer.cisco.com/meraki/api-v1/get-organization-devices/ has a default (and maximum) per-page limit of 1,000. If you set it to 50 you'll only get 50 per page.
If there are more devices than will fit onto the page, you need to make further calls (following the pagination handling rules) to get the remaining page(s) of data.
With 2,100 devices it'll be at least 3 pages of data.
If you use the Python library it can handle pagination for you, otherwise you'd need to arrange it yourself.
Python library: https://github.com/meraki/dashboard-api-python
Pagination: https://developer.cisco.com/meraki/api-v1/pagination/
08-22-2023 11:29 AM
Thanks for the quick reply sungod.
I looked into the Pagination but the only 2 categories it shows for the startingafter parameter are "Timestamps" and "Interger IDs". The endpoint is showing that its looking for a string. Any idea what they're looking for?
08-22-2023 11:53 AM
The values needed to navigate subsequent pages are in the link headers returned by the call.
It's explained in the documentation page I linked, look at the 'Example' section.
I.e. you need to select/parse the link headers, or take the easy way out and just use the Python Library 😀
08-22-2023 01:32 PM
I'm sure once it would be easier once I figure out Python Library (which I never used before). I'm getting SSL errors when trying to run it with Python.
08-22-2023 01:39 PM
As a tip, I've found Google Bard good at writing Python scripts to use the Meraki API. I'm now at the point where if I need to create something, I start with Google Bard and take it from there. It's just a faster way to develop.
08-23-2023 07:13 AM
If you are running on Windows and getting SSL problems this thread might help...
https://community.meraki.com/t5/Developers-APIs/SSL-error-in-python/m-p/186146
I don't use it on Windows, but others do, so probably someone else can help you if the above thread doesn't resolve it.
08-28-2023 09:00 AM
I appreciate everyone's response to this thread.
I tried the link you sent over sungod, I did the following and I'm still getting a cert error:
- exported the cert from the portal and saved it locally
- ran the verify command (verify="c:\temp\nameofcert.crt")
I even tried verify=False which still gave me the same SSL Cert error.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide