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.
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.
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.
Comments
0 comments
Please sign in to leave a comment.