Use API to get device public IPs from System Manager

Solved
Michael-873494
Here to help

Use API to get device public IPs from System Manager

Is it possible to get the public IPs of devices?

All I see in the return is: id, name, tags, ssid, wifiMac, osName, systemModel, uuid, serialNumber, hasChromeMdm, and location.

 

I noticed I can get the lan IP if I add the query string to the end of the URL fields=ip. But putting "publicip" or "publicIp" gets me nothing.

 

So, I also tried querying individual devices using "/networks/{networkId}/devices/{serial}" (assuming "serial" is the serial number, since Merak's documentation doesn't specify/sucks, but I get a page not found message when I try. I also tried using the id (since the network uses the id, I thought maybe devices would too) instead of the serial number but that rendered the same result.

1 Accepted Solution
SoCalRacer
Kind of a big deal

Kind of interested why you want the public IP of a mobile device, assuming alot of them will be carrier Public IPs.

 

This link below shows the additional field included public IP.

https://dashboard.meraki.com/api_docs#list-the-devices-enrolled-in-an-sm-network-with-various-specif...

View solution in original post

3 Replies 3
PhilipDAth
Kind of a big deal
Kind of a big deal

I can't see any fields in the API that relate to the public IP address.  So I don't think you'll be able to get this information.

https://dashboard.meraki.com/api_docs#list-the-devices-enrolled-in-an-sm-network-with-various-specif...

SoCalRacer
Kind of a big deal

Kind of interested why you want the public IP of a mobile device, assuming alot of them will be carrier Public IPs.

 

This link below shows the additional field included public IP.

https://dashboard.meraki.com/api_docs#list-the-devices-enrolled-in-an-sm-network-with-various-specif...

Michael-873494
Here to help

@SoCalRacer  Thank you. I tried publicIp as listed in that doc, but it won't give it, so I assume it won't work because Meraki's API does not function as documented. I'm amending the previous statement, because today it is giving me the public IPs. I'm pretty sure nothing is different from yesterday (I don't believe I changed anything about the query), but it's working now so... I'm not complaining too much, we don't pay for it, but this is one of the reasons why we've stuck with the free licences. 

 

Regarding your other comment, we need them so we can exclude "internal" traffic from our CMS's analytics. There are only a couple ways to exclude traffic with this particular CMS, browser agent and IP. Obviously, we can't use browser agent... All employees are remote, hence the need to collect the IPs of everyone in the company.

 

@PhilipDAth  Actually it is in the list, you must have overlooked it? 

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.
Labels