Courseiva
mediumMultiple Choice

CCNP Practice Question: An engineer is using a Python script to retrieve…

An engineer is using a Python script to retrieve interface statistics from a Cisco IOS-XE device via the REST API. The script sends a GET request to 'https://device/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1/statistics' and receives a 404 Not Found response. The interface exists and is operational. What is the most likely issue?

⚠ Common exam trap

350-401 often tests whether candidates confuse configuration containers with operational-state containers in YANG models, leading them to blame authentication or API enablement instead of the incorrect URI path.

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

✓

The URI is incorrect; statistics are under 'interfaces-state' not 'interfaces'.

In the IETF YANG models used by RESTCONF, operational state data (including interface statistics such as counters and rates) is exposed under the 'ietf-interfaces:interfaces-state' container, not under the configuration-oriented 'interfaces' container. The 'interfaces' container holds configurable attributes like enabled/disabled and description, while 'interfaces-state' holds read-only operational data. Requesting statistics from the 'interfaces' path returns 404 because that data node does not exist there.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The interface name must be URL-encoded because it contains a slash.

    Why it's wrong here

    GigabitEthernet1 contains no slash, so URL-encoding is unnecessary; the 404 arises because the statistics container is not modelled under ietf-interfaces. It is tempting because interface names such as GigabitEthernet0/1 do require encoding, and would be correct for those names.

  • ✓

    The URI is incorrect; statistics are under 'interfaces-state' not 'interfaces'.

    Why this is correct

    The ietf-interfaces YANG model separates configuration data under 'interfaces' from operational state under 'interfaces-state'. Statistics are operational, so requesting them beneath 'interfaces' targets a non-existent node, producing the 404 despite the interface existing and being operational.

  • ✗

    The device requires authentication; the script must include a valid token.

    Why it's wrong here

    A missing token yields 401 Unauthorised, not 404, so authentication is not the cause here. It is tempting because RESTCONF does require token or basic authentication, and omitting credentials is a common scripting error; it would be correct if the response were 401 rather than 404.

  • ✗

    The REST API is not enabled on the device; the engineer must enable it first.

    Why it's wrong here

    With RESTCONF disabled, the HTTPS request typically fails to connect or returns 404 from the web server, but the stem states the interface exists and is operational, implying the API path is reachable. It is tempting because enabling RESTCONF is a prerequisite, and would be correct if no RESTCONF service were listening.

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 →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Cisco exam blueprint

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.