Week 12 · Lesson 8

Interpreting JSON

The CCNA asks you to read a JSON payload and find the value the question is asking for — an interface status, an IP address, a count. This lesson walks through realistic network API responses line by line so you can navigate nested objects and arrays with confidence.

CCNA 200-301 Domain 6.0 Automation and Programmability Verified 2026-10-11
Part 1

Anatomy of a JSON document

A JSON document is a single value — usually an object — at the top level. Everything inside is one of six types: string, number, boolean, null, object or array. Two pieces of punctuation do most of the work: curly braces mark objects and square brackets mark arrays. A colon separates a key from its value, and a comma separates entries.

Anatomy of a JSON document · select a part
{
  "deviceName": "edge-router-1",
  "uptimeSeconds": 86400,
  "reachable": true,
  "location": null
}

Read it top to bottom: the object has four keys. deviceName maps to the string "edge-router-1"; uptimeSeconds to the number 86400; reachable to the boolean true; and location to null, meaning the value is absent or unknown. Nothing here needs interpretation beyond the type — the skill is knowing which type is which.

Tip. When reading JSON, start by counting the opening braces and brackets. Each { is a new object and each [ is a new array. Indentation is only for humans — the braces and brackets are what a parser actually uses — but a well-formatted document makes the structure obvious.
Part 2

Navigating to a value

To find a value you follow the path from the top down, naming each key or array index along the way. If the top-level object has a key interfaces whose value is an array, then the third element is interfaces[2] — arrays are zero-indexed. If that element is an object with a key ip, the path is interfaces[2].ip.

Definition — path. The sequence of keys (and array indices) that leads from the root of a JSON document to a specific value, for example interfaces[0].address.
The JSON document as a tree · click a node
{ root object } interfaces : [ ] [0] object name: "Gi0/0" status: "up" [1] object path to status: interfaces[0].status — each step is a key or a zero-based index

Part 3

Reading an interface list

Here is a realistic response from a network controller’s interfaces endpoint. Read it, then answer the questions underneath.

{
  "hostname": "SW1",
  "interfaceCount": 3,
  "interfaces": [
    { "name": "GigabitEthernet1/0/1", "status": "up",   "vlan": 10, "speed": 1000 },
    { "name": "GigabitEthernet1/0/2", "status": "down", "vlan": 10, "speed": 1000 },
    { "name": "GigabitEthernet1/0/3", "status": "up",   "vlan": 20, "speed": 100  }
  ]
}
Interface explorer · select an interface

Exam tip. Exam questions almost always ask you to locate a value within an array of objects. Find the element by matching one key (for example the interface name), then read the sibling key the question wants. Do not assume the array is sorted, and remember the index starts at 0, not 1.
Part 4

Nested objects and arrays

Real responses nest more deeply. The example below wraps addressing inside each interface, and includes an array of allowed VLANs. This is where careful reading matters, because the same key name (vlan) can appear in different places.

{
  "device": "R1",
  "interfaces": [
    {
      "name": "GigabitEthernet0/0",
      "status": "up",
      "address": { "ip": "10.0.0.1", "mask": "255.255.255.0" },
      "trunkVlans": [10, 20, 30]
    },
    {
      "name": "GigabitEthernet0/1",
      "status": "administratively down",
      "address": null,
      "trunkVlans": []
    }
  ]
}
QuestionPathAnswer
IP of the first interface?interfaces[0].address.ip10.0.0.1
Mask of the first interface?interfaces[0].address.mask255.255.255.0
How many allowed VLANs on the first interface?interfaces[0].trunkVlans3 (10, 20, 30)
Why has the second interface no IP?interfaces[1].addressIt is null (no address).
What is the second interface’s status?interfaces[1].status"administratively down"
Note. The second interface’s status is the string "administratively down", not merely "down". That detail matters: administratively down means the interface was shut by configuration (shutdown), whereas down usually means a physical or protocol problem. Reading the exact string, not a paraphrase, is the whole skill.
Part 5

Interpreting data types

Data type tells you how to compare a value. In the snippets above, vlan: 10 is a number and name: "GigabitEthernet1/0/1" is a string. If an exam option shows "10" in quotes where the document has 10 without quotes, that option has misread the type.

Spot the type · work through the values
Value 1 of 6

      

JSONTypeMeaning
"up"StringText value; could be any word.
1000NumberNumeric value; usable in comparisons.
trueBooleanLogical true (no quotes, lowercase).
nullNullNo value / not present.
{ ... }ObjectNested key/value set.
[ ... ]ArrayOrdered list; may hold objects or scalars.

One useful consequence: a boolean such as "enabled": true is not the same as the string "true". A well-written client relies on the type, so a response that declares true means the concept is genuinely on, whereas null means it is simply not reported.

Part 6

Practice walkthrough

Here is a device-inventory response. Try each question before reading the answer.

{
  "count": 2,
  "devices": [
    { "hostname": "SW1", "role": "access",   "mgmtIp": "10.0.1.1", "osVersion": "17.9" },
    { "hostname": "SW2", "role": "access",   "mgmtIp": "10.0.1.2", "osVersion": "17.3" }
  ]
}
  1. How many devices are listed? The count is 2, and the devices array holds two objects. Answer: 2.
  2. What is the management IP of SW2? Find the element whose hostname is "SW2" — that is devices[1] — then read its mgmtIp: "10.0.1.2".
  3. Which device runs an older OS? Compare devices[*].osVersion: "17.9" versus "17.3". SW2 is on the lower version, 17.3. (As strings, compare carefully; as software versions, 17.3 is older than 17.9.)
  4. What role do the devices share? Both role values are "access".

The pattern never changes: find the object, then read the key. Every exam question about JSON comes down to that, plus an awareness of index 0 and of which values are strings versus numbers.

Part 7 · Your turn

Review

Check what you have learned with these review questions.

Review · 6 questions

Key termMeaning
JSON objectAn unordered set of key/value pairs in curly braces.
JSON arrayAn ordered list of values in square brackets; zero-indexed.
KeyThe quoted name of a value inside an object.
PathThe sequence of keys/indices leading to a value, e.g. interfaces[0].status.
StringA double-quoted text value.
NumberAn unquoted numeric value.
BooleanUnquoted true or false.
NullA JSON value meaning “no value”.
Sources & references
  1. Cisco. CCNA (200-301) Exam Topics, Domain 6.0 Automation and Programmability. cisco.com.
  2. Bray, T. et al. RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format (2017). rfc-editor.org/rfc/rfc8259.
  3. ECMA International. ECMA-404: The JSON Data Interchange Syntax. ecma-international.org.
  4. Cisco. DevNet: Interpreting JSON / REST API Basics. developer.cisco.com.
Sources

Sources & references

  1. Cisco. CCNA (200-301) Exam Topics, Domain 6.0 Automation and Programmability. cisco.com.
  2. Bray, T. et al. RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format (2017). rfc-editor.org/rfc/rfc8259.
  3. ECMA International. ECMA-404: The JSON Data Interchange Syntax. ecma-international.org.
  4. Cisco. DevNet: Interpreting JSON / REST API Basics. developer.cisco.com.

Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.