CiscoDevNet / devnet-express-meraki-issues

0 stars 0 forks source link

Postman Setup API variable missing detailed description #13

Open pheilmei opened 2 years ago

pheilmei commented 2 years ago

Hi team,

if you follow the guide on the new Meraki DNE (https://developer.cisco.com/learningcenter/tracks/meraki-devnet-express/dne-verify-prepare-meraki-module/install-postman-collection-and-environments/)

you ending with { "errors": [ "Invalid API key" ] } if you call i.E. the OrgID

I think the issue is, the guide mention to create a postman env variable called X-Cisco-Meraki-API-Key for the API call. But the postman collection (https://www.postman.com/meraki-api/workspace/cisco-meraki-s-public-workspace/collection/897512-5368b2fb-18fe-4b29-8490-1fd8a5ce1421?action=share&creator=226864) relays on the variable name apiKey.

xanderstevenson commented 2 years ago

Hello @pheilmei

Thank you for reporting this.

It is true that, when using this Postman environment for this Dashboard API collection, we cannot rely on 'Inherited auth form parent' to authorize for us, as is. We must choose Authorization type 'API Key' and fill out as such:

image

We can also use the 'Bearer Token' as the authorization type. That works as well:

see https://developer.cisco.com/meraki/api-latest/#!authorization/authorization-with-bearer-token

image

If we want to rely on Authorization Type 'Inherited auth from parent', then yes, they are correct; naming the Environmental variable to 'apiKey' instead of 'X-Cisco-Meraki-API-Key' will be needed for that to work:

image

image

Our lab authoring team has been made aware. Thank you once again.

Best, Alex Stevenson