0

我正在尝试使用 jQuery 通过 API 更新 processmaker 用户,Ajax 但我不知道如何从 jQuery 发布数据Ajax 我阅读了 wiki 但不存在示例,请给我一个示例。

这是我的数据:

{
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": {
"code": 400,
"message": "Bad Request: This user: , can not update the data."
}
}
4

1 回答 1

0

我们建议您查看 AXIOS 进行 API 调用。话虽如此,您还可以查看代码和浏览器检查器以查看 ProcessMaker 4 中发生的实际 API 调用。PM4 UI 广泛使用您尝试使用的相同 API。

对于 jQuery 调用,您可以执行以下操作:

$.ajax({
  url: "http://localhost:8080/api/1.0/endpoint",
  type: 'GET',
  headers: {Authorization: 'Bearer '+token}
});
于 2021-02-02T22:47:50.243 回答