Skip to content

Lab 3 - Meraki Postman Collection

While cURL is great for quick, ready-to-go, one-off testing, it lacks a user-friendly interface and doesn't provide strong control for managing variables or organizing REST API operations efficiently.

This is where Postman comes in. Postman is a popular graphical tool designed for working with REST APIs. It allows you to easily explore, manage, and interact with the Meraki Dashboard API.

In this lab, you will learn how to use Postman to run a single API request, as well as to complete a multi-step task using a single collection run.

Steps

  1. If you haven't already, download and install the Postman desktop application from: https://www.postman.com/downloads/

  2. Sign in using one of the available options or create a free account if you don't already have one yet.

Postman login form

!!! warning "Note" If you don't use Postman or prefer not to sign in, feel free to skip Lab 3 and continue directly to Lab 4.

  1. This lab provides a customized Postman collection to help you practice API interactions with the Meraki Dashboard. Download the Meraki_API_Lab.postman_collection.json file from the GitHub repository and import it into the Postman desktop application.

Postman collection import

!!! info "Information" For the latest version of Meraki Dashboard API Postman collection, please visit https://www.postman.com/meraki-api.

  1. The Meraki_API_Lab collection includes eight pre-configured requests. Go to the Variables tab, update the Current Value for organizationId and apiKey variables, and save your changes before continuing.

Postman collection variables

!!! tip "Hint" Use the same lab organization ID and API key from previous lab(s). Please double-check that you are working within the provided lab organization.

  1. In addition to basic REST API requests, Postman also supports pre-request and post-response scripts, which are useful for setting up inputs or processing response data. Click on the request A. getOrganizationNetworks, then go to Scripts tab to review two pre-configured scripts:
Script Description
Pre-request script This script checks the existence of collection variable: organizationId.
Post-response script This script processes the response data from getOrganizationNetworks and creates collection variables for Branch and Campus Network IDs based on their network names for later requests.

Pre-request and post-response scripts

  1. Click on Send, and you should receive a 200 OK status code with the response data in JSON format.

getOrganizationNetworks response

  1. Return to the collection's Variables tab. You should see two new variables that were created by the post-response script in step 5. And these values will be used in other API requests later.

New variables from post-response script

  1. Now that the network IDs have been automatically populated from previous API requests, let's apply a few network settings—such as time zone, network tag(s), and notes—to the branch network using a single API call. Click on request B. updateNetwork -- Branch and review the following request settings customized for this lab. When you're ready, click Send.
Setting Description
Params Collection variable {{branchnwId}} is being used as the networkId in this request.
Headers All requests in this collection have the User-Agent set to Jumpstart/1.0 Postman.
Body In a single request, we are going to update the network name, time zone, network tags, as well as notes.

updateNetwork request - Params and Headers updateNetwork request - Body updateNetwork response

!!! danger "Important" Your access to the lab networks is based on the network tag "LAB". When updating network settings, always ensure that "LAB" remains in the list of network tags. Failing to do so may result in loss of access privileges and could lead to 403 Forbidden errors during subsequent API operations.

  1. In the Dashboard, navigate to Organization > Overview. Verify that the branch network has been renamed to Postman-Branch and that it has been assigned additional new tags: LON and PRD.

Organization overview - Postman-Branch

  1. To conclude this Postman jumpstart lab, let's run the entire collection to complete the task of creating VLANs and enabling Auto-VPN between the branch and campus sites. Review the following API request-to-Dashboard operation mapping table for a detailed breakdown of each step in the workflow.

    API Requests Meraki Operations
    C1 Enabling VLAN on branch appliance.
    C2 Enabling VLAN on campus appliance.
    C3 Creating VLAN 10 (Data-Branch) on branch appliance.
    C4 Creating VLAN 99 (Data-Campus) on campus appliance.
    C5 Update the LAN port#5 to ensure correct Native VLAN and allowed VLAN setting on branch appliance.
    C6 Update the LAN port#5 to ensure correct Native VLAN and allowed VLAN setting on campus appliance.
    C7 Configuring campus site as a VPN hub and enabling VPN for subnet VLAN 99.
    C8 Configuring campus site as a VPN spoke, with campus as the hub, and enabling VPN for subnet VLAN 10.
  2. Right-click on the collection and choose Run. Then click on Run Meraki_API_Lab to execute the full sequence.

    Run collection menu Run Meraki_API_Lab dialog Collection run results

    Hint

    The first two requests have been executed previously, but it's ok to run them again here. Remember, you can use the pre-request and post-response scripts in the request to prepare or handle data for the next requests.

    If you run this collection multiple times, it's expected that you see the two POST request C3 & C4 report 400 errors because the requested VLAN has already been taken from the first collection run.

  3. To verify the changes made during the Postman collection run, go to the Meraki Dashboard and navigate to the Postman-Branch network. Then, go to Security & SD-WAN > Appliance Status. Select the Tools tab and run a Ping test using the following settings:

    • Source IP Address: VLAN 10
    • IP or domain name field: 10.10.99.1

    Ping test from VLAN 10 to campus

You should see a successful ping between the two subnets across the Auto-VPN fabric. Congratulations on completing the Meraki Dashboard API Postman collection lab!

If you're eager to learn more about integrating Meraki operations into your existing automation systems, the next lab will introduce you to the Meraki Python SDK.