Postman is a popular graphical tool for working with REST APIs. Use this tool to explore and work with the Meraki Dashboard API quickly.

 Dashboard API Postman Collection

Overview

If you are new to programming or a seasoned software engineer, knowing what’s possible is half the battle. Postman allows you to interact with APIs by simply entering the URL and parameters into the application. By hitting Send, you will be able to get the API data back, typically in JSON format.

You can also export the API call into your preferred programming language, like Python or NodeJS by opening the Code link.

The data consists of name/value pairs, which makes it easy to read and apply logic operations.

Getting Started

By clicking on the “Run in Postman” button here or in the documentation, you can easily import the entire Meraki API collection into your application.

Run in Postman

You will be prompted to either install Postman on your computer or via Google Chrome application. Creating an account is optional and can help sync your environments across machines.

Once installed, you should be able to open the collection.

Obtaining your Meraki API key

In order to interact with the Dashboard API, you must first obtain an API key.

  • Open your Meraki dashboard: https://dashboard.meraki.com
  • Once logged in, navigate to the Organization Settings menu.
  • Ensure that the API Access is set to “Enable access to the Cisco Meraki Dashboard API”

dashboard-enableAPI.png

  • Then go to your profile to generate the API key. (save this key in a secure location, as it represents your admin credentials)

dashboard-generateAPIkey.png

If you do not have access to a Meraki dashboard organization with networks and devices, you can use this API key: 093b24e85df15a3e66f1fc359f4c48493eaa1b73

Setup Postman

This section will help you setup your Postman app on your computer and then setup an environment to store your variables for future use.

  1. First, install the Postman Chrome extension or Mac App. You can find download instructions here: getpostman.com
  2. Click the eye “Environment quick look” icon on the upper-right, and “Add” to create a new environment.
  3. Give a name to your environment, such as “Postman Lab”.
  4. Add a variable called “baseUrl“, and map it to: https://api.meraki.com/api/v0
    Make sure that the “Current Value” column is also populated the same way as “Initial Value”.
  5. Add another variable with name “X-Cisco-Meraki-API-Key”, and map it to the value of your API key (section above). If you do not have a Meraki dashboard org, you can use this API key: 093b24e85df15a3e66f1fc359f4c48493eaa1b73 
  6. Update and close out of the environment editor dialog box, then select the environment you just created.
  7. Open up the Organizations section in the collection, and pick/open the first API call: List organizations this user has access to
  8. At this point, if you hover over the link/URL’s baseUrl variable or the headers’ X-Cisco-Meraki-API-Key variable (in orange {{curlyBraces}}), you should see that they resolve to the values you defined in the environment.
  9. Hit Send and you will see a list of organizations.

Lab Exercises

This exercise will get you started with the Meraki Dashboard API using a free tool, Postman, to make REST API calls to the Meraki dashboard. Answer all questions using Postman and API calls, no Dashboard use please! You can access the latest API reference docs here: https://api.meraki.com/api_docs

Use this API key: 093b24e85df15a3e66f1fc359f4c48493eaa1b73

  1. Determine the Organization ID for the “Meraki Launchpad”
  2. Find out through the API when the license of this organization expires.
  3. Is SNMP enabled on this Organization?
  4. What is the value for “claimedAt” for the device with serial number “Q2EV-D92Y-TX32
  5. What’s the name of the network that contains the device with serial number “Q2HN-7N9M-89PH
  6. What tags are applied to device “Q2UD-7N75-UGU5”?
  7. How many VLANs are configured on device “Q2QN-5DPW-DXQT”?

Working with API Requests

The API requests are grouped together in a single collection with multiple folders. They have been preconfigured with the API URL, method (i.e. GET, PUT, POST, DELETE) and include the necessary headers. Sample data is also included for each call. This can be modified as desired.  You can expand the documentation for each call by clicking on the arrow to the left of the call title.

GET Data

The first API call you should send is getting a listing of all the Meraki organizations this account has access to. This will be necessary to gather the organization ID, which is then used for future calls. We will need to add the environment orgID variable with this new information.

Next, getting a listing of the networks associated with this orgID will return the netID for each network. We can then use the many API calls that require a netID parameter.

After running several API calls and understanding their required parameters, you will quickly build up an environment that looks similar to this.

POST/PUT Data

To make changes to the data, the POST and PUT calls require a body as well as additional URL parameters. This can be included as JSON or by completing the form-data. A successful response will typically included the submitted data with a unique id.

That’s the basics!

From this point on, you should explore the official Postman documentation and the Meraki API documentation to unleash the full potential.