Study guide

6.4 REST-Based APIs

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.4 REST-Based APIs

Key Takeaways Explain This Topic AI

REST APIs use HTTP methods (GET, POST, PUT, PATCH, DELETE) to interact with controllers and devices.

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

HTTP status codes signal results: 2xx success, 3xx redirect, 4xx client error, 5xx server error.

REST is stateless — every request carries all needed data, including its auth token; the server keeps no session.

REST responses are typically JSON, exchanged over HTTPS, secured with token-based auth or OAuth 2.0.

Last updated: June 2026

What a REST API Is

REST (Representational State Transfer) is an architectural style for web APIs (Application Programming Interfaces). A RESTful API lets software talk to a controller or device over HTTP/HTTPS instead of a human typing CLI commands. You send an HTTP request to a URL endpoint and get back structured data — almost always JSON .

Example — list devices from Cisco Catalyst Center: GET https://catalystcenter.example.com/dna/intent/api/v1/network-device

  • Authorization: Bearer <token>
  • Content-Type: application/json
  • Response (JSON): {
  • "response": [
  • {
  • "hostname": "SW-Floor1",
  • "managementIpAddress": "10.0.0.10",
  • "platformId": "C9300-48T",
  • "softwareVersion": "17.9.1",
  • "reachabilityStatus": "Reachable"
  • }
  • ]
  • }
  • The Six REST Constraints
  • Constraint Meaning
  • Client-Server Client requests, server responds; the two evolve independently
  • Stateless Each request is self-contained; the server stores no session between calls
  • Cacheable Responses can be marked cacheable to cut repeat traffic
  • Uniform interface Standard HTTP verbs and predictable URL structure
  • Layered system Client cannot tell if it is talking to the server or a proxy/gateway
  • Code on demand (optional) Server may return executable code (rarely used)

The most-tested one is stateless : if a question describes "each request must include all information the server needs, such as the auth token," the answer is stateless .

HTTP Methods and CRUD

Every REST call uses an HTTP verb that maps to a CRUD operation (Create, Read, Update, Delete).

  • HTTP method CRUD Purpose Networking example
  • GET Read Retrieve data (no change) List all VLANs
  • POST Create Make a new resource Create VLAN 10
  • PUT Update (full) Replace the entire resource Replace a device's whole config
  • PATCH Update (partial) Modify part of a resource Rename one VLAN
  • DELETE Delete Remove a resource Delete VLAN 10

GET is safe (read-only) and idempotent ; PUT and DELETE are idempotent (repeating them lands the same final state); POST is not idempotent (repeat it and you may create duplicates).

HTTP Status Codes

The first digit defines the class; memorize the class meanings and the common specific codes.

  • Range Class Meaning
  • 1xx Informational Request received, still processing
  • 2xx Success Request succeeded
  • 3xx Redirection Further action needed
  • 4xx Client error Problem with the request
  • 5xx Server error Problem on the server
  • Code Meaning
  • 200 OK Request succeeded
  • 201 Created New resource created (often follows POST)
  • 204 No Content Succeeded, nothing to return (often follows DELETE)
  • 400 Bad Request Malformed request syntax
  • 401 Unauthorized Not authenticated — no/invalid credentials
  • 403 Forbidden Authenticated but not permitted
  • 404 Not Found The resource does not exist
  • 500 Internal Server Error The server failed to process a valid request

Trap: 401 vs 403 — 401 means you have not proven who you are ; 403 means we know who you are, but you are not allowed .

Authentication

  • Method How it works
  • Basic Auth username:password Base64-encoded in the header (weak)
  • API key A unique key in a header or URL parameter
  • Token-based Log in once, receive a token, send the token on every later request
  • OAuth 2.0 Industry standard for delegated, scoped authorization

Cisco Catalyst Center, Meraki Dashboard, ACI, and SD-WAN (vManage) all expose REST APIs used exactly this way for automation.

On the Exam: Know the verb-to-CRUD mapping cold, recognize 200/201/401/403/404/500, and remember REST is stateless and returns JSON over HTTPS.

Anatomy of a REST Request and Response

It helps to see every moving part of a single transaction. A REST request has four pieces: the method (the verb such as GET or POST), the URI (the endpoint plus any resource identifiers and query parameters), the headers (metadata such as Authorization: Bearer <token> , Accept: application/json , and Content-Type: application/json ), and an optional body (the JSON payload, used on POST, PUT, and PATCH but not on GET or DELETE). The server replies with a status code that tells you the outcome class, response headers , and a response body carrying the requested or created data.

Consider creating a VLAN on a controller. You send POST /api/v1/vlans with the header Authorization: Bearer eyJ... and a JSON body {"id": 10, "name": "SALES"} . If it works, the server returns 201 Created and a body echoing the new resource, often with the URI where it now lives. If your token expired, you get 401 Unauthorized . If the token is valid but your account cannot create VLANs, you get 403 Forbidden . If you posted to a misspelled endpoint, you get 404 Not Found . If your JSON was malformed, you get 400 Bad Request . And if the controller itself crashed mid-request, you get 500 Internal Server Error .

Walking that single example mentally lets you reconstruct most status-code questions on the exam from first principles rather than rote memory.

Why Statelessness Scales

Because REST is stateless, any server in a load-balanced pool can handle any request — there is no session pinned to one server that another would lack. That is why you must include the auth token on every call rather than logging in once and relying on the server to remember you. This property is what lets cloud platforms and SDN controllers serve thousands of automation clients simultaneously, and it is exactly the behavior the exam describes when it says "each request must contain all the information needed to process it."