Cisco DNA Center APIs – Automating the Network the Smarter Way [CCNP ENTERPRISE]

Cisco DNA Center APIs – Automating the Network the Smarter Way [CCNP ENTERPRISE]_networkjourney

Today I want to talk to you not just about automation — but next-gen automation that’s transforming enterprise networks across the globe. If you’ve been managing networks manually or using traditional tools like CLI or SNMP, let me introduce you to the game changer: Cisco DNA Center APIs.

The first time I interacted with Cisco DNA Center (DNAC), I was amazed at the control and visibility it gave me. But when I discovered its APIs — that’s when things went to the next level. Imagine automating device onboarding, monitoring, configuration, even troubleshooting — all from your Python script or Ansible playbook! Yes, it’s possible. So let’s deep dive into this topic, simplify it, and even build a small lab so you can try it hands-on.


Theory in Brief – What Are Cisco DNA Center APIs?

Simplifying Network Management with APIs

Cisco DNA Center is Cisco’s intent-based network controller that provides centralized management, automation, and assurance for enterprise networks. But what truly sets it apart is its rich and well-documented REST APIs, which allow you to integrate and automate almost every feature.

These APIs expose Cisco DNA Center’s full power to developers and NetOps teams. You can write scripts or tools that query network health, push configurations, get device inventory, or even trigger actions like path trace — all using simple REST API calls over HTTPS.


API Categories You Should Know

Cisco DNA Center APIs are organized into several domains:

  • Intent APIs – for provisioning, monitoring, configuration
  • Command Runner APIs – to run CLI commands on devices
  • Assurance APIs – for health and telemetry data
  • Path Trace APIs – for automated hop-by-hop traffic analysis
  • Topology APIs – to discover and visualize network devices

These APIs work with OAuth2 tokens for authentication and typically return data in JSON format, making them easy to parse and integrate with Python, Ansible, or dashboards.


How Does It Work?

  1. Authenticate – Use your API credentials to get a token.
  2. Make Requests – Use HTTP verbs (GET, POST, PUT, DELETE) to interact with DNAC.
  3. Parse JSON Responses – Handle the returned data in your automation tools.
  4. Integrate or Trigger Actions – Based on outputs, push configs, monitor alerts, or update dashboards.

Comparision – Features, Pros & Cons

FeatureCisco DNA Center APIs
ProtocolHTTPS REST APIs
AuthenticationOAuth2 Token-based
Data FormatJSON (standard output)
API CategoriesIntent, Assurance, CLI, Path Trace, Topology
DocumentationCisco DevNet API Reference
SecurityRole-based access control (RBAC)

Pros and Cons

ProsCons
End-to-end network automationRequires Cisco DNA Center appliance
Rich telemetry and assurance APIsLearning curve for complex use cases
Easy JSON format and REST architectureRequires API coding knowledge
Works with Python, Postman, Ansible, etc.Licensing requirements for full features
Excellent Cisco DevNet supportDNAC setup can be resource-intensive

Essential CLI Commands (Cisco Devices)

While the real magic happens via API, here are some CLI commands used in context with DNA Center integration:

PurposeCLI CommandNotes
Check HTTP/HTTPS server status`show running-configinclude http`
Enable SSH and Telnetip ssh version 2, line vty 0 4Device reachability setup
Check device inventory manuallyshow inventoryVerifies hardware info DNAC collects
Show CDP neighborsshow cdp neighbors detailHelps in discovery and topology build
Check NETCONF/RESTCONF statusshow netconf-yang statusRequired for config API via YANG
Monitor interfacesshow interfaces statusEquivalent to assurance interface APIs
Run CLI via Command RunnerN/A – done via API callAutomates CLI via DNAC

Real-World Use Case

Use CaseWhat DNA Center API DoesBenefit
Device Inventory CollectionGET /dna/intent/api/v1/network-deviceReal-time hardware & software inventory
Automated Path TracePOST /dna/intent/api/v1/flow-analysisHop-by-hop trace for traffic visibility
Run CLI on DevicesPOST /dna/intent/api/v1/network-device-poller/cli/readExecutes CLI remotely, fetches result
Interface Health MonitoringGET /dna/intent/api/v1/interfaceStatus and metrics of all interfaces
Topology VisualizationGET /dna/intent/api/v1/topologyBuilds real-time network topology
Python Automation DashboardUses multiple APIs in one workflowComplete custom GUI for NetOps

