Automation with APIs

Postman Runner Collection

This is a small video by Jake Snyder on how to access the public Mist Runner collections on Postman.

Automation for Access Switching using Postman

This is an example of using Postman to immediatly use the API to do usful things.  Andy also shows you how to use the Chrome developer tools to figure out exactly which API endpoint is being called and how to take advantage of that in Postman.  It is really the non-programmer way to approach the...

API with Wired Assurance

The API provides the same functionality as the UI, but through a programmable interface.  There are primarily 3 main URI endpoints of interest with respect to Wired Assurance. API Endpoints: Network Templates: Documentation is located just below RF Templates here: https://api.mist.com/api/v1/docs/Org#rf-template Create Network Template POST: https://api.mist.com/api/v1/orgs/:org_id/networktemplates Payload: JSON Formatted Payload Required: name Get List of...

Mist API Architecture

The diagram below conceptually describes how the Mist cloud API can be used to control remote Mist network infrastructure.

HTTPS Response Codes

The full list of HTTP response codes and definitions can be found here: https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html Mist uses the following response codes: Status Description 200 OK 400 Bad Request. The API endpoint exists but its syntax/payload is incorrect, detail may be given 401 Unauthorized 403 Permission Denied 404 Not found. The API endpoint doesn’t exist or resource...

Paged AP Inventory [API]

When using API calls to view all APs, you may paginate the list to indicate the current page and maximum number of objects returned in each page.  This is for an effort to support sites with very large AP inventories. Please refer to our API document (Mist login required) for the usage: https://api.mist.com/api/v1/docs/Overview#query An example...

Mist API Introduction

From the beginning Mist has been a 100% API company.  The API contains a set of tools known as endpoints for building software and applications that communicate with the Mist cloud.  The Dashboard API is a modern, RESTful API using HTTPS requests to a URL and JSON as a human-readable format. The API is available...

Create a Local Python Environment

Overview Install Python 3 following the installation guide: https://docs.python-guide.org/starting/installation OS X Install HomeBrew Go to http://brew.sh. Copy the Homebrew bootstrap code under “Install Homebrew”. Launch the Terminal.app application to open a console window. Paste the Homebrew bootstrap code and begin the installation. If prompted to install Apple’s “command line developer tools,” confirm by clicking the Install button. Follow the prompts...

How do I find my Org and Site ID?

To find your org_id or site_id, simply navigate to the Organization -> Settings page (org_id) or the Organization -> Site Configuration -> <Site Name> (site_id).  As depicted in the screenshots   Alternatively, when you are logged into your Mist UI you can find them in the URL as shown.  AP page is used as a reference.

Simple API example

See If You’re Logged in Already Get ‘whoami’ and privileges (which organization and sites I have access to) GET /api/v1/self For my test account, it returned: This is because I ran it in a new tab on a browser which I’m currently logged in to.

Using Postman

There is a tool call Postman that can be used to interact with the API without getting into coding. It is a really good place to start. You can download it here.   First you will need to generate an API Token. You can do it here and this will carry your permissions.  This is...

Postman using Variables

  In Postman you can create your own environments using variables to customize and greatly simplify your API experience.

Setting up a Python environment using ATOM

There are many tools you can use to code in Python.  I found ATOM to be very straightforward and this youtube video to be very helpful setting things up on my Mac.  It will take about a 1/2 hour, but it is time well spent if you want to start working with the sample code...

Setting up 2 factor auth and getting an APP key for gmail

This video will walk you through the steps to enable a gmail account to use and APP password instead of your regular password.  This will be needed if you want to create your own notifications with he Mist API and send e-mail from a python script.  It is meant to walk you through the process...

Using ATOM to write a simple script

I’ve used my postman knowledge to learn how to work with the Mist API.  Now I’ve taken some basic Python knowledge to print out the WLANs in my home organization.  This template can be used to print out administrators, clients, AP’s or anything you want! And I ran the script on my MAC. This is...

Make sure you test in a safe place

Up to now we have been doing GET operations.  Now we are going to start changing things with PUT operations and you will make mistakes as you learn.  You might want to create another Mist Org for your testing.  In this case I was changing Guest Portal and I made mistake. So when I went...

Change the Guest Portal password and email administrator

    To run this module you need to watch this video to setup your gmail account with 2 factor authentication (required.) This script will list your WLANs, generate a new random password, PUT the password into your guest portal and send the administrator and email with the new password.  This was written as generic...

Fun Comparing RSSI example (Mac)

I wrote a simple script to get the current RSSI from my Macbook Pro and using the Mist API to get the RSSI associated with my MAC address and run continuously.  You will need to ^c to break out of the script.  Keep in mind the Mist AP reports its stats every 60 seconds or...

Fun Comparing RSSI example (Windows)

I wrote a simple script to get the current Signal Quality percentage (not RSSI) from a Windows 10 laptop and using the Mist API to get the RSSI associated with my MAC address and run continuously. You will need to ^c to break out of the script. Keep in mind the Mist AP reports its...

SLE API Documentation

Monitoring the Mist Service Level Experience (SLE) API Documentation: Many endpoints used on the Mist WiFi Service Levels dashboard can be found in the API docs: https://api.mist.com/api/v1/docs/Site#insights (requires valid login) or https://api.ac2.mist.com/api/v1/docs/Site#insights Those endpoints which may not be found in the API docs are noted below. Metrics/Classifiers: Mist SLEs support metrics and classifiers. Metrics track...