9. Construct code to perform a specific operation based on a set of requirements and given API reference documentation
📘Cisco DevNet Associate (200-901 DEVASC)
This topic focuses on using REST APIs to retrieve information about devices (clients/hosts) connected to a network.
For the exam, you must understand:
- What a client/host means
- How Meraki and Cisco DNA Center track clients
- How to authenticate to APIs
- How to construct API requests
- How to handle responses (JSON)
- How to write basic Python code to retrieve client data
- How filtering and query parameters work
We will explain everything in simple and clear language.
1. What Is a Client or Host?
A client or host is any device connected to a network.
Examples in an IT environment:
- Laptop connected to office Wi-Fi
- Desktop connected via Ethernet
- IP phone
- Network printer
- Mobile phone connected to wireless
- Server connected to switch
When connected, these devices generate network traffic. Network platforms like:
- Cisco Meraki
- Cisco DNA Center
can detect and store information about these devices.
2. Why Do We Need to Obtain a List of Clients?
In real IT environments, administrators need to:
- Monitor connected devices
- Identify unauthorized devices
- Troubleshoot connectivity issues
- Track bandwidth usage
- Perform security checks
- Generate audit reports
Instead of manually checking dashboards, developers use APIs to automatically retrieve this information.
This is what the DEVASC exam tests — your ability to write code that interacts with APIs.
3. Using Cisco Meraki to Obtain Client List
3.1 What Is Cisco Meraki?
Cisco Meraki provides cloud-managed networking devices such as:
- Switches
- Wireless access points
- Security appliances
All data is accessible through the Meraki Dashboard API.
3.2 Authentication in Meraki
Meraki uses:
- API Key authentication
Steps:
- Generate API key from Meraki Dashboard.
- Send API key in HTTP header:
X-Cisco-Meraki-API-Key: YOUR_API_KEY
3.3 Important API Endpoint for Clients
To obtain clients in a network:
GET /networks/{networkId}/clients
Full URL:
https://api.meraki.com/api/v1/networks/{networkId}/clients
3.4 Required HTTP Components
Method
GET
Headers
X-Cisco-Meraki-API-Key
Content-Type: application/json
3.5 Example Python Code (Meraki)
import requestsAPI_KEY = "YOUR_API_KEY"
NETWORK_ID = "YOUR_NETWORK_ID"url = f"https://api.meraki.com/api/v1/networks/{NETWORK_ID}/clients"headers = {
"X-Cisco-Meraki-API-Key": API_KEY,
"Content-Type": "application/json"
}response = requests.get(url, headers=headers)if response.status_code == 200:
clients = response.json()
for client in clients:
print("Client Name:", client.get("description"))
print("IP Address:", client.get("ip"))
print("MAC Address:", client.get("mac"))
print("VLAN:", client.get("vlan"))
print("----------------------")
else:
print("Error:", response.status_code)
3.6 Important Fields Returned
Meraki returns JSON data such as:
- description (client name)
- mac
- ip
- vlan
- usage
- manufacturer
- status
- switchport
You must understand how to:
- Parse JSON
- Loop through results
- Extract specific fields
3.7 Query Parameters
Meraki allows filtering using parameters:
Example:
?perPage=100
?timespan=86400
These help:
- Limit number of results
- Filter by time range
Understanding query parameters is important for the exam.
4. Using Cisco DNA Center to Obtain Client List
4.1 What Is Cisco DNA Center?
Cisco DNA Center is an enterprise network controller used to manage:
- Campus networks
- Wireless networks
- Network automation
- Assurance and monitoring
It provides a REST API for client information.
4.2 Authentication in Cisco DNA Center
DNA Center uses:
- Token-based authentication
Step 1: Get token
POST /dna/system/api/v1/auth/token
You must send:
- Basic authentication (username/password)
Response:
{
"Token": "your_token_here"
}
Step 2: Use token in header:
X-Auth-Token: your_token_here
4.3 API Endpoint to Get Clients
Example endpoint:
GET /dna/intent/api/v1/client-health
or
GET /dna/intent/api/v1/client-detail
Full URL example:
https://dnacenter.example.com/dna/intent/api/v1/client-health
4.4 Example Python Code (DNA Center)
import requests
from requests.auth import HTTPBasicAuthBASE_URL = "https://dnacenter.example.com"
USERNAME = "admin"
PASSWORD = "password"# Step 1: Get Token
auth_url = f"{BASE_URL}/dna/system/api/v1/auth/token"
auth_response = requests.post(auth_url, auth=HTTPBasicAuth(USERNAME, PASSWORD), verify=False)token = auth_response.json()["Token"]# Step 2: Get Clients
headers = {
"X-Auth-Token": token,
"Content-Type": "application/json"
}client_url = f"{BASE_URL}/dna/intent/api/v1/client-health"
response = requests.get(client_url, headers=headers, verify=False)if response.status_code == 200:
clients = response.json()
print(clients)
else:
print("Error:", response.status_code)
5. Key Differences Between Meraki and DNA Center
| Feature | Meraki | DNA Center |
|---|---|---|
| Authentication | API Key | Token |
| Hosted | Cloud | On-premises |
| API Style | REST | REST |
| Header | X-Cisco-Meraki-API-Key | X-Auth-Token |
You must understand these differences for exam questions.
6. Important REST API Concepts for Exam
6.1 HTTP Methods
- GET → Retrieve data
- POST → Create data
- PUT → Update data
- DELETE → Remove data
For this topic, mainly GET is used.
6.2 Status Codes
- 200 → Success
- 201 → Created
- 400 → Bad request
- 401 → Unauthorized
- 403 → Forbidden
- 404 → Not found
- 500 → Server error
You must know how to check response.status_code.
6.3 JSON Handling
API responses are in JSON format.
You must understand:
response.json()
And extracting values:
client["ip"]
client.get("mac")
7. Common Exam Scenarios
The exam may ask you to:
- Complete missing Python code
- Identify correct API endpoint
- Choose correct authentication method
- Identify correct header
- Interpret JSON output
- Identify correct HTTP method
- Understand filtering parameters
8. Security Best Practices
For the exam, remember:
- Do not hardcode API keys in production
- Store credentials securely
- Use HTTPS
- Handle token expiration
- Handle errors properly
9. Typical Workflow Summary
When obtaining client list:
- Identify platform (Meraki or DNA Center)
- Authenticate (API key or token)
- Build correct endpoint URL
- Send GET request
- Check status code
- Parse JSON response
- Extract required client information
10. Final Exam Preparation Checklist
You should be able to:
✅ Explain what a client/host is
✅ Identify Meraki client endpoint
✅ Identify DNA Center client endpoint
✅ Explain API key authentication
✅ Explain token authentication
✅ Write Python code using requests
✅ Parse JSON response
✅ Understand HTTP status codes
✅ Use query parameters
✅ Compare Meraki and DNA Center
Final Conclusion
In this DEVASC exam section, you are expected to:
- Use REST APIs
- Write Python code
- Authenticate properly
- Retrieve client/host information
- Handle JSON responses correctly
The main goal is to automate the retrieval of connected device information from:
- Cisco Meraki
- Cisco DNA Center
If you understand authentication, endpoints, headers, JSON parsing, and Python requests library, you will confidently pass this section of the exam.
