Query on "API calls to Meraki demo environment"

Solved
Mohanraj
New here

Query on "API calls to Meraki demo environment"

Hello,

 

Starting to explore how Meraki API works, so launched a meraki demo environment to test it.

 

Below are my network dashboard on demo environment

demo-dash.JPG

 

1. The data we need to fetch via API for each networks are  Devices, Firmware status & Offline devices etc

 

But when I used below API call, above needed infos are missing.

https://api.meraki.com/api/v0/organizations/<org-id>/networks/ 

 

Response:

{
"id": "net-id",
"organizationId": "org-id",
"name": "Live Demo - University Wireless",
"timeZone": "America/Los_Angeles",
"tags": null,
"productTypes": [
"wireless"
],
"type": "wireless",
"disableMyMerakiCom": false,
"disableRemoteStatusPage": true
},

 

 

2. Also when tried to get firmware status of each device via API, it gives different response than to whats displayed in dashboard.

 

Below is the firmware detail of a device in "Live Demo -  Switches" network in dashboard.

firmware.JPG

 

Used below API to fetch the firmware details of the same device, firmware details fetched via API not matches with what showed in dashboard as above.

https://api.meraki.com/api/v0/organizations/<org-id>/networks/<net-id>/devices/<device-serial-num>

 

{
"lat": ,
"lng": ,
"address": null,
"serial": "",
"mac": "",
"lanIp": null,
"networkId": "",
"name": "Office POE switch #3",
"model": "MS22P",
"switchProfileId": null,
"firmware": "Not running configured version",
"floorPlanId": null
}
 
Is the API call used are correct? or the data fetched via demo environment are limited.
 
Thanks,
Mohan
1 Accepted Solution
jdsilva
Kind of a big deal

Hey @Mohanraj 

 

Some of what you want might require a couple steps. 

 

>> 1. The data we need to fetch via API for each networks are  Devices, Firmware status & Offline devices etc

 

You listed the Networks endpoint, which only gets info about networks, not devices. To get the devices in a network you want this:

 

https://api.meraki.com/api_docs#list-the-devices-in-a-network

 

But to get the status you will need this:

 

https://api.meraki.com/api_docs#list-the-status-of-every-meraki-device-in-the-organization

 

You can use the networkId field to collate these and get what you're after.

 

 >>2. Also when tried to get firmware status of each device via API, it gives different response than to whats displayed in dashboard.

 

What you're seeing here means that the device(s) are "pinned" by support to a different firmware level than what the network is set to. This doesn't usually happen unless support has a reason to do so, and in the case of this Demo network who knows what they're doing behind the scenes. In normal network this should actually match what the network is set to. 

 

View solution in original post

3 Replies 3
jdsilva
Kind of a big deal

Hey @Mohanraj 

 

Some of what you want might require a couple steps. 

 

>> 1. The data we need to fetch via API for each networks are  Devices, Firmware status & Offline devices etc

 

You listed the Networks endpoint, which only gets info about networks, not devices. To get the devices in a network you want this:

 

https://api.meraki.com/api_docs#list-the-devices-in-a-network

 

But to get the status you will need this:

 

https://api.meraki.com/api_docs#list-the-status-of-every-meraki-device-in-the-organization

 

You can use the networkId field to collate these and get what you're after.

 

 >>2. Also when tried to get firmware status of each device via API, it gives different response than to whats displayed in dashboard.

 

What you're seeing here means that the device(s) are "pinned" by support to a different firmware level than what the network is set to. This doesn't usually happen unless support has a reason to do so, and in the case of this Demo network who knows what they're doing behind the scenes. In normal network this should actually match what the network is set to. 

 

Mohanraj
New here

Thanks jdsilva for the response. will check with real device.
seanmathias
Here to help

I am not so sure about that, or at least I don't know if that is a complete answer.  It may be that is the case when support pins a device to a specific firmware version, but I am getting this response from multiple devices that are new out of the box and have never had intervention by support.

 

It would also be nice if the /organizations/{organizationId}/devices endpoint was consistent in what it returns for the firmware field.  Sometimes it returns the firmware release, which is expected, other times it returns this status message.  I would say from a usability perspective it should just return the running firmware release.

 

@Meraki - Any insight would be appreciated!

Get notified when there are additional replies to this discussion.