Looking at the first 5 APIC-EM API to get started with...
includes sample scripts.
Five APIC-EM API to improve network engineer productivity – part 1
I have 5 in the series so far:
- license
- host
- path-trace
Any suggestions for the next ones after these 5?
Adam
Hi Adam,
I think its a very nice and educational blog. Thanks for that. I really like it. For sure i`m gonna follow your blogs.
As a beginner in the world of scripting i really think this will help me.
the Network engineer in the future should know more of this.
keep the blogs coming. for sure i`m gonna red them.
Thanks
Greetings
Palermo
hi
I am running a JS code to access the APIC-EM API
================================
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<script>
var url = 'https://sandboxapic.cisco.com/api/v1/ticket';
// provide username and password as body of request
var json_text = {"username" : "devnetuser","password" : "Cisco123!"};
var x = JSON.stringify(json_text);
var xmlHttp = new XMLHttpRequest();
xmlHttp.withCredentials = true;
alert("test1");
xmlHttp.open("POST", url, true);
xmlHttp.setRequestHeader("content-type", "application/json");
alert("test2");
xmlHttp.responseType = "json";
alert("test3");
// xmlHttp.send(JSON.stringify(j_data));
//var ticket_json = JSON.parse(json_text);
xmlHttp.send(x);
alert("test4");
//alert(xmlHttp.response);
var data = JSON.parse(xmlHttp.response);
//alert(data.response.serviceTicket);
</script>
</html>
============================================
But I am getting some CORS errors and not sure how to solve them. Could you advise?
