Problem with Postman and Meraki API

AlexG7
Here to help

Problem with Postman and Meraki API

Hi team,

 

I'm a bit new with API,

followed tutorials and doco's but got stuck.

The Meraki collection I imported and environment (variables I have set) didn't work for me, all GET requests I made that way, ended with error 404.

However, if I manipulated the headers and the region server, no authorization

, the old way (tutorials 2 years old) that seemed to work and I got the orgs, networks etc.

I'm running the latest Postman (v7.12.0), collections I have downloaded few days ago, got variables in the Environment reviewed by my Peer (who used an older Postman version with success) and we still couldn't figure out why I couldn't use it the proper way...

 

Any hints or suggestions?

Thanks in advance!

 

collection 1.PNGCollection 2.PNGmanual.png

2 REPLIES 2
BrechtSchamp
Kind of a big deal

I think there was probably something wrong with the way you setup postman. The simplest endpoint to test your postman setup is the getOrganizations one:

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

 

Always start with that one to do your tests.

 

The only things that that endpoint needs are the API key to be setup correctly, and that postman can reach the cloud (proxies could be blocking it for example).

 

There's two ways to setup the API key.

 

  1. The first one is by right clicking the collection, clicking Edit. Go to the Variables tab and fill in X-Cisco-Meraki-API-Key with your key.

    image.png

    The reason this works is because the Authorization tab has a placeholder {{X-Cisco-Meraki-API-Key}} to be filled in with a variable:


    image.png
  2. The second one is setting up an environment variable instead of a collection variable. To do that click the gear icon in the top right of postman and click Add. Give your environment a name (I have two, one for the Meraki account linked to my professional email address and one linked to my private email address). And fill in the variables as shown the example here:

    image.png

    After you've created the environment, don't forget to select it:


    image.png

Now you should be able to succesfully use the getOrganizations endpoint. If not, then something is wrong still, in which case, let us know.

 

The advantage of the second way is that you can have multiple environments, each with their own API key. For me that's useful, because some of my networks I can only access from my personal account, others only from my professional account.

 

Hi BrechtSchamp,

thanks for the response,

I've tried both of the things didn't work for me.

Apparently, I've set up the environment first.

However, I've set up variables as in point 1 as well, but that didn't give me any joy either...

Anything else I should check?

Thanks!

Alex

 

Get notified when there are additional replies to this discussion.