cancel
Showing results for 
Search instead for 
Did you mean: 

New To Using API

SOLVED
Here to help

New To Using API

Hey Everyone!

Complete newb, and new to using API's.  Using Postman, and made it through the Meraki lab pretty decently; however, to run commands against our organizations, networks, etc. what is the proper URL for the GET command?  I have the OrgID, and tried using basic Auth, but I still receive 404 Error message?

1 ACCEPTED SOLUTION

Accepted Solutions
Head in the Cloud

Re: New To Using API

That doesn't look right. Key should be "X-Cisco-Meraki-API-Key".

15 REPLIES
Kind of a big deal

Re: New To Using API

My preferred method is to test a query in postman.  Once I'm getting the desired result I then click the small orange 'Code' link in the top right of postman and it'll bring up a box.  Then you can click the drop-down and select the language you want to use (HTTP, Python, PHP, Java, etc...) and it'll generate a code snippet for you to use.

 

Capture.PNG

Adam R MS | CISSP, CISM, VCP, MCITP, CCNP, ITILv3, CMNO
If this was helpful click the Kudo button below
If my reply solved your issue, please mark it as a solution.
Here to help

Re: New To Using API

I appreciate the tip, but still having trouble accessing our organizations, and networks.  No matter what I enter, I'm constantly returning a 404.  Should I be using https://dashboard.meraki.com/api/v0 or https://api.meraki.com/api/v0?  This is where my hangup is.

Building a reputation

Re: New To Using API

Based on the documentation I would say you need to use the https://api.meraki.com/api/v0?  address.

 

https://documentation.meraki.com/zGeneral_Administration/Other_Topics/The_Cisco_Meraki_Dashboard_API

 

Actually this is even better documentation on how to get setup to use the API.

 

https://create.meraki.io/build/meraki-postman-collection-getting-started/

Found this helpful? Give me some Kudos! (click on the little up-arrow below)
Head in the Cloud

Re: New To Using API

I'll throw this out there too just in case it's relevant.

 

https://documentation.meraki.com/zGeneral_Administration/Other_Topics/The_Cisco_Meraki_Dashboard_API...

 

404: Not found- No such URL, or you don't have access to the API or organization at all

 

If you're getting a 404 you may have the correct URL but you may not be using the correct API key, or you're sending it incorrectly. If you are using  https://api.meraki.com/api/v0? and still getting a 404 then check this.

Getting noticed

Re: New To Using API

I believe you need to verify that you have the API enabled in the organization and that you are using the correct API key.  I've seen both of these give 404 errors with the API.

Here to help

Re: New To Using API

I have full access administrative privileges, so I know that's not the issue.  I'm using the following GET string:

https://api.meraki.com/api/v0/organizations

 

Headers:

Key: x-api-key

Value:  <my api key>

Key: Content-Type

Value: application/json

 

Authorization is set to: inherit auth from parent

I'm wondering if this needs to be changed to Basic Auth and enter my username & password, but when I do that, there's no change in the output.

Head in the Cloud

Re: New To Using API

That doesn't look right. Key should be "X-Cisco-Meraki-API-Key".

Here to help

Re: New To Using API

And that was the issue!!  

Getting noticed

Re: New To Using API

Auth should be "no auth" - at least that's what I use. 

 

Just because you have full admin privilege, doesn't mean you have API access.  You have to enable that separately under Organization->Settings, I believe.

Head in the Cloud

Re: New To Using API

Woohoo!

Kind of a big deal

Re: New To Using API

Good eye @jdsilva

 

My original screenshot had the right variables for reference as well. The only things I changed was the xxx for security. 

Adam R MS | CISSP, CISM, VCP, MCITP, CCNP, ITILv3, CMNO
If this was helpful click the Kudo button below
If my reply solved your issue, please mark it as a solution.
Head in the Cloud

Re: New To Using API

@Adam thanks dude. I got lucky there. I've been trying to learn myself some Python this week and it was just Monday I was playing around with the API a bit. Last week I never would known that Smiley Happy

Kind of a big deal

Re: New To Using API


@jdsilva wrote:

@Adam thanks dude. I got lucky there. I've been trying to learn myself some Python this week and it was just Monday I was playing around with the API a bit. Last week I never would known that Smiley Happy


Agreed, making better use of the API stuff has been looming on my todo list for a while now.  I'd like to build some internal dashboards to monitor network uplink status, WAN IPs, highest traffic clients in a short time period, offline devices etc.  

Adam R MS | CISSP, CISM, VCP, MCITP, CCNP, ITILv3, CMNO
If this was helpful click the Kudo button below
If my reply solved your issue, please mark it as a solution.
Here to help

Re: New To Using API

That is my goal as well, and now that I have API access I can start playing around.  I plan on moving away from Postman and utilizing PS instead.

Just browsing

Re: New To Using API

I have tried all the javascript code snippets from postman but still not working yet i get a good result from postman software itself. I have actually written my entire codes in javascript hence would not like to switch to any other language. Is there any help