Hi everyone,
I want to call an API (not Bonita API) from a JavaScript variable from the UI Designer. I have the following code:
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", URL, true);
xmlhttp.setRequestHeader("Authorization", ENCODED_PW);
xmlhttp.setRequestHeader("Accept", "application/json");
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send();
return xmlhttp.status;
It’s always returning a 0 error. It seems to be related CORS headers because I’m calling a cross-domain resource. When I call the API from the Studio I get the expected resource.
Any idea if I need to configure something in Bonita or if I should modify the code?
Thanks,
Clara