EVE-NG Lab – Simulating Cisco DNA Center APIs (With Diagram)

Note: Cisco DNA Center can’t be emulated directly in EVE-NG due to resource requirements. But we can simulate device-side interaction and mock DNAC behavior using Python/Postman.

Lab Topology


Router Configuration

hostname API-Router
!
username admin privilege 15 password cisco123
!
ip http secure-server
ip http authentication local
ip domain-name networkjourney.com
crypto key generate rsa modulus 1024
!
netconf-yang
restconf
!
line vty 0 4
login local
transport input ssh
!
interface g0/0
ip address 192.168.1.1 255.255.255.0
no shutdown

API Testing Steps

  1. Get Token from DNAC (simulated here)
    POST to /dna/system/api/v1/auth/token with base64 encoded credentials.
  2. List Devices via API
    GET /dna/intent/api/v1/network-device
  3. Path Trace Example (POST) jsonCopyEdit{ "sourceIP": "192.168.1.1", "destIP": "8.8.8.8" }
  4. Command Runner Sample via API
    Run show version via POST CLI request.

Troubleshooting Tips

IssueCauseFix
401 UnauthorizedToken expired or wrong credentialsRegenerate token, verify username/password
API not reachableHTTP server not enabledRun ip http secure-server
JSON parsing errorIncorrect headers or syntaxEnsure Content-Type and Accept are set to JSON
Device not discovered in DNACSNMP or SSH not reachableCheck management VLAN and access settings
Path Trace failsEndpoints unreachableCheck routing and IP reachability
CLI Command Runner no outputDevice not reachable or bad commandTest via CLI manually

Most Common FAQs

1. What is Cisco DNA Center and how do its APIs help in automation?

Answer:
Cisco DNA Center is Cisco’s centralized network management and automation platform. It simplifies day-to-day network operations like configuration, monitoring, provisioning, and assurance.
The DNA Center APIs expose the platform’s features via RESTful endpoints, allowing developers and network engineers to automate tasks such as:

  • Device onboarding
  • Configuration pushes
  • Gathering inventory and health data
  • Running network assurance reports
    This saves hours of manual CLI work and allows consistent, error-free deployments.

2. Are DNA Center APIs RESTful, and what formats do they support?

Answer:
Yes, DNA Center APIs are RESTful and adhere to standard HTTP methods like GET, POST, PUT, and DELETE.
They primarily return data in JSON format, making them easy to integrate with modern web tools, Python scripts, and automation frameworks like Ansible or Postman.
This REST-based structure ensures scalability and simplicity for both DevOps teams and network engineers.


3. What kind of tasks can I automate using Cisco DNA Center APIs?

Answer:
With DNA Center APIs, you can automate a wide range of tasks including:

  • Inventory retrieval (devices, topology, interfaces)
  • Software image management and compliance checks
  • Configuration templates and deployments
  • Device provisioning and onboarding
  • Network assurance and health monitoring
  • User and client tracking
  • Site creation and management
    Basically, everything you do via GUI can be automated via APIs, making it ideal for large-scale or repetitive tasks.

4. How do I authenticate with Cisco DNA Center APIs?

Answer:
DNA Center uses token-based authentication. Here’s the basic process:

  1. Send a POST request with your username/password to /dna/system/api/v1/auth/token.
  2. You’ll receive a JWT token (JSON Web Token).
  3. Use this token in the X-Auth-Token header for all subsequent API calls.

This token-based approach is secure and easy to integrate into automation scripts or CI/CD pipelines.


5. Do I need a special license to access DNA Center APIs?

Answer:
To access the full suite of APIs, your DNA Center must have an essential or advantage license, depending on the features.
Basic read-only APIs like inventory and topology may work with lower tiers, but advanced APIs (e.g., configuration templates, assurance) require appropriate licensing.
Always check the Cisco licensing guide for your DNA Center version to confirm what’s included.


