cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1940
Views
5
Helpful
6
Replies

DNAC API - User Defined Fields

Nik1709
Level 1
Level 1

Hi everyone, 

 

Since the DNAC Sandboxes are currently all reserved and i cannot test it myself i thought i might just ask in here...

 

Does someone know if I can query user defined fields from specific devices via the DNAC API ? 

So basically i can create my own data fields in the Web GUI and now i would like to know if an API Call like "get-device by ID" or "get-device-details" will also list those user defined fields.

 

Thanks in advance! 

Kind regards, Niklas.

1 Accepted Solution

Accepted Solutions

ao1
Level 1
Level 1

Hey @Nik1709, barry.cronin@workday.com,

 

After a quick look I don't see any endpoint in the official API documentation that would allow this. If you know the device's UUID, you can query its user-defined fields via a GET request to the endpoint "/network-device/{{ uuid }}/user-defined-field". This endpoint will return JSON as follows:

{"response": [{"name": "testfield", "value": "pleaseignore"}, {"name": "testfield2", "value": "alsoignore"}], "version": "1.0"}

 

This was tested in DNAC version 2.2.3.5. Hope this is of any use.

View solution in original post

6 Replies 6

Hi @Nik1709 did you resolve this issue. I'd also like to see if I can query for user defined fields.

 

Hi @barry.cronin unfortunately I was not able to resolve this topic. I think it is just not possible natively with the DNAC API. 

ao1
Level 1
Level 1

Hey @Nik1709, barry.cronin@workday.com,

 

After a quick look I don't see any endpoint in the official API documentation that would allow this. If you know the device's UUID, you can query its user-defined fields via a GET request to the endpoint "/network-device/{{ uuid }}/user-defined-field". This endpoint will return JSON as follows:

{"response": [{"name": "testfield", "value": "pleaseignore"}, {"name": "testfield2", "value": "alsoignore"}], "version": "1.0"}

 

This was tested in DNAC version 2.2.3.5. Hope this is of any use.

Hi @ao1 thank you very much. 

After testing I can confirm that this API call works just fine.

Just out of curiosity, how do you know the call ? As you mentioned as well the api docs do not mention any user-defined-field calls at all.

Best Regards

Nik

Glad it worked!

 

DNAC has many undocumented/ internal API endpoints it uses to translate what you do in the GUI. You can see them by using the "network" tab in the web developer submenu in your browser.

I tried this and it worked really well. Thank you.