Retrieving a list of Meraki networks
Meraki organizes all its information in a hierarchy, where a device belongs to a network and a network, in turn, belongs to an organization that can have multiple networks. A common task when dealing with REST APIs is to retrieve all the information that is currently stored on the system. In this example, we will see how to retrieve all the networks that are registered to all our organizations. This will require us to make multiple HTTP requests.
Getting ready
Open your code editor and start by creating a file called networks.py
. Next, navigate your terminal to the same directory that you just created the networks.py
file in.
In your terminal, you'll also have to set an environment variable called MERAKI_DASHBOARD_API_KEY
, whose value is the API key for your Meraki organization. You can refer to the Authenticating web requests recipe for an introduction on how to set environment variables on different operating systems.