I try to send on a workflow process using CS rest from js (Within a WebReport).
const input = {
comment: 'aaaabbb',
action: 'reject',
"authentification_info":
{
password: 'ppppp!'
}
};
$.ajax(
{
url: "[LL_REPTAG_URLPREFIX /]/api/v2/processes/[LL_REPTAG_!workid /]/subprocesses/[LL_REPTAG_!workid /]/tasks/[LL_REPTAG_!taskid /]",
method: "PUT",
contentType: 'application/x-www-form-urlencoded; charset=utf-8',
headers: {
"otcsticket": [LL_REPTAG_OTCSTICKET QUOTE /],
"X-Requested-With": "XMLHttpRequest",
"X-OTCS-CSRF-Token": "true"
},
data: input,
xhrFields: {
withCredentials: true // Important for cross-domain cookie sending
}
,
success: function(response) {
console.log("Success:", response);
}
,
error: function(jqXHR, textStatus, errorThrown) {
console.error("Error:", textStatus, errorThrown, jqXHR.responseJSON);
}
});
I get 400 status with a test indicating token validation error.
Obviously it is not realy a token problem since other methods work, and also if I send the same request without "action" field in input there is no error.
I guess it has something to do with the "authentification_info" input field because this process demand user authentication to sendon or reject the task.