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.
Question
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
Options
- AENAUTO/bind/N_23952905
- Bnetworks/L_646829496481105433/bind
- CPOST/L_646829496481105433/bind
- Dnetworks/bind/N_23952905
How the community answered
(21 responses)- A5% (1)
- B76% (16)
- C14% (3)
- D5% (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.
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.
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.
Including the HTTP method (POST) in the URL path is invalid - methods are specified in the request call, not embedded in the URL.
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
Community Discussion
No community discussion yet for this question.
