Study guide
6.6 JSON-Encoded Data
Cisco Certified Network Associate CCNA
Track your progress as you read
Finished sections get a check mark.
1 Introduction
About the CCNA 200-301 Exam Domains and Weights Study Strategies and Tips
2 Chapter 1: Network Fundamentals (20%)
1.1 Network Components 1.2 Network Topology Architectures 1.3 Physical Interfaces and Cabling 1.4 TCP vs. UDP 1.5 IPv4 Addressing and Subnetting 1.6 IPv6 Addressing and Prefix 1.7 Wireless Principles 1.8 Virtualization Fundamentals 1.9 Switching Concepts 1.10 OSI and TCP/IP Reference Models 1.11 Verifying IP Parameters on Client Operating Systems
3 Chapter 2: Network Access (20%)
2.1 VLANs — Configuration and Verification 2.2 Trunking and 802.1Q 2.3 Layer 2 Discovery Protocols (CDP and LLDP) 2.4 EtherChannel (Link Aggregation) 2.5 Spanning Tree Protocol (STP) and RSTP 2.6 Wireless Architectures and AP Modes 2.7 Network Access Troubleshooting 2.8 Inter-VLAN Routing — Deep Dive
4 Chapter 3: IP Connectivity (25%)
3.1 Routing Table Components 3.2 Router Forwarding Decisions 3.3 IPv4 and IPv6 Static Routing 3.4 Single-Area OSPFv2 — Concepts 3.5 Single-Area OSPFv2 — Configuration 3.6 First Hop Redundancy Protocols (FHRP) 3.7 Troubleshooting IP Connectivity 3.8 OSPF Troubleshooting Scenarios
5 Chapter 4: IP Services (10%)
4.1 NAT (Network Address Translation) 4.2 DHCP and DNS 4.3 NTP, SNMP, and Syslog 4.4 QoS Fundamentals 4.5 TFTP/FTP and Remote Access 4.6 IP Services — Comprehensive Review
6 Chapter 5: Security Fundamentals (15%)
5.1 Key Security Concepts 5.2 Device Access Control and Password Policies 5.3 VPN Fundamentals 5.4 Access Control Lists (ACLs) 5.5 Layer 2 Security Features 5.6 Network Security Best Practices and Hardening 5.7 Threat Mitigation and Incident Response
7 Chapter 6: Automation and Programmability (10%)
6.1 Impact of Automation on Network Management 6.2 Controller-Based and Software-Defined Architectures 6.3 AI and Machine Learning in Network Operations 6.4 REST-Based APIs 6.5 Configuration Management Tools 6.6 JSON-Encoded Data 6.7 Automation and Programmability — Comprehensive Review
6.6 JSON-Encoded Data
Key Takeaways Explain This Topic AI
JSON (JavaScript Object Notation) is the dominant data format for REST APIs and network automation.
Curly braces {} hold objects (key-value pairs); square brackets [] hold arrays (ordered lists).
JSON values can be strings, numbers, booleans, null, objects, or arrays; keys are always quoted strings.
Arrays are zero-indexed — the first element is index 0 — which the exam tests with read-a-value questions.
YAML and XML are alternatives: YAML (Ansible) is whitespace-significant; XML (NETCONF/SOAP) is verbose tag-based.
Last updated: June 2026
Why JSON Matters
JSON (JavaScript Object Notation) is the standard payload format for REST APIs and network automation tools. The CCNA does not ask you to write JSON, but it does ask you to read a JSON block and pull out a specific value — and to recognize valid syntax.
Syntax Rules
Data is written as "key": value pairs.
Pairs are separated by commas (no trailing comma after the last one).
Curly braces {} enclose an object (an unordered set of key-value pairs).
Square brackets [] enclose an array (an ordered list).
Keys must be strings in double quotes — single quotes are invalid JSON.
Values may be a string, number, boolean, null, object, or array.
Data Types
- Type Example Notes
- String "hostname": "SW1" Always double-quoted
- Number "vlan_id": 10 No quotes; integer or decimal
- Boolean "enabled": true true / false , no quotes
- Null "description": null Empty value, no quotes
- Object {"name": "SW1"} Nested key-value set
- Array [10, 20, 30] Ordered list, zero-indexed
- Simple Device Object {
- "hostname": "Core-SW1",
- "management_ip": "10.0.0.1",
- "platform": "Catalyst 9300",
- "software_version": "17.9.4",
- "uptime_days": 45,
- "reachable": true
- }
Here uptime_days is a number (no quotes) and reachable is a boolean — distinguishing those from strings is a common exam point.
Nested Structures and Arrays
Real API output nests objects inside arrays inside objects. Reading it is a navigation drill.
- Array of VLAN Objects {
- "vlans": [
- { "id": 10, "name": "SALES", "ports": ["Gi0/1", "Gi0/2"] },
- { "id": 20, "name": "ENGINEERING", "ports": ["Gi0/4", "Gi0/5"] },
- { "id": 30, "name": "MANAGEMENT", "ports": ["Gi0/7"] }
- ]
- }
The vlans array holds 3 objects . To get the name of the second VLAN you read vlans → index 1 (zero-indexed) → name = "ENGINEERING" .
- Reading Practice {
- "interfaces": [
- { "name": "GigabitEthernet0/0", "ip_address": "10.0.0.1", "status": "up" },
- { "name": "GigabitEthernet0/1", "ip_address": "192.168.10.1", "status": "up" }
- ]
- }
How many interfaces? 2 (the array has two objects).
IP of GigabitEthernet0/1? 192.168.10.1 — index 1 of the array.
Status of the first interface? up — index 0.
Drill the zero-indexed rule: index 0 is the first element, index 1 is the second. The exam loves to ask for "the value at index 1" expecting you to skip the first object.
JSON vs. YAML vs. XML
- Feature JSON YAML XML
- Structure Braces/brackets Indentation Opening/closing tags
- Readability Good Best Verbose
- Used by REST APIs , RESTCONF Ansible playbooks NETCONF, SOAP, legacy
- Whitespace Ignored Significant Ignored
- Comments Not supported Supported with # Supported <!-- -->
- Common Traps
JSON has no comments. If an option claims you can add # note inside JSON, it is wrong — that is YAML.
YAML is whitespace-sensitive. A misaligned space breaks an Ansible playbook; JSON does not care about indentation.
Quotes matter in JSON. "true" is a string; true is a boolean. Keys must use double quotes.
Don't confuse the encodings by protocol : RESTCONF can use JSON or XML, NETCONF uses XML only — a fact echoed in the review section.
On the Exam: Expect a JSON block and a "what is the value of X" question. Identify objects {} vs arrays [] , count array elements, and apply zero-indexing to find the right element.
A Step-by-Step Method for Reading JSON
When a JSON block lands on your screen under time pressure, work it like a treasure map rather than reading top to bottom. First, locate the outermost container : a leading { means the whole thing is an object you index by key name, while a leading [ means it is an array you index by position. Second, follow the path the question implies — if it asks for the IP of the third interface, find the interfaces key, drop into its array, and count to position 2 because arrays start at index 0.
Third, confirm the data type of the value you land on, since a question may hinge on whether "10" is a string or 10 is a number, or whether reachable is the boolean true versus the string "true" .
A worked walk-through: given {"router": {"id": 5, "acls": [{"name": "GUARD", "rules": 12}, {"name": "GUEST", "rules": 3}]}} , the question "how many rules does the GUEST ACL have?" resolves as router → acls → index 1 (the second object, because GUARD at index 0 comes first) → rules = 3. Notice the value 3 is a number, not a string, so it carries no quotes. This discipline — outermost container, follow the path, check the type — answers virtually every JSON-reading item the CCNA can throw at you.
Validity Checks the Exam Loves
The other JSON skill tested is spotting invalid syntax. Watch for keys written without double quotes, single quotes used anywhere (JSON requires double quotes), a stray trailing comma after the final element, mismatched braces and brackets, or an attempt to add a # or // comment — all of which make the JSON invalid. Recognizing why a snippet would fail to parse is just as fair game as reading a value out of a valid one, and the same brace-versus-bracket and quoting rules drive both kinds of question.