Organizations -> Devices Length Limit for URI?

Chris-Bergin
Comes here often

Organizations -> Devices Length Limit for URI?

The /organizations/:organizationId/devices endpoint provides a number of parameters.  I'd like to use this endpoint to request a certain set of devices by passing a list of serial numbers.

 

What is the URI length limit so that I can detect when I've got too many to pass in a single call and split the list up into multiple calls?

5 Replies 5
alemabrahao
Kind of a big deal
Kind of a big deal

The URI length limit is not explicitly stated in the Meraki API documentation, but the Meraki API is set to allow 10 API calls every second.

 

 

https://developer.cisco.com/meraki/api-v1/rate-limit/#per-organization

 

https://developer.cisco.com/meraki/api-v1/introduction/#whats-new-in-v1

 

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

Hi ,

 

Without knowing the end goal , it would probably be faster and more efficient to get All the devices without filtering , and do the filtering of the data in python ( or whatever language you are using )

Chris-Bergin
Comes here often

That's what I'm doing now.  It seemed wasteful to return everything when I know that I will only retain about 1/3 of them, but if I would have to make 20 API calls to get just the ones that I want, that would definitely be slower.  I was hoping that maybe Meraki had a sufficiently generous URI limit to keep it to just a couple calls at most.

PhilipDAth
Kind of a big deal
Kind of a big deal

This is the API (for anyone else interested):
https://developer.cisco.com/meraki/api-v1/get-organization-devices/

 

I don't know the URI maximum length, but I would be tempted to create batches of (say) 10 serial numbers at a time - and request a "batch full".

Jamieinbox
Building a reputation

I have a script that uses this API (a couple variations). Free to nab.

Merakicode/APs&Ser_PerNetwork at main · jadexing/Merakicode (github.com)

Get notified when there are additional replies to this discussion.