# Task candidates Rest API

**URL:** <https://community.ofelia.com/t/task-candidates-rest-api/26159>\
**Category:** Contributions\
**Tags:** rest-api-extension\
**Created:** [29 June 2020 12:18 UTC](https://community.ofelia.com/t/task-candidates-rest-api/26159 "2020-06-29T12:18:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [29 June 2020 12:18 UTC](https://community.ofelia.com/t/task-candidates-rest-api/26159/1 "2020-06-29T12:18:58Z")

</div>

# Task candidates Rest API Extension

Get the list of users that can performed a given task. Only `enabled` users are returned.

## Usage

1. Install `target/task-candidates-rest-api-1.0.0-<version>.zip` in your tenant `Resources` using Bonita Admininstration Portal

2. Call the API extension using `../API/extension/task/candidate?p=0&c=10&taskId=1001` where `p` and `c` are pagination parameters and `taskId` the task instance id

3. It will return a json array of `user` objects:

4. `o=userName ASC` can be used to sort the response array by userName, see [UserSearchDescriptor](https://documentation.bonitasoft.com/javadoc/api/7.10.5/org/bonitasoft/engine/identity/UserSearchDescriptor.html) for compatible sort descriptors.

5. `task_visualization` permission is used for this API  
  
**Repository URL :** [https://github.com/Bonitasoft-Community/task-candidates-rest-api](https://github.com/Bonitasoft-Community/task-candidates-rest-api)
