📘CCNP Encore (350-401-ENCORE-v1.1)
1. What This Topic Is About (Exam View)
In this section, the exam checks whether you can:
- Understand REST API response codes
- Interpret API response payloads (JSON data)
- Know how Cisco DNA Center APIs work
- Understand how RESTCONF works
- Read API responses and know what success or failure looks like
⚠️ You are NOT required to write complex code.
You are required to read, understand, and interpret API responses.
2. What Is a REST API (Simple Definition)
A REST API allows one system to communicate with another system over HTTP.
In networking:
- A controller (like Cisco DNA Center) exposes APIs
- Engineers or automation tools send requests
- The controller sends back responses
These responses contain:
- A status code (number)
- A payload (usually JSON data)
3. What Is Cisco DNA Center in API Context
Cisco DNA Center (DNAC) is a network controller that:
- Manages devices
- Automates configurations
- Collects network data
- Provides REST APIs for automation
Using APIs, you can:
- Get device inventory
- Check network health
- Push configurations
- Monitor issues
Cisco DNA Center APIs always return:
- An HTTP response code
- A JSON payload
4. What Is RESTCONF
RESTCONF is a REST-based protocol used to:
- Configure network devices
- Retrieve operational data
- Use YANG data models
RESTCONF:
- Uses HTTP methods (GET, POST, PUT, DELETE)
- Uses JSON or XML
- Is commonly used with Cisco IOS-XE devices
RESTCONF responses also include:
- HTTP response codes
- Structured payloads
5. Understanding HTTP Response Codes (VERY IMPORTANT)
Response codes tell you what happened to your request.
The exam focuses mainly on meaning, not memorization of all numbers.
5.1 2xx – Success Responses
These mean the request worked correctly.
| Code | Meaning | Explanation |
|---|---|---|
| 200 OK | Success | Request completed successfully |
| 201 Created | Created | Resource was successfully created |
| 202 Accepted | Accepted | Request accepted and processed later |
| 204 No Content | Success, no data | Action succeeded, but no data returned |
Exam Tip:
If you see 2xx, the operation was successful.
5.2 3xx – Redirection Responses
Rarely tested, but good to know.
| Code | Meaning |
|---|---|
| 301 / 302 | Redirected to another location |
Usually handled automatically by tools.
5.3 4xx – Client Errors (Your Mistake)
These mean the request is wrong.
| Code | Meaning | Explanation |
|---|---|---|
| 400 Bad Request | Invalid request | Wrong format or missing data |
| 401 Unauthorized | Authentication failed | Invalid or missing token |
| 403 Forbidden | Not allowed | User lacks permission |
| 404 Not Found | Resource missing | API endpoint or object not found |
| 409 Conflict | Conflict | Resource already exists |
Exam Tip:
4xx errors mean the client did something wrong.
5.4 5xx – Server Errors (Controller Problem)
These mean the server failed.
| Code | Meaning |
|---|---|
| 500 Internal Server Error | Server crashed or failed |
| 503 Service Unavailable | Service is down or overloaded |
Exam Tip:
5xx errors are not caused by the user request.
6. Understanding API Payloads (Response Body)
A payload is the data returned by the API.
Most Cisco APIs use JSON.
6.1 Common JSON Structure in Cisco DNA Center
Typical response contains:
{
"response": { },
"version": "1.0"
}
Or:
{
"response": [ ],
"page": { }
}
6.2 Key Payload Components
| Field | Meaning |
|---|---|
response | Main data returned |
errorCode | Error identifier |
message | Human-readable message |
executionStatusUrl | Async task tracking |
id | Unique identifier |
status | Operation state |
7. Synchronous vs Asynchronous Responses
7.1 Synchronous Response
- API responds immediately
- Common with GET requests
- Response contains data directly
Example:
- Getting device inventory
7.2 Asynchronous Response (Very Important for DNAC)
Cisco DNA Center often uses asynchronous APIs.
Process:
- API returns 202 Accepted
- Payload contains a task ID
- Client checks task status later
Example payload:
{
"response": {
"taskId": "abc123"
}
}
You must:
- Use the task ID
- Query the task status API
Exam Tip:
202 + task ID = asynchronous processing
8. Interpreting Error Payloads
Error responses usually include:
{
"errorCode": "INVALID_REQUEST",
"message": "Invalid input provided"
}
Key points:
- Error code explains what failed
- Message explains why it failed
- Status code explains who is responsible
9. RESTCONF Response Interpretation
RESTCONF responses follow the same logic:
9.1 Success Example
- 200 OK
- JSON payload containing YANG-modeled data
9.2 Configuration Change
- 201 Created → new config applied
- 204 No Content → config changed, no data returned
9.3 Error Example
- 400 → invalid YANG structure
- 401 → authentication failure
- 409 → configuration conflict
10. Authentication and Tokens (Context Understanding)
Cisco DNA Center APIs use:
- Token-based authentication
Flow:
- Authenticate
- Receive token
- Use token in API headers
- Invalid or expired token → 401 Unauthorized
11. Exam-Focused Summary (Must Remember)
You MUST Know:
✔ Meaning of 2xx, 4xx, 5xx
✔ Difference between 200, 201, 202, 204
✔ What a JSON payload is
✔ How to interpret task-based responses
✔ How Cisco DNA Center uses asynchronous APIs
✔ RESTCONF uses YANG + REST + HTTP codes
12. One-Line Exam Memory Rules
- 2xx = Success
- 4xx = Client error
- 5xx = Server error
- 202 + task ID = async operation
- JSON payload = response data
- RESTCONF = REST + YANG
