nerdexam
Cisco

300-435 · Question #156

Refer to the exhibit. An engineer must bind the network ENAUTO, which has the network ID L_646829496481105433, to a template by using Cisco Meraki APIs. Which code snippet must be added to the box…

The correct answer is B. networks/L_646829496481105433/bind. The Cisco Meraki API endpoint for binding a network to a configuration template follows the path pattern /networks/{networkId}/bind, using the network ID as the path parameter.

Controller-Based Network Automation

Question

Refer to the exhibit. An engineer must bind the network ENAUTO, which has the network ID L_646829496481105433, to a template by using Cisco Meraki APIs. Which code snippet must be added to the box in the code to complete the Python request?
import requests

url = "https://api.meraki.com/api/v1/"
payload = '''{
 "configTemplateId": "N_23952905",
 "autoBind": false
}'''

headers = {
 "Content-Type": "application/json",
 "Accept": "application/json",
 "X-Cisco-Meraki-API-Key": "Gbec40cf957de430a6fff2012345678a4fac9ea0"
}

response = requests.request('POST', url, headers=headers, data = payload)
print(response.text.encode('utf8'))

Exhibit

300-435 question #156 exhibit

Options

  • AENAUTO/bind/N_23952905
  • Bnetworks/L_646829496481105433/bind
  • CPOST/L_646829496481105433/bind
  • Dnetworks/bind/N_23952905

How the community answered

(21 responses)
  • A
    5% (1)
  • B
    76% (16)
  • C
    14% (3)
  • D
    5% (1)

Why each option

The Cisco Meraki API endpoint for binding a network to a configuration template follows the path pattern /networks/{networkId}/bind, using the network ID as the path parameter.

AENAUTO/bind/N_23952905

This incorrectly uses the network name ENAUTO and places the template ID in the URL path, neither of which matches the Meraki API URL structure.

Bnetworks/L_646829496481105433/bindCorrect

The Meraki API bind endpoint requires the network ID (L_646829496481105433) as a path parameter in the format networks/{networkId}/bind. The template ID (N_23952905) is passed in the request body payload as configTemplateId, not in the URL path. This correctly constructs the full URL as https://api.meraki.com/api/v1/networks/L_646829496481105433/bind.

CPOST/L_646829496481105433/bind

Including the HTTP method (POST) in the URL path is invalid - methods are specified in the request call, not embedded in the URL.

Dnetworks/bind/N_23952905

This reverses the correct structure by placing bind before the template ID rather than after the network ID, and uses the template ID instead of the network ID.

Concept tested: Cisco Meraki API network bind endpoint URL construction

Source: https://developer.cisco.com/meraki/api-v1/bind-network/

Topics

#Meraki API#Python Requests#REST API#Network Configuration

Community Discussion

No community discussion yet for this question.

Full 300-435 Practice