Completing User Task by using instance id

Hii,
How i can complete my User Task by using camunda rest api’s ,if i have only the instance id.P lease give me some suggestion on this.
thanks

@lalit.verma You can use task service to complete the task with task instance id.

@Autowired
private TaskService taskService;

public void completeTask(String taskInstanceId) {
   taskService.complete(taskInstanceId);
}

1 Like

Thanks @aravindhrs. Is there any rest api by which i can complete my userTask.
for eg we have an api engine-rest/task/{task id}/submit-form.but the problem here is i’m not able to get task id dynamically.

@lalit.verma you can query for active task instances, and get the task Id to complete the task.

Refer this page for querying task instances with various query criteria:

Sample response:

Thanks @aravindhrs i got it.If i will pass processInstanceId in the query parameter,then i will get all current tasks in that instance.
Thanks Again