04-26-2022 01:48 AM
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.
Solved! Go to Solution.
05-17-2022 02:10 PM
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.
05-17-2022 03:00 AM
Hi @Nik1709 did you resolve this issue. I'd also like to see if I can query for user defined fields.
05-17-2022 03:41 AM
Hi @barry.cronin unfortunately I was not able to resolve this topic. I think it is just not possible natively with the DNAC API.
05-17-2022 02:10 PM
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.
05-17-2022 11:05 PM
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
05-19-2022 11:13 AM
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.
05-18-2022 07:55 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide