200-301 - Automation and Programmability - Section 6.5

Describe characteristics of REST-based APIs (CRUD, HTTP verbs, and data encoding) and recognise the components of JSON-encoded data.

Describe a REST API as stateless HTTP calls that map CRUD operations to the GET, POST, PUT/PATCH, and DELETE verbs and return status codes signalling success or error. Recognise JSON structure - objects of key/value pairs, arrays, strings, numbers, booleans, and null - and parse a small JSON payload to read the value of a given key, the most common data-encoding format in network APIs.

REST APICRUD and HTTP verbsHTTP status codesJSON objects and arraysData encoding

Practice question for this objective

Free sampleAutomation and Programmabilitymedium

A network engineer inspects the JSON body returned by a switch API for one interface: { "name": "GigabitEthernet0/1", "mtu": 1500, "enabled": true, "vlans": [10, 20, 30] } The engineer must explain to a colleague how the individual values in this document are encoded according to the JSON data format. Which two statements correctly describe the encoding of the values shown? Select TWO.

  • AThe value 1500 is a JSON number and is written without surrounding quotation marks. Correct
  • BThe value of "vlans" is a JSON array, an ordered list of values enclosed in square brackets. Correct
  • CThe value true is a quoted JSON string because every JSON value must be wrapped in quotation marks.
  • DThe value "GigabitEthernet0/1" is a JSON number because it contains the digits 0 and 1.
  • EThe pair "mtu": 1500 is itself a JSON array because it lists a name beside a value.
Recognise how JSON encodes value types: numbers and booleans are unquoted literals, strings are quoted, and square brackets denote an ordered array. JSON distinguishes value types by syntax rather than by the characters they contain. Numbers such as 1500 and booleans such as true are written as bare literals with no quotation marks, strings are always wrapped in double quotes, and an ordered list of values is delimited by square brackets to form an array. A quoted token is a string even when it contains digits, and a key-value pair belongs to an object, not an array.

Why A is correct: JSON encodes numeric values as bare literals, so 1500 carries no quotes and is interpreted as a number rather than text.

Why B is correct: Square brackets delimit a JSON array, and the comma-separated members 10, 20 and 30 form the ordered list of values it holds.

Why C is wrong: It is tempting to treat all values as text, but true is a bare JSON boolean literal and is wrong because quotes would instead make it a string.

Why D is wrong: Embedded digits look numeric, yet the double quotes make this a JSON string, so classing it as a number misreads the encoding.

Why E is wrong: A name beside a value resembles a list, but this is a key-value member of a JSON object, not an array delimited by square brackets.

See more 200-301 practice questions, answers explained.

More in this domain

Back to all Automation and Programmability objectives, or the 200-301 cert hub.

Examworthy is not affiliated with or endorsed by Cisco. Original, blueprint-aligned practice material only.