Working with Project People
The API commands listed in this article are used for managing people involved in a Project.
projects/:project_id/people #
This command displays a list of people involved in the project and the Project Permissions included in their Project Role. Project Permissions are organized per module (Tasks, Milestones, Discussions, etc.) and can have four possible values:
- 0 - no access.
- 1 - has access, but cannot create or manage objects.
- 2 - has access and the permissions to create objects in a module.
- 3 - has access, creation and management permissions in a module.
Method: GET
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<project_users> <project_user> <user_id>1</user_id> <role_id>0</role_id> <role> <![CDATA[Custom]]> </role> <permissions> <milestone>0</milestone> <discussion>0</discussion> <file>0</file> <notebook>0</notebook> <repository>0</repository> <task>0</task> <tracking>0</tracking> </permissions> <user> <id>1</id> <name> <![CDATA[msvsbc]]> </name> ... </user> </project_user> </project_users>
projects/:project_id/people/add #
By using this command, you can add one or more Users to the Project and set their Project Permissions. This command accepts a two parameters:
- users - An array of users that you want to add to the project.
- project_permissions - An array of permission settings. Two values are relevant in this array:
- project_permissions[role_id] - The ID of the project role that the user will have in the project. This parameter is optional. If no value is entered, the system will use project_permissions[permissions].
- project_permissions[permissions] - An array of permissions for different sections that this user should have in the project. This parameter is ignored when project_permissions[role_id] is present.
Method: POST
This example request will add users with ID 39 and 52 to the project and set their project role to role #10:
1 2 3 4
submitted=submitted users[]=39 users[]=52 project_permissions[role_id]=10
And this example request will add users with ID 15 and 72 to the project, and set their permissions for Tasks and Discussions to "Has access". All other permissions will be set to "No access":
1 2 3 4 5
submitted = submitted users[] = 15 users[] = 72 project_permissions[permissions][discussion] = 1 project_permissions[permissions][task] = 1
projects/:project_id/people/:user_id/replace #
Replaces this user with another person who will work on this project. You can find out more about user replacement in this article.
Method: POST.
Request example:
1 2 3 4 5
remove_or_replace={ replace_with_id=11 send_notification=1 } submitted=submitted
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<project_users> <project_user> <user_id>11</user_id> <permissions> <milestone>0</milestone> <discussion>0</discussion> <file>0</file> <notebook>0</notebook> <repository>0</repository> <task>0</task> <tracking>0</tracking> <todo_list>0</todo_list> </permissions> <role_id>0</role_id> <role> <![CDATA[Custom]]> </role> <user> <id>11</id> <name> <![CDATA[Milenko Milenkovic]]> </name> ... </user> </project_user> </project_users>
projects/:project_id/people/:user_id/change-permissions #
This command is used for changing the set of Project Permissions for the selected user in a project.
This command accepts two parameters:
- project_permissions[role_id] - The ID of the Project Role that a user will have in the project. This parameter is optional. If a value is not set, the system will use project_permissions[permissions].
- project_permissions[permissions] - An array of permissions for different sections that the user should have in the project. This parameter is ignored when project_permissions[role_id] is present.
In this example, the Project Permissions for this user and his Project Role will be changed to Project Role #1:
1 2 3 4
project_permissions={ role_id=1 } submitted=submitted
This example request will change a user's Project Permission so that she has access to the Discussions and Tasks area. All other module permissions will be set to "No access":
1 2 3 4 5
project_permissions={ permissions][discussion] = 1 permissions][task] = 1 } submitted=submitted
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<project_users> <project_user> <user_id>7</user_id> <permissions> <milestone>0</milestone> <discussion>1</discussion> <file>0</file> <notebook>0</notebook> <repository>0</repository> <task>1</task> <tracking>0</tracking> <todo_list>0</todo_list> </permissions> <role_id>0</role_id> <role> <![CDATA[Custom]]> </role> <user> <id>7</id> ... </user> </project_user> </project_users>
projects/:project_id/people/:user_id/remove-from-project #
This command will remove a specific user from the project. If successful, this function will return a HTTP 200 OK status, and a list of project users.
Method: POST
Request example:
1
submitted = submitted
Response:
1 2 3 4 5 6 7 8 9 10
<project_users> <project_user> <user_id>1</user_id> <role_id>0</role_id> <role> <![CDATA[Custom]]> </role> ... </project_user> </project_users>