GET Client list via API

Solved
ds2020
Here to help

GET Client list via API

So I'm using Postman and crafted a GET request to get the clients from a specific network id. Looking at the results I see 10 entries vs 150 on the actual dashboard. Any reason why this is?

1 Accepted Solution
jdsilva
Kind of a big deal

I'm not familiar enough with Postman to really help you with that specifically, but if you only have 150 clients in your network then it's probably easier for you to set the 'perPage' value in your request to the max (1000) and not worry about dealing with multiple pages of clients. 

 

Check the documentation for this API call as it defines the requests parameters (including perPage). Set that parameter in your Postman request and you should be good to go.

 

https://developer.cisco.com/meraki/api-v1/#!get-network-clients

 

image.png

View solution in original post

7 Replies 7
jdsilva
Kind of a big deal

If I was to guess it's because you're either not setting the 'perPage' value to something greater than 10 (default is 10), or you're not fetching the 'links.next.url' returned in the headers of the first (and subsequent) requests you're making. 

 

 

ds2020
Here to help

@jdsilva how can I correct this? This info is not described in any of the documents I've looks so far.

jdsilva
Kind of a big deal

I'm not familiar enough with Postman to really help you with that specifically, but if you only have 150 clients in your network then it's probably easier for you to set the 'perPage' value in your request to the max (1000) and not worry about dealing with multiple pages of clients. 

 

Check the documentation for this API call as it defines the requests parameters (including perPage). Set that parameter in your Postman request and you should be good to go.

 

https://developer.cisco.com/meraki/api-v1/#!get-network-clients

 

image.png

ds2020
Here to help

@jdsilva cool! Thank worked. Onto the next thing now.

jdsilva
Kind of a big deal

Good stuff! 

 

Just remember that when you start dealing with networks over 1000 clients you're going to have to revisit this and figure out how to fetch the 'next' page to get the remaining clients. The next URL is returned in the headers of your first request, so you have to get that URL, and then make a GET to it. The next URL will be populated as long as there are more clients to be returned. When you've got them all the next URL value will be NULL.

 

 

ds2020
Here to help

@jdsilva  thanks for the heads up! This scenario might not be an issue since we have over 100 networks so few clients connect to each at a time. I will need to figure out though how to make my request more specific since now i get all 150 clients. Need to figure out how to get a specific client based on its mac or IP address. Since this is what I'm trying to accomplish.

 

Boundless
Getting noticed

Hi,

 

We have built a monitoring tool to get an aggregate visibility on all the clients from an organization. You can then use the filter feature for more granularity: https://www.youtube.com/watch?v=M4nfZ5RJYNo&list=PLBTpmzKn9iG6dVMBrnxX6Ss8i-o0MgPXJ&index=2

 

Let me know if it would be helpful.

 

Best,

Ned

Noel-Edouard Chenu
Get notified when there are additional replies to this discussion.