QuestionQ350

Understanding and Using APIs

Refer to the exhibits.

Question Image

Question Image

Drag the code items to the numbered positions to complete the Meraki Python script.

Drag & Drop
base_url
network_name
data
post
application/json
networks
api_key
organizations
base_url = https://api.meraki.com/api/v0
org_id = 123456789
api_key = 1098hadpfsiapsf8ahf8ohp
network_name = “New Network”
requests.(
     + "//" + org_id + "/",
    headers = {
        “X-Cisco-Meraki-API-Key”: “”,
        “Content-Type”: “”
    },
    =json.dumps ({ “name”: ,
                       “type”: “wireless switch”
    }))
Explanation

Creating a Meraki network uses the POST method at the organization networks collection endpoint. The request URL requires the base API URL, the organizations path segment, the organization ID, and the networks path segment. Requests sends the JSON-serialized body through data; the payload name is the network_name variable, while the API key and JSON media type populate their respective headers.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!