0

I'm trying to update processmaker Users by API with jQuery Ajax but I don't know how to post data from jQuery Ajax I read wiki but no sample exist please give me a sample.

This is my data:

{
usr_birthday: "2019-09-14"
usr_create_date: "2019-09-14 00:47:00"
usr_due_date: "2021-09-14"
usr_email: "Administrator@oautomation.ir"
usr_firstname: "fghf"
usr_lastname: "fghfgh"
usr_photo_path: "/opt/processmaker/workflow/public_html/images/user.gif"
usr_role: "PROCESSMAKER_OPERATOR"
usr_status: "ACTIVE"
usr_uid: "1082202175d7bf93c319774069666327"
usr_update_date: "2019-09-14 00:47:00"
usr_username: "Administrator"
usr_ux: "NORMAL"
}

Error:

{
"error": {
"code": 400,
"message": "Bad Request: This user: , can not update the data."
}
}
cursorrux
  • 1,382
  • 4
  • 9
  • 20

1 Answers1

0

We recommend you look into AXIOS for doing your API calls. That being said, you can also look into the code and the browser inspector to see the actual API calls happening in ProcessMaker 4. The PM4 UI makes extensive use of the same API you are trying to use.

For jQuery calls, you do something like this:

$.ajax({
  url: "http://localhost:8080/api/1.0/endpoint",
  type: 'GET',
  headers: {Authorization: 'Bearer '+token}
});