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.
Question
| Parameter | Required | Type | Description |
|---|---|---|---|
| name | True | string | An string represents the name of URL object. |
| description | False | string | An string containing the description information of URL object. Field level constraints (length must be between 0 and 200 (inclusive) Note: Additional constraints might exist) |
| url | True | string | An 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) | |||
| type | True | string | A 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
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.
- <item 1> (HTTP Method): The exhibit explicitly states 'HTTP request URL POST /api/fpm/v4/object/urls'. Therefore, the missing HTTP method is
POST. - <item 2> (Header): The cURL command already includes
Content-TypeandAcceptheaders. 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-Tokenis a common authentication header. Assuming a snippet likeX-Auth-Token: <your_token_value>is available, this is the most logical and critical missing header for a functional API call. - <item 3> (URL Value): The
Data Parameterstable shows that theurlfield 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 ashttp://malicious.example.com, would fit here. - <item 4> (Type Value): The
Data Parameterstable fortypestates 'A UTF8 string, all letters lower-case, that represents the class-type. This corresponds to the class name.' Given the operation isaddURLObjectand the model isURLObject, the class name isURLObject. Applying the lower-case constraint, the correct value isurlobject. - <item 5> (API Endpoint Path Segment): The exhibit's URL is
/api/fpm/v4/object/urls. The cURL command already includeshttps://ast0072-pod.xyz.com:33333/api/fpm/v4/object/. The remaining missing path segment isurls.
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
Community Discussion
No community discussion yet for this question.
