08-07-2019 09:33 AM
Trying to start utilizing the intent API. Following documentation has not helped me as I continue to get unauthorized while using linux curl tool. I have attempted to follow the example code from within DNAC to obtain an authorization token, but have been unsuccessful. I am familiar/experienced with using python to leverage ISE APIs. Typically I will use the curl tool for the short and sweet gathering of strings that I then reference in my code. Can anyone provide guidance on gathering the authz token so that I can begin working with other APIs? Thanks in advance!
DNAC version 1.2.10.4
08-07-2019 09:59 AM
Which doc are you referring to that is not helping you ?
I think this simple introduction should explain how authorization is used in DNA-C
https://developer.cisco.com/learning/lab/dnav3-dnac-nbapi-hello-world/step/1
Basically it s using Basic Auth
The API url to use ti get token is "https://"+ip+"/dna/system/api/"+ver+"/auth/token"
To use the token for rest of api calls we need to put token in header
headers = {"X-Auth-Token": token}
Thanks,
Yawming
08-07-2019 12:38 PM
08-08-2019 09:24 AM
curl -k -u <username<:<password> -X POST https://dnacip/dna/system/api/v1/auth/token
It works
08-08-2019 12:00 PM
08-09-2019 07:31 AM
The curl has no problem.
It's either really wrong authentication or something wrong with your system
the following is always on Cisco Devnet sandbox DNA-C
curl -k -u devnetuser:Cisco123! -X POST https://sandboxdnac.cisco.com/dna/system/api/v1/auth/token
08-21-2019 12:26 PM
08-21-2019 12:40 PM
Could it be something else, not DNAC issue? 1.2.6 works for me and 1.3.0.2 works too.
08-22-2019 05:49 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