Automation & Programmability // Lesson 07

JSON Data.

Recognise JSON objects, arrays, keys, strings, numbers, booleans and null values in API payloads.

ObjectArrayKey-valueTypesParsing
01 // Mental model

Start with the big picture.

Curly braces contain comma-separated key-value pairs; keys are strings in double quotes.

CCNA focus: JSON is data, not a comment-friendly configuration language. Watch punctuation, double quotes, data types and nesting when reading API requests and responses.
02 // Building blocks

Know what each part does.

01

Object

Curly braces contain comma-separated key-value pairs; keys are strings in double quotes.

02

Array

Square brackets contain an ordered list of values.

03

Primitive types

Strings, numbers, booleans and null are valid JSON values.

04

Nesting

Objects and arrays can contain each other to represent structured network data.

03 // Compare and recognise

Read the clues.

ItemWhat to remember
StringDouble-quoted text such as "up" or "GigabitEthernet1".
NumberUnquoted numeric value such as 1500.
BooleanUnquoted true or false.
nullExplicit absence of a value; it is not the string "null".
04 // Read a payload

Read a payload.

{
  "device": "edge-1",
  "reachable": true,
  "interfaces": [
    {"name": "Gi0/1", "mtu": 1500, "address": "192.0.2.1"},
    {"name": "Gi0/2", "mtu": 1500, "address": null}
  ]
}

Read the example from top to bottom, then verify the resulting state. Configuration is only complete when the output matches the intended design.

05 // Exam and troubleshooting

Turn facts into a method.

  • Double-quoted text such as "up" or "GigabitEthernet1".
  • Unquoted numeric value such as 1500.
  • Unquoted true or false.
  • Explicit absence of a value; it is not the string "null".
Exam checkpoint: JSON is data, not a comment-friendly configuration language. Watch punctuation, double quotes, data types and nesting when reading API requests and responses.
06 // Check yourself

JSON Data quiz.

1. Which characters delimit a JSON object?

2. Which characters delimit a JSON array?

3. How is a JSON boolean written?

4. What does null represent?

5. Are trailing commas valid in standard JSON?

Score: 0 / 5