mediumMultiple Choice
350-401 Practice Question: An engineer is using the Cisco DNA Center REST…
An engineer is using the Cisco DNA Center REST API to retrieve a list of network devices and their health scores. The engineer writes a Python script using the requests library. The script successfully retrieves data for the first 100 devices, but when trying to get the next 100, the API returns an empty list. The engineer checks the API documentation and finds that the endpoint supports pagination with the 'offset' and 'limit' parameters. The current script does not handle pagination. What should the engineer do to retrieve all devices?
⚠ Common exam trap
Cisco often tests the distinction between offset-based pagination (using 'offset' and 'limit') and cursor-based pagination (using a 'next' URL), leading candidates to incorrectly assume that the API provides a 'next' link in headers, which is not the case for DNA Center REST APIs.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Write a loop that increments the 'offset' parameter by the 'limit' value until all pages are retrieved.
The Cisco DNA Center REST API uses offset-based pagination, where the 'offset' parameter specifies the starting index and 'limit' defines the number of records per page. To retrieve all devices, the engineer must write a loop that increments the offset by the limit value (e.g., 100) in each iteration until the API returns an empty list, indicating all pages have been fetched. This approach ensures complete data retrieval without exceeding any API-imposed maximum limit.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the 'limit' parameter to 1000 in a single API call.
Why it's wrong here
Setting the 'limit' to 1000 in a single call assumes the API accepts arbitrarily large limits and that all records will fit in one response. Cisco DNA Center's API enforces a maximum limit per request (often 500), so a value of 1000 will either be rejected with an error or silently truncated to the max. Even if it were accepted, any dataset larger than 1000 would still require multiple calls, so this does not fully solve the pagination problem.
- ✗
Use the 'next' URL from the response headers to automatically fetch the next page.
Why it's wrong here
This approach fails because the API in question does not return a 'next' URL in its response headers; it exposes a stateless offset/limit pagination model. Expecting a 'next' link would require the engineer to parse a header that doesn't exist, causing the script to either crash or never progress past the first page. Standard Link headers are typical of cursor-based or RESTful pagination, but they are not guaranteed across all APIs.
- ✓
Write a loop that increments the 'offset' parameter by the 'limit' value until all pages are retrieved.
Why this is correct
Implementing a loop that increments the offset by the current limit is the canonical way to handle offset/limit pagination. The loop should begin with offset=0 and continue fetching pages, incrementing offset by the limit each iteration, until the returned page contains fewer items than the requested limit (or zero), signaling the last page. This approach is efficient, deterministic, and works whether the total record count is known or not, making it the correct fix for the script.
- ✗
Switch to using the Cisco DNA Center Python SDK which handles pagination automatically.
Why it's wrong here
While the Cisco DNA Center Python SDK may transparently handle pagination, the engineer's task is to correct the existing script, not to introduce a new dependency or rewrite the solution. The SDK wraps the API and might require authentication reconfiguration, additional installation, and version compatibility checks, which are outside the scope of the immediate problem. Moreover, the question explicitly asks how to modify the script's logic, so relying on an abstraction layer would not demonstrate the required pagination knowledge.
Go deeper
Related to this question
Learn chapter
SDN Controllers and Cisco ACI
Key term
REST API for Network Devices
A REST API for network devices is a set of rules that allows software applications to communicate with routers, switches, and firewalls using standard web methods like GET, POST, PUT, and DELETE over HTTP or HTTPS.
Key term
Cisco DNA Center
A centralized network management and automation platform from Cisco that provides intent-based networking for easier configuration, monitoring, and troubleshooting of Cisco devices.
About these practice questions
Courseiva writes every 350-401 question from scratch — 1,923 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 350-401 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 350-401 exam.