Need way to get MAC's of clients CURRENTLY connected to network. (Seeing 4 hr old results currently)

SOLVED
Andrewbluepiano
Getting noticed

Need way to get MAC's of clients CURRENTLY connected to network. (Seeing 4 hr old results currently)

Currently doing the call below, but getting results with MAC addresses of clients that have been disconnected from the network for hours. Is there another call, or better way to do this? Ideally would want to see only devices currently actively connected to the network, but realistically if it was a reasonable timeframe of error, like a few minutes, I would be fine with that. 

 

 

wificlientsget = requests.get(

                    'https://api.meraki.com/api/v0/networks/networkID/clients',

                    headers={'x-cisco-meraki-api-key': apikey, 'Accept': 'application/json'}

                )

1 ACCEPTED SOLUTION
BrechtSchamp
Kind of a big deal

Well that call is showing clients that have used the network in the specified time interval. But if you don't specify a timespan yourself it defaults to 1 day, so it's showing you the users that have used the network in the last day. Try specifying a timespan that suits you. It's a value in seconds.

 

In each of the results there's also a field called "status" that'll show "online" or "offline". So you could also use a large interval but filter out all the results that state "offline".

 

E.g.

image.png

 

View solution in original post

3 REPLIES 3
BrechtSchamp
Kind of a big deal

Well that call is showing clients that have used the network in the specified time interval. But if you don't specify a timespan yourself it defaults to 1 day, so it's showing you the users that have used the network in the last day. Try specifying a timespan that suits you. It's a value in seconds.

 

In each of the results there's also a field called "status" that'll show "online" or "offline". So you could also use a large interval but filter out all the results that state "offline".

 

E.g.

image.png

 

Thank you!!

 

Thats the route I was thinking I would need to take, but I was looking at the t0 param, and couldn't figure out how to format it. Didn't even notice the timespan one. Also didn't realize the status field existed 😆. Thanks for the help!!

 

Out of curiosity, what site is that documentation under from the SS you posted? Haven't seen that before. 

It's a screenshot from postman. Have a look here to set it up to make your Meraki API life easier:

https://developer.cisco.com/meraki/build/meraki-postman-collection-getting-started/

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.