200-901 · Question #290
Drag and Drop Questions Drag and drop the code from the bottom onto the box where the code is missing in the Python script to complete a function to return all the clients on a network by using the Ci
The correct answer is application/json; X-Cisco-Meraki-API-Key; Authorization: Bearer; clients. The question requires completing a Python script to retrieve network clients using the Cisco Meraki Dashboard API by correctly filling in HTTP headers and API endpoint segments.
Question
Exhibit
Answer Area
Drag items
Correct arrangement
- application/json
- X-Cisco-Meraki-API-Key
- Authorization: Bearer
- clients
Explanation
The question requires completing a Python script to retrieve network clients using the Cisco Meraki Dashboard API by correctly filling in HTTP headers and API endpoint segments.
Approach. 1. The first blank in the 'headers' dictionary requires the API key header name. For Cisco Meraki, this is 'X-Cisco-Meraki-API-Key'. This header carries the API key '0110c4e1b8a1'. 2. The second blank in the 'headers' dictionary for 'Content-Type' specifies the format of data being sent or expected. Since the script uses 'json.loads' on the response, 'application/json' is the correct content type. 3. The first blank in the client retrieval URL 'url + '' + '/net['id']+'/' + ''' needs to complete the path to a network's clients. Given the base URL and the preceding calls for organizations and networks, the path segment before '/net['id']' should be 'networks'. 4. The second blank in the client retrieval URL 'url + 'networks' + '/net['id']+'/' + '___'' needs the resource identifier for the collection of clients. Following REST API conventions, after specifying a network, you request 'clients'. Therefore, 'clients' is the correct choice.
Common mistakes.
- common_mistake. Using 'Authorization: Bearer' is incorrect because the Meraki API uses a specific custom header for its API key ('X-Cisco-Meraki-API-Key') rather than a Bearer token for direct API key authentication in this context. Choosing 'application/xml' for 'Content-Type' would be wrong because the script explicitly uses 'json.loads' to parse the response, indicating JSON is the expected format. Using 'client' (singular) for the URL segment to retrieve a collection of clients would be incorrect; 'clients' (plural) is needed for a list of resources. The options 'client', 'application/xml', and 'Authorization: Bearer' remain unused because they do not fit the API requirements for these specific blanks.
Concept tested. This question tests knowledge of REST API fundamentals, including HTTP headers for authentication and content negotiation, and URL structure for accessing resources (specifically organizations, networks, and clients) in a hierarchical API like Cisco Meraki Dashboard API. It also implicitly tests understanding of Python's 'requests' library and JSON parsing.
Topics
Community Discussion
No community discussion yet for this question.
