- Fri Sep 21, 2018 3:16 am
#816218
Hi team
i need to call the external application REST API through the using token.
in my process marker application, i need to get it done through the java-script (by using button click). Because i want to show the return parameters form API on Dynaform fields.
please can some one help me . if you can attach the java-script code , that is good
i used following code but not working
i need to call the external application REST API through the using token.
in my process marker application, i need to get it done through the java-script (by using button click). Because i want to show the return parameters form API on Dynaform fields.
please can some one help me . if you can attach the java-script code , that is good
i used following code but not working
Code: Select all
function getDetails() {
var req = new XMLHttpRequest();
var sUrl ="api http link with parameeters";
var sTkn ="getTokenExtenalApp";
req.open("GET", sUrl , true);
req.setRequestHeader("Authorization", "Bearer " + sTkn);
alert("Error status code: " + req.setRequestHeader);
req.onreadystatechange = function() {
alert ("working");
if (req.readyState==4) {
if (req.status==200) {
var aShowRetuen = JSON.parse(req.responseText);
alert(aShowRetuen);
}
else {
alert("Error status code: " + req.status);
}
// }
req.send(null);
}
}