I got a basic APIC-EM system, which I can login to with the default username (admin) and pwd (secrete)
Via POSTMAN, I want to get the ticket in order to fill in the x-auth-token header.
here's the REST API I am trying to do:
POST - url: https://sandboxapic.cisco.com:9443/api/v1/ticket
Body:
{"username": "admin" , "password": "secrete"}
return error:
{"response":{"errorCode":"INVALID_CREDENTIALS","message":"Please provide valid credentials","detail":"Authentication Failed"},"version":"1.0"}
Any idea what is missing here? I followed the intro videos and tried that on my system.
Thanks,
Is that the correct URL? That's your APIC-EM, or are you trying to use a DevNet sandbox instance? What version of APIC-EM are you using?
I think you may be missing part of the header, I am using the following to obtain ticket via REST API and it's working fine.
apic_controller = 'https://10.52.145.13'
apic_uri = '/api/v1/ticket'
header = {'content-type': 'application/json'}
body = '{"username":"restapi_user","password":"restapi_Password123"}'
resp = requests.post(apic_controller + apic_uri, data=body, headers=header,verify=False)
or from browser REST client
For url: https://sandboxapic.cisco.com:9443/api/v1/ticket
Body:
{"username": "admin" , "password": "secrete"}
It's really an invalid credential. :-)
Please check Sandbox APIC-EM always on Lab.
to get the right password.
Thanks, but in the URL that you sent me there is no info about the correct password for the APIC-EM.
When I 1st got it, it showed in the login page that the username is admin and the pwd is "secrete" for the temp node.
What is the operational user for the APIC-EM? I.E for ACI, it was admin ins3965! ...
Thanks,
Tomer
You need to login first, then the Sandbox Labs Catalog will be listed in alphabetical order.
https://devnetsandbox.cisco.com/RM/Topology
Pick APIC-EM DB only always on lab and the password is in the instruction. The password won't be always the same so this is the right place to check the password.
I see, so basically https://sandboxapic.cisco.com/ is not a real APIC-EM that I can do stuff on it, I need to go to downloads and get me a real LAB to use, correct?
The temp log in node for https://sandboxapic.cisco.com/ is (Temporary Note: default login - admin / secrete) - Just wanted to make sure that this is not the correct setup to work with if I want to do REST API as the videos show.
Thanks,
First of all, https://sandboxapic.cisco.com/ is old EFT2 version and https://sandboxapic.cisco.com:9443 is GA1, the latest release.
They are all real APIC-EM servers, just DB only lab the inventory is getting from DB (which is a snapshot of real devices).
It depends on what would you like to test. The DB only lab already can be used for a lot of things(like REST API application test) but if you need to use "live" devices then you use the reservation lab which everything is live.
Thanks,
after I tried sandboxapic.cisco.com:9443, and put the pwd C!sc0123 with the user admin, as apicem_config.py shows, I am good, running the POST for that URL, with the pwd given works.
Thanks for the help!
I'm not able to access https://sandboxapic.cisco.com:9443/api/v1/ticket using admin and C!sco0123. I don't see the username and password posted for the always on lab but I do see them for the labs that require reservations.
To use API in Sandbox please try to use:
url = "https://devnetapi.cisco.com/sandbox/apic_em/api/v1/ticket"
payload = {"username":"devnetuser","password":"Cisco123!"}