nerdexam
Cisco

200-901 · Question #431

Refer to the exhibit. An engineer must create a local user on Cisco ASA and prepares a script to send the request through ASA REST API. The engineer gets a response of 400 Bad Request. Which HTTP…

The correct answer is A. POST/api/objects/localusers Request Data { "kind": "object#LocalUserObj", "name": "UserOne", "password": "p4ssW0rd", "privilegeLevel": 2, "ASDM_CLIAccessType": "Cli", "objectId": "userOne1973" }. The Cisco ASA REST API requires the correct endpoint, a 'name' field, an integer privilegeLevel, and a valid ASDM_CLIAccessType enumeration value to return HTTP 201 Created.

Understanding and Using APIs

Question

Refer to the exhibit. An engineer must create a local user on Cisco ASA and prepares a script to send the request through ASA REST API. The engineer gets a response of 400 Bad Request. Which HTTP request produces a response code of 201? A. B. C. D.

Exhibits

200-901 question #431 exhibit 1
200-901 question #431 exhibit 2
200-901 question #431 exhibit 3
200-901 question #431 exhibit 4
200-901 question #431 exhibit 5

Options

  • APOST/api/objects/localusers Request Data { "kind": "object#LocalUserObj", "name": "UserOne", "password": "p4ssW0rd", "privilegeLevel": 2, "ASDM_CLIAccessType": "Cli", "objectId": "userOne1973" }
  • BPOST/api/objects/localusers Request Data { "kind": "object#LocalUserObj", "password": "p4ssW0rd", "MSCHAPAuthenticated": true, "privilegeLevel": "high", "ASDM_CLIAccessType": "None", "objectId": "userOne1973" }
  • CPOST/api/objects/localusers Request Data { "kind": "object#LocalUserObj", "name": "UserOne", "password": "p4ssW0rd", "MSCHAPAuthenticated": false, "privilegeLevel": 2, "ASDM_CLIAccessType": "Full" }
  • DPOST/api/objects/localusergroups Request Data { "kind": "object#LocalUserObj", "password": "p4ssW0rd", "MSCHAPAuthenticated": false, "privilegeLevel": "low", "ASDM_CLIAccessType": "Null" }

How the community answered

(64 responses)
  • A
    94% (60)
  • B
    2% (1)
  • C
    3% (2)
  • D
    2% (1)

Why each option

The Cisco ASA REST API requires the correct endpoint, a 'name' field, an integer privilegeLevel, and a valid ASDM_CLIAccessType enumeration value to return HTTP 201 Created.

APOST/api/objects/localusers Request Data { "kind": "object#LocalUserObj", "name": "UserOne", "password": "p4ssW0rd", "privilegeLevel": 2, "ASDM_CLIAccessType": "Cli", "objectId": "userOne1973" }Correct

Choice A uses the correct endpoint (/api/objects/localusers), includes the required 'name' field, specifies 'privilegeLevel' as an integer (2), and sets 'ASDM_CLIAccessType' to 'Cli', which is a valid enumeration value. All required fields are present and correctly typed, so the ASA REST API accepts the request and returns 201 Created. The 'objectId' field provides the unique resource identifier expected by the API.

BPOST/api/objects/localusers Request Data { "kind": "object#LocalUserObj", "password": "p4ssW0rd", "MSCHAPAuthenticated": true, "privilegeLevel": "high", "ASDM_CLIAccessType": "None", "objectId": "userOne1973" }

Choice B omits the required 'name' field and specifies 'privilegeLevel' as a string ('high') instead of an integer, both of which violate the API schema and produce a 400 Bad Request.

CPOST/api/objects/localusers Request Data { "kind": "object#LocalUserObj", "name": "UserOne", "password": "p4ssW0rd", "MSCHAPAuthenticated": false, "privilegeLevel": 2, "ASDM_CLIAccessType": "Full" }

Choice C uses 'ASDM_CLIAccessType': 'Full', which is not a valid enumeration value - the ASA REST API accepts only 'None', 'Cli', 'Enable', or 'ASDM', causing a 400 Bad Request.

DPOST/api/objects/localusergroups Request Data { "kind": "object#LocalUserObj", "password": "p4ssW0rd", "MSCHAPAuthenticated": false, "privilegeLevel": "low", "ASDM_CLIAccessType": "Null" }

Choice D targets the wrong endpoint (/api/objects/localusergroups instead of /api/objects/localusers), omits the required 'name' field, and specifies 'privilegeLevel' as a string ('low') instead of an integer.

Concept tested: Cisco ASA REST API local user creation request

Source: https://www.cisco.com/c/en/us/td/docs/security/asa/api/qsg-asa-api.html

Topics

#REST API#Cisco ASA API#HTTP Methods#HTTP Status Codes

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice