02-23-2024 11:20 AM
Hi All,
I'm wondering why there's so much inconsistency with the APIs that return a device:
org/device/statues:
{
"name": "Meraki_MX65",
"serial": "xxxxxxx",
"mac": "",
"publicIp": "",
"networkId": "",
"status": "online",
"lastReportedAt": "2024-02-23T19:01:18.054000Z",
"productType": "appliance",
"components": { "powerSupplies": [] },
"model": "MX65",
"tags": [],
"usingCellularFailover": false,
"wan1Ip": "",
"wan1Gateway": "",
"wan1IpType": "dhcp",
"wan1PrimaryDns": "",
"wan1SecondaryDns": "",
"wan2Ip": null
},
org/devices:
{
"name": "Meraki_MX65",
"serial": "xxxxx",
"mac": "",
"networkId": "",
"productType": "appliance",
"model": "MX65",
"address": "",
"lat": 37.3644,
"lng": -121.91518,
"notes": "",
"tags": [],
"wan1Ip": "",
"wan2Ip": null,
"configurationUpdatedAt": "2024-01-02T12:20:08Z",
"firmware": "wired-18-1-07",
"url": "https://n27.meraki.com/lab-net-firewall/n/1puaKcB/manage/nodes/new_list/247165638139553",
"details": []
},
network/devices:
{
"lat": 37.3644,
"lng": -121.91518,
"address": "",
"serial": "xxxxxxxx",
"mac": "",
"wan1Ip": "",
"wan2Ip": null,
"url": "https://n27.meraki.com/lab-net-firewall/n/1puaKcB/manage/nodes/new_list/247165638139553",
"networkId": "",
"tags": [],
"name": "Meraki_MX65",
"details": [],
"model": "MX65",
"firmware": "wired-18-1-07",
"floorPlanId": null
}
If I wanted to filter using Network ID and get all the devices under that network, you'll notice there's a bunch of attributes missing from the other two APIs (using Org Id). Is there a reason why all the JSON output is so different?
Thanks in advance,
-Jerome
02-23-2024 11:33 AM
02-23-2024 11:45 AM
@alessandrodematosThanks removed both serial and network id
02-23-2024 11:36 AM
If you need organization-wide information or real-time status information, you would need to use the org/devices or org/device/statuses APIs respectively.
02-23-2024 11:49 AM
@alessandrodematos- Yeah I get that. However, there's attributes that we need at the Org level that missing in the network level. As I mentioned, if I have an App that wants to filter devices using network ID, then the devices returned is missing information needed.
02-23-2024 11:59 AM
Well you can try calling the network/devices endpoint with the Network ID to get the list of devices in the network and for each device, call the org/devices endpoint with the Org ID and the device’s serial number to get the additional attributes.
It's just an attempt, I don't know if it will work.
02-26-2024 07:54 AM
@alessandrodematos- Well doesn't that defeat the purpose here? If APIs are provide to get devices from a different hierarchy, why not just give the same device info? Why do I have to call two APIs when I can just use one at the network level? Honestly, I could just call the one API (org/device/statues) and I'd be done. However, if you're providing an API to get device info at the network level why give different output?
02-26-2024 08:23 AM
Oh, this is something you have to question Meraki about.
02-25-2024 10:55 PM
In general, I don’t see inconsistencies in the data provided from the different endpoints. All the data seems to match.
As for which attributes are present in which endpoints, I can not say.
If you want something specific to be added, your best bet is to log it in “Make a wish” and perhaps open a ticket with Meraki support and have it logged as a feature enhancement, preferably with a use case and business case.
Then you’ll have to hope for it to be added in the future.
02-26-2024 07:46 AM
@Rasmus Hoffmann Birkelund- Here's what are the attributes missing from the output:
1. public IP (in org/device/statuses, missing in org/devices and network/devices)
2. wan gateway (in org/device/statuses, missing in org/devices and network/devices)
3. dns entries (in org/device/statuses, missing in org/devices and network/devices)
Sure I can file "Make a wish" and also open a case. However, it's been my experience that these types of request aren't top priority. I'm just trying to understand if an API is provided to get devices why can't they just be all the same?
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