cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get list of devices

SOLVED
Highlighted
MW3
Here to help

Cannot get list of devices

Hi,

 

Im trying to implement the api, I can get everything else such as list of Orgs, admins within an Org, however cant get list of devices as it returns empty even though there are devices visible on the dashboard.

So, this is working with same header (X-Cisco-Meraki-API-Key):

{{baseUrl}}/organizations/{Org-ID}/admins

 

But these are not even though the header x-cisco is the same:

{{baseUrl}}/organizations/{Org-ID}/inventory
{{baseUrl}}/organizations/{Org-ID}/deviceStatuses
{{baseUrl}}/organizations/{Org-ID}/devices

.

.


So what am I missing?
Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
MW3
Here to help

Re: Cannot get list of devices

Ok guys thank you so much for the help, ive figured it out using good ol google search..
https://community.cisco.com/t5/mobility-discussions/meraki-dashboard-api-confusion/m-p/3458242

Took 3 days to figure it out and thats mainly because none of the super extensive guides mentions that there is a difference between "meraki" devices and "system Manager" devices!!

https://documentation.meraki.com/zGeneral_Administration/Other_Topics/The_Cisco_Meraki_Dashboard_API
https://developer.cisco.com/meraki/build/meraki-postman-collection-getting-started/

While the only place there is something `SM` has over 500 links on the menu.. you wouldnt expect me to go though all of them to figure it out!

https://documenter.getpostman.com/view/897512/meraki-dashboard-api/2To9xm?version=latest#intro

But anyway, thanks a lot for looking into it.. really appreciated, you guys are awesome Smiley Happy

16 REPLIES 16
Head in the Cloud

Re: Cannot get list of devices

Within Postman, its written like this and working:

 

{{baseUrl}}/organizations/{{organizationId}}/deviceStatuses

Same with the others in your list

 

2019-08-02 09_44_37-Postman.png

MW3
Here to help

Re: Cannot get list of devices

Thanks for the reply. So when I say `{Org-ID}` I mean I manually put in the org id myself. So its a placeholder just to explain the issue. And also note its working for `admins` endpoint!.
MW3
Here to help

Re: Cannot get list of devices

image.png

Here.. see?

Head in the Cloud

Re: Cannot get list of devices

Are you sure you are in the correct envirement and the correct Organization ID? Maybe you have got more than one (orgs / envirements)?

 

as Postman is not giving any error message and just not giving back any data this may be a problem.

MW3
Here to help

Re: Cannot get list of devices

If there was a prob, it wouldnt get me `admins` and a lot of other things Smiley Happy
MW3
Here to help

Re: Cannot get list of devices

{{baseUrl}}/organizations/{{organizationId}}/admins
So this works perfectly
Head in the Cloud

Re: Cannot get list of devices


@MW3 wrote:
If there was a prob, it wouldnt get me `admins` and a lot of other things Smiley Happy

nope, as if you have more Organizations in your dashboard and an empty one it would still show you the admins, but no output on devices... Smiley Wink

 

API is allowed in dashboard? I am sure but just want to ask... Smiley Wink Org - settings - Dashboard API access

 

How did you get your Org ID? Postman?

{{baseUrl}}/organizations

correct base Url? https://api.meraki.com/api/v0

MW3
Here to help

Re: Cannot get list of devices

hmm

1) Ive got devices in the dashboard for the orga. Also I tried other org it always return the same.

2) I got the list of orgs by calling this:
{{baseUrl}}/organizations

3) I can assure you I dont have multiple or wrong org id in the environment.

MW3
Here to help

Re: Cannot get list of devices

and also,

4) Yes the baseurl is correct
5) Ive granted access to the api. Also I deleted the access key 3 times and generated new ones just in case.

Smiley Happy
MW3
Here to help

Re: Cannot get list of devices

image.png

Head in the Cloud

Re: Cannot get list of devices

mmmhh... 

I am out Smiley Very Happy Smiley Sad Sorry...

 

maybe the Pros need to take a look... @BrechtSchamp @NolanHerring @AjitKumar @jdsilva @PhilipDAth for example

Kind of a big deal

Re: Cannot get list of devices

The account from which you're using the API key, what usage rights does it have? Check in Organization > Administrators

 

2019-08-02 11_07_43-Clipboard.png

Meraki Employee

Re: Cannot get list of devices

@MW3 What is your output if you run this command directly?

 

curl -L -H 'X-Cisco-Meraki-API-Key: <key>' -H 'Content-Type: application/json' -X GET 'https://api.meraki.com/api/v0/organizations/{organizationId}/devices'

Please replace "<key>" with your API Key (don't include '<>') and replace "{organizationId}" with your Org ID (don't include '{}')

 

Please share the output and we will see what the issue is

MW3
Here to help

Re: Cannot get list of devices

Hi,

 

Yea account has full access to the network.

MW3
Here to help

Re: Cannot get list of devices

image.png

MW3
Here to help

Re: Cannot get list of devices

Ok guys thank you so much for the help, ive figured it out using good ol google search..
https://community.cisco.com/t5/mobility-discussions/meraki-dashboard-api-confusion/m-p/3458242

Took 3 days to figure it out and thats mainly because none of the super extensive guides mentions that there is a difference between "meraki" devices and "system Manager" devices!!

https://documentation.meraki.com/zGeneral_Administration/Other_Topics/The_Cisco_Meraki_Dashboard_API
https://developer.cisco.com/meraki/build/meraki-postman-collection-getting-started/

While the only place there is something `SM` has over 500 links on the menu.. you wouldnt expect me to go though all of them to figure it out!

https://documenter.getpostman.com/view/897512/meraki-dashboard-api/2To9xm?version=latest#intro

But anyway, thanks a lot for looking into it.. really appreciated, you guys are awesome Smiley Happy

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.