6. Can I use Python to interact with DNA Center APIs?

Answer:
Absolutely! Python is one of the most popular languages for working with DNA Center APIs.
You can use libraries like:

  • requests for making HTTP calls
  • dnacentersdk (official Cisco SDK for DNA Center) for easier integration
  • json to parse and handle responses

Here’s a quick snippet for authentication:

import requests
url = "https://dnac-ip/dna/system/api/v1/auth/token"
headers = {'Content-Type': 'application/json'}
response = requests.post(url, auth=("username", "password"), headers=headers, verify=False)
token = response.json()["Token"]

This token can be used to automate any DNA Center feature via Python.


7. What is Cisco’s DNA Center SDK and how does it help?

Answer:
The Cisco DNA Center SDK (dnacentersdk) is a Python wrapper for the DNA Center APIs.
It simplifies the process of:

  • Authenticating
  • Making API calls
  • Handling responses
    Instead of building raw REST calls, you can use SDK methods like:
dnac.devices.get_device_list()

This drastically reduces development time and helps beginners get started with DNA Center automation quickly.


8. How do DNA Center APIs support network assurance?

Answer:
DNA Center’s Assurance APIs provide visibility into:

  • Network health
  • Client connectivity issues
  • Application performance
    You can automate the collection of telemetry and run reports to identify trends, detect anomalies, and even trigger alerts.
    This enables proactive network monitoring, saving you from firefighting later.

9. Can DNA Center APIs be integrated with external tools like Ansible or ServiceNow?

Answer:
Yes, DNA Center APIs can integrate with popular external tools like:

  • Ansible: Use REST API modules or custom playbooks for provisioning and auditing.
  • ServiceNow: Automate incident or change ticket creation based on DNA Center alerts.
  • Jenkins or GitLab CI/CD: Include network automation workflows in your pipelines.

These integrations allow cross-platform orchestration, making your automation truly enterprise-ready.


10. What are some best practices when using Cisco DNA Center APIs?

Answer:
Here are a few expert tips:

  • Use token caching to avoid repeated authentications.
  • Handle API rate limits and response errors gracefully in your scripts.
  • Paginate results where necessary (e.g., inventory lists).
  • Use Postman or Swagger (API documentation at https://dnac-ip/api-docs) for exploring endpoints.
  • Always test in a lab before deploying in production.

By following these practices, you’ll build reliable, scalable, and maintainable automation solutions.


YouTube Link

Watch the Complete CCNP Enterprise: Cisco DNA Center APIs – Automating the Network the Smarter Way Lab Demo & Explanation on our channel:

Class 1 CCNP Enterprise Course and Lab Introduction | FULL COURSE 120+ HRS | Trained by Sagar Dhawan
Class 2 CCNP Enterprise: Packet Flow in Switch vs Router, Discussion on Control, Data and Management
Class 3 Discussion on Various Network Device Components
Class 4 Traditional Network Topology vs SD Access Simplified

Final Note

Understanding how to differentiate and implement Cisco DNA Center APIs – Automating the Network the Smarter Way is critical for anyone pursuing CCNP Enterprise (ENCOR) certification or working in enterprise network roles. Use this guide in your practice labs, real-world projects, and interviews to show a solid grasp of architectural planning and CLI-level configuration skills.

If you found this article helpful and want to take your skills to the next level, I invite you to join my Instructor-Led Weekend Batch for:

CCNP Enterprise to CCIE Enterprise – Covering ENCOR, ENARSI, SD-WAN, and more!

Get hands-on labs, real-world projects, and industry-grade training that strengthens your Routing & Switching foundations while preparing you for advanced certifications and job roles.

Emailinfo@networkjourney.com
WhatsApp / Call: +91 97395 21088

Upskill now and future-proof your networking career!


Trainer Sagar Dhawan

Hi all,
Good to see you here.
I'm your Trainer for CCIE, CCNP, CCNA, Firewall batches and many more courses coming up!
Stay tuned for latest updates!
Keep me posted over Whatsapp/Email about your experience learning from us.
Thanks for being part of - "Network Journey - A journey towards packet-life!!!"