Calling joget JSON API from external website
Confluence User - 21 Sep, 2018
Hi, I am calling joget JSON API from external website. After I click the button in my external page, I got this result {"activityId":"","processId":"1003_BPM_onlineinspection"} . I want to ask, why the activityId is empty? and how do I display the run process form after the API is triggered?
here is my javascript:
<script type="text/javascript">
function UserAction(){
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML =
this.responseText;
}
});
xhr.open("POST", "http://localhost:8080/jw/web/json/workflow/process/start/BPM:8:onlineinspection?j_username=admin&j_password=admin");
xhr.setRequestHeader("content-type", "application/javascript");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.setRequestHeader("postman-token", "36eee796-48be-b719-bcbf-dbd467a1af42");
xhr.send(data);
}
</script>
jsonapi;restapi;externalwebsite