How to send DNA Center API requests to a DevNet Always-on Sandbox

The DNA Center interactive API documentation helps you to explore the DNA Center API endpoints.

This documentation provides description of the DNA Center APIs, requests, required parameters, responses, and an online console to instantly try out the APIs. Code Templates are also provided for building the scripts quickly.

How to enter the DNA Center device

To use the interactive API documentation, first enter a DNA Center device to make the API calls to. In our case, we can use a DevNet Sandbox, sandboxdnac.cisco.com. Check the version number of the Sandbox to make sure it matches the version value of the interactive API documentation. Currently the sandboxdnac.cisco.com and sandboxdnac2.cisco.com version is 2.2.3.4.

  1. Click Configuration settings button.
  2. In the Host field, enter the hostname as sandboxdnac2.cisco.com.
  3. Check the Use Proxy checkbox and click Save.

How to get the access token

To start with the DNA Center API, you must first obtain the access token using the Authentication API and that token value needs to be included in every request as part of the X-Auth-Token header.

You can get the access token using the Authentication API.

To make an Authentication API call, you must set certain values in the "Configuration" menu of the online console that appears in the Authentication API page.

  1. In the online console, click Parameters.

  2. Expand Headers and add key value pair as Authorization and Base64 encoding of <username>:<password>.

    The key value pairs Content-Type: application/json and Accept: application/json is added by default.

    Note: You will get the username and password from the Always-on DNA Center Sandbox (Cisco DNA Center AO 1.3.1.6 or Cisco DNA Center AO 1.3.1.4). You must perform the Base64 encoding of that <username>:<password> using any Base64 encode tool and add the value in this format:Basic base64encoded value. For example "Basic ZGV2bmV0dXNlcjpDaXNjbzEyMyE=" as shown in the below screenshot.

  3. Click Run to request the token. The access token is displayed with 200 OK response.

  4. Copy the access token.

How to set the X-Auth-Token Header and Run a Request

  1. Once you get the access token, click the Add Headers link and create a new Header named X-Auth-Token.

  2. Paste the access token value into the right-hand field. The system automatically saves the Header value.

  3. Now you are ready to try out the DNA Center API endpoints in the online console of this interactive API documentation. Click Run to run the request. Here's an example trying out the GET /dna/intent/api/v1/network-device endpoint by clicking Run after entering the X-Auth-Token Header value.