Complete a pending task using REST API

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2016 04:50 AM
I queried the pending tasks within a process using the REST call POST api/enterprise/tasks/query, which returned set of tasks. When I tried to complete the task using POST api/enterprise/task-forms/{taskId} and PUT api/enterprise/tasks/{taskId}/action/complete, I'm getting the forbbidden error (HTTP 403).
Using HTTPBasic authentication for making rest calls. Is there anyway I can call these REST services?
- Labels:
-
Archive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2016 08:42 AM
This is how I tested.
Using postman app (google chrome extension), I made a call with my activiti login credentials. It throwed Access forbidden error.
(OR)
Within JAVA delegate class, made the rest call. I'm getting the same error again

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2016 08:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2016 08:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2016 08:47 AM
Also afaik you need not to call PUT api/enterprise/tasks/{taskId}/action/complete separately to complete the task after submitting the form details with POST api/enterprise/task-forms/{taskId} call it will automatically complete the task…

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2016 08:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2016 09:11 AM
Also PUT api/enterprise/tasks/{taskId}/action/complete is for completing the standalone task which is not associated with a process or without a task form… So in your case I think the POST call should work…
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 06:45 PM
I am trying t do the same thing as Sindhana. I am using the POST to api/enterprise/task-forms/{taskId}. I do not have a an outcome in my json body. The user task has a form with 1 field on it with the id - "completedByInitials" and the body looks like this (from Postman) {"values":{"completedByInitials":"JDG"}}.
I am using basic auth, with the Admin credentials and impersonation with "activiti-user someone@somewher.com" and activiti-user-value-type "userEmailType". These are the same values I use to claim the task.
Any thoughts?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2016 01:17 AM
I removed "outcome" from the POST call json body and it resolved the issue. I'm able to cancel the request now.
Thanks for the information about PUT rest call too.
