REST API and JSON for CCNA: Query a Controller with GET and POST

REST APIs use HTTP to read and change resources and return structured data in JSON. In the CCNA you must recognize HTTP verbs, the parts of a URI, status codes and read a JSON object, without needing to program.

Exam domain: Automation and Programmability · Level: Intermediate · Updated on October 17, 2026 · 2 min read

Topology diagram “REST API and JSON for CCNA: Query a Controller with GET and POST” with 4 devices and 3 links
Topology: REST API and JSON for CCNA: Query a Controller with GET and POST

Edit this template Download .json

Learning objectives

Devices and addressing

DeviceTypeDetails
ClientPCPython / Postman
requests.get()
Controllersvchttps://ctrl.ejemplo.local
API REST · TLS 443
SW-1Layer 3 switchManaged
Interfaces
R1RouterManaged
OSPF

Reference configuration (Cisco IOS)

Petición y respuesta

GET /api/v1/network-device HTTP/1.1
Host: ctrl.ejemplo.local
X-Auth-Token: eyJhbGciOi...
Accept: application/json

HTTP/1.1 200 OK
{
  "response": [
    {"hostname": "SW-1", "managementIpAddress": "10.0.0.2", "reachabilityStatus": "Reachable"},
    {"hostname": "R1",   "managementIpAddress": "10.0.0.1", "reachabilityStatus": "Reachable"}
  ],
  "version": "1.0"
}

Python (requests)

import requests
r = requests.get("https://ctrl.ejemplo.local/api/v1/network-device",
                 headers={"X-Auth-Token": token}, verify=False)
for d in r.json()["response"]:
    print(d["hostname"], d["managementIpAddress"])

Verification commands

CCNA exam tips

CRUD ↔ HTTP: Create = POST, Read = GET, Update = PUT/PATCH, Delete = DELETE.

JSON: objects in braces {}, arrays in brackets [] and values in double quotes.

How to use this template

Press “Edit this template”: the editor opens with the topology loaded and ready to change (undo with Ctrl+Z). You can also copy the JSON and paste it into the editor with File ▸ Import JSON…. Then add devices, change IPs and export to PDF, PNG or SVG.

To practice, rebuild the topology in Cisco Packet Tracer, GNS3 or Cisco Modeling Labs and paste the reference configuration on each device. Addresses and names are examples: change them to create your own variants.

JSON template for the editor

This is the full diagram in JSON format. Paste it into the editor (File ▸ Import JSON…) or press the edit button to load it automatically.

Edit this template

Frequently asked questions

What does REST mean?

Representational State Transfer: an architecture style that uses HTTP to operate on resources identified by URI.

What is JSON?

A lightweight text format of key-value pairs, objects and arrays, readable by humans and machines.

CCNA and Cisco are registered trademarks of Cisco Systems, Inc. This site is independent, not affiliated with Cisco and does not provide official exam material: the templates are study examples.

More related pages