nerdexam
Cisco

350-901 · Question #36

Refer to the exhibit. Drag and drop the code snippets from the left onto the item numbers on the right that match the missing sections in the cURL exhibit to complete the cURL request to FirePower…

This question tests the ability to construct a cURL request by interpreting API documentation to correctly fill in the HTTP method, an authentication header, data payload values, and the API endpoint path.

Understanding and Using APIs

Question

Refer to the exhibit. Drag and drop the code snippets from the left onto the item numbers on the right that match the missing sections in the cURL exhibit to complete the cURL request to FirePower Device Manager API to create objects. Not all code snippets are used. Exhibit: Description The addURLObject operation handles configuration related to URLObject model. This API call is not allowed on the standby unit in an HA pair. HTTP request URL POST /api/fpm/v4/object/urls Data Parameters
ParameterRequiredTypeDescription
nameTruestringAn string represents the name of URL object.
descriptionFalsestringAn string containing the description information of URL object. Field level constraints (length must be between 0 and 200 (inclusive) Note: Additional constraints might exist)
urlTruestringAn string containing the URL address.
Field level constraints (cannot be blank or empty, length must be between 0 and 400 (inclusive). (Note: Additional constraints might exist)
typeTruestringA UTF8 string, all letters lower-case, that represents the class-type. This corresponds to the class name.
curl -X <item 1> --header 'Content-Type: application/json' --header 'Accept: application/json' -H "<item 2>" -d '{ \n "name": "Blocked URL", \n "url": "<item 3>", \n "type": "<item 4>" \n}' https://ast0072-pod.xyz.com:33333/api/fpm/v4/object/<item 5>

Exhibit

350-901 question #36 exhibit

Explanation

This question tests the ability to construct a cURL request by interpreting API documentation to correctly fill in the HTTP method, an authentication header, data payload values, and the API endpoint path.

Approach. The task is to match missing sections in the cURL command with appropriate values based on the provided API documentation.

  1. <item 1> (HTTP Method): The exhibit explicitly states 'HTTP request URL POST /api/fpm/v4/object/urls'. Therefore, the missing HTTP method is POST.
  2. <item 2> (Header): The cURL command already includes Content-Type and Accept headers. In most API interactions, an authentication header is required, even if not explicitly detailed in every parameter table of the documentation. For Cisco FirePower APIs, X-Auth-Token is a common authentication header. Assuming a snippet like X-Auth-Token: <your_token_value> is available, this is the most logical and critical missing header for a functional API call.
  3. <item 3> (URL Value): The Data Parameters table shows that the url field is required and should be 'An string containing the URL address.' The cURL command structure puts this value inside double quotes within the JSON body. A valid example URL, such as http://malicious.example.com, would fit here.
  4. <item 4> (Type Value): The Data Parameters table for type states 'A UTF8 string, all letters lower-case, that represents the class-type. This corresponds to the class name.' Given the operation is addURLObject and the model is URLObject, the class name is URLObject. Applying the lower-case constraint, the correct value is urlobject.
  5. <item 5> (API Endpoint Path Segment): The exhibit's URL is /api/fpm/v4/object/urls. The cURL command already includes https://ast0072-pod.xyz.com:33333/api/fpm/v4/object/. The remaining missing path segment is urls.

Common mistakes.

  • common_mistake. Common mistakes include selecting the wrong HTTP method (e.g., GET instead of POST for creation), omitting or incorrectly formatting the authentication header, providing an invalid value for the URL or type fields, or misinterpreting the API endpoint path. For example, using 'GET' for <item 1> is incorrect because POST is for creating resources. For <item 4>, using 'URLObject' (capitalized) or 'url' (generic string) would be incorrect because the documentation specifically requires 'all letters lower-case' and states it 'corresponds to the class name' (urlobject). For <item 5>, using 'url' or 'object' instead of 'urls' would be incorrect as it would not match the documented API endpoint.

Concept tested. REST API fundamentals, cURL utility usage, API documentation interpretation, and understanding of request components (HTTP methods, headers, body, endpoint paths) for creating resources.

Topics

#cURL#REST API#Cisco Firepower#API Object Creation

Community Discussion

No community discussion yet for this question.

Full 350-901 Practice