04-16-2017 05:58 PM - edited 03-01-2019 03:42 AM
Trying to get a list of devices through the Meraki dashboard API, however the list returns a 200 return code but no items. If I go into the dashboard website I see devices. What am I doing wrong? I'm doing:
To get Organization code:
curl -L -H 'X-Cisco-Meraki-API-Key: <myKey>' -X GET -H 'Content-Type: application/json' 'https://dashboard.meraki.com/api/v0/organizations'
To get list of Networks ID's:
curl -L -H 'X-Cisco-Meraki-API-Key: <myKey>' -X GET -H 'Content-Type: application/json' 'https://dashboard.meraki.com/api/v0/organizations/<myOrgID>/networks'
To prove the correct Network ID:
curl -L -H 'X-Cisco-Meraki-API-Key: <key>' -X GET -H 'Content-Type: application/json' 'https://dashboard.meraki.com/api/v0/organizations/<myOrgID>/networks/<myNetworkID>'
and this correctly displays the network details
To get device list from this network:
curl -L -H 'X-Cisco-Meraki-API-Key: <myKey>' -X GET -H 'Content-Type: application/json' 'https://dashboard.meraki.com/api/v0/networks/<myNetworkID>/devices'
However this comes back with no entries and a 200 return code.
Thanks for any help.
Solved! Go to Solution.
06-29-2017 04:33 PM
Michael,
I believe that API endpoint only returns a list of *Meraki* devices within a network (switches, firewalls, APs, etc). If the network is *only* used for Systems Manager, then there are no Meraki devices and thus an empty list is returned.
Per the API, it looks like the endpoint you probably want is:
/networks/[network_id]/sm/devices
In the API docs, look under the "SM" heading
04-17-2017 02:32 PM
Tony,
I copied and pasted your curl statements and added my API key, but I saw no issues. I suggest trying with Postman (getpostman.com) just to check. If you still have a problem, please report it to the Meraki support team.
https://meraki.cisco.com/support/
Thanks,
Colin
06-13-2017 04:08 AM
I have the same issue. When i try to load the list of devices, i get a 200 but an empty list. Response: []
Im able to read organizations and groups, but not the devices for a group.
i can not see what wrong, because if a change the group id to an invalid value, i get a 404 as expected.
Reading the network is no problem:
Reading devices fails:
On the console, i can see an active device:
06-29-2017 04:33 PM
Michael,
I believe that API endpoint only returns a list of *Meraki* devices within a network (switches, firewalls, APs, etc). If the network is *only* used for Systems Manager, then there are no Meraki devices and thus an empty list is returned.
Per the API, it looks like the endpoint you probably want is:
/networks/[network_id]/sm/devices
In the API docs, look under the "SM" heading
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: