nerdexam
Cisco

300-435 · Question #50

The Cisco DNA Center Sites API must be used to add a device to a site, but only the site name is available. Which API call must be used to retrieve the site identifier so that the device can be…

The correct answer is C. /dna/intent/api/v1/site. To retrieve a site identifier when only the site name is known in Cisco DNA Center, the API call GET /dna/intent/api/v1/site should be used to list all sites, then filter the response by name to extract the corresponding ID.

Controller-Based Network Automation

Question

The Cisco DNA Center Sites API must be used to add a device to a site, but only the site name is available. Which API call must be used to retrieve the site identifier so that the device can be properly added to the network?

Exhibit

300-435 question #50 exhibit

Options

  • A/dna/intent/api/site/siteId
  • B/dna/intent/api/sites
  • C/dna/intent/api/v1/site
  • D/dna/intent/api/v1/site/siteName

How the community answered

(55 responses)
  • A
    4% (2)
  • B
    2% (1)
  • C
    89% (49)
  • D
    5% (3)

Why each option

To retrieve a site identifier when only the site name is known in Cisco DNA Center, the API call `GET /dna/intent/api/v1/site` should be used to list all sites, then filter the response by name to extract the corresponding ID.

A/dna/intent/api/site/siteId

The `/dna/intent/api/site/siteId` endpoint is designed to retrieve details for a specific site when its unique `siteId` is already known, not to list sites or find an ID by name.

B/dna/intent/api/sites

While `/dna/intent/api/sites` might seem plausible, the standard and documented base path for Site APIs in Cisco DNA Center's current API version is `/dna/intent/api/v1/site`.

C/dna/intent/api/v1/siteCorrect

The `GET /dna/intent/api/v1/site` API call is used to retrieve a list of all sites managed by Cisco DNA Center, and the response contains both the `id` and `name` for each site, allowing the user to programmatically find the required site identifier by matching the known site name.

D/dna/intent/api/v1/site/siteName

REST API best practices typically use unique identifiers in the path (like `siteId`), while filtering by attributes like `siteName` is usually done via query parameters, making this path structure unlikely for retrieving a site by name directly.

Concept tested: Cisco DNA Center Sites API GET all

Source: https://developer.cisco.com/dnac/api/v1/site/get-all-sites/

Topics

#Cisco DNA Center API#REST API#Site Management#API Endpoints

Community Discussion

No community discussion yet for this question.

Full 300-435 Practice