29/03/2011 05. Developer's Guide
29/03/2011 05. Developer's Guide
Developer's Guide
activecollab.com/docs/…/developers 1/72
29/03/2011 05. Developer's Guide
Authentication
activeCollab authentication system can be extended to include other "authentication sources", such is LDAP, database of other web
application (your website's CMS or forum for example). This is achieved by using Authentication Providers.
Authentication Providers
Authentication Provider is a piece of custom code that you develop in order to check users against any authentication source you wish.
Most of the code is already prepared, you only need to add things specific to your authentication source.
Important note is that Authentication Providers are not replacement for activeCollab authentication, but a bridge that can connect it to
other applications. Provider still needs to return an instance of User class that really exists in activeCollab users table.
1. initialize() - Called automatically on every request. This method is good for checking if you already have someone logged in (based on
a cookie, server or session variable etc);
2. authenticate() - Check user's credentials against authentication source. This method is called after login form is submitted and
forwards the data entered in the login form;
3. logUserIn() - Set user as logged in and do everything you need to in such situation: set session ID, save a cookie so user gets
authenticated on the next request, contact another application to let it know that user is logged in etc.
4. logUserOut() - Make sure that user is logged out. It is great to undo everything you did with logUserIn() method: destroy session and
cookie variables, contact external application that user left and so on.
require_once 'BasicAuthenticationProvider.class.php';
/**
* Custom authentication provider implementation
*/
class CustomAuthenticationProvider extends BasicAuthenticationProvider {
}
Note that we are using BasicAuthenticationProvider as a foundation for our provider. This way we get a cookie and session handling for
free, without the need to implement them once again.
Let's implement the behavior now. We want to check if user exists and that password is valid in another database after users hits Submit
button on activeCollab form. For that, we will need to override authentication method, like this:
function authenticate($credentials) {
// Inherit activeCollab authentication
$active_collab_auth = parent::authenticate($credentials);
// It failed, go for other source
if(is_error($active_collab_auth)) {
// Connect to database
if(!$link = mysql_connect('localhost', 'root', '')) {
return new Error('Failed to connect');
} // if
if(!mysql_select_db('other_application')) {
activecollab.com/docs/…/developers 2/72
29/03/2011 05. Developer's Guide
return new Error('Failed to select other_application database');
} // if
// Collect credentials
$email = trim(array_var($credentials, 'email'));
$password = array_var($credentials, 'password');
$remember = (boolean) array_var($credentials, 'remember', false);
// Find user in other database
$result = mysql_query("SELECT password FROM users WHERE email = '" . mysql_real_escape_string($email)
if($result) {
if($row = mysql_fetch_assoc($result)) {
// Password is OK
if($row['password'] == $password) {
// Let's see if we already have this user
$user = Users::findByEmail($email);
// It not lets create a new account
if(!instance_of($user, 'User')) {
$user = new User();
$user->setAttributes(array(
'email' => $email,
'password' => $row['password'],
));
$user->setCompanyId(11);
$user->resetToken();
$save = $user->save();
if(is_error($save)) {
return new Error('Failed to create an account. Reason: ' . $save->getMessage());
} // if
} // if
// And done, log user in
return $this->logUserIn($user, array(
'remember' => $remember,
'new_visit' => true,
));
} // if
} // if
} // if
return new Error('User is not registered');
} else {
return $active_collab_auth;
} // if
} // authenticate
To enable this newly created provider, open config/config.php and add the following line to the block with constant definitions:
define('AUTH_PROVIDER', 'CustomAuthenticationProvider');
activecollab.com/docs/…/developers 3/72
29/03/2011 05. Developer's Guide
function initialize() {
$user = Users::findById($_SERVER['user_id']);
if(instance_of($user, 'User')) {
return $this->logUserIn($user);
} else {
return new Error('User not recognized');
} // if
} // initialize
}
If you are properly logged in within your network, the system will skip login screen and automatically log you in every time you visit
activeCollab .
activecollab.com/docs/…/developers 4/72
29/03/2011 05. Developer's Guide
If you wish to integrate activeCollab login into your website, system lets you do two things:
1. Define a custom login form. This form submits user credentials to activeCollab and lets user log into the system directly from your
website;
2. Define an URL that is used to redirect users back to your website when they log out.
1. login[email]
2. login[password]
3. login[remember]
Additionally you need to include a "submitted" hidden field with "submitted" value for activeCollab to accept the submitted data.
Feel free to change it to fit your needs, but please make sure that names of the fields are not changed and that form action points to login
form of your activeCollab installation.
Logout URL
Since activeCollab 2 you can define URL where users will be redirected when they log out.
By default, they will be redirected back to login page unless you provide other location. To do that, open Administration > General
settings page:
At the bottom of the General Settings page there is When User Logs Out switch:
activecollab.com/docs/…/developers 5/72
29/03/2011 05. Developer's Guide
2. Once you select the field, text input field will be displayed where you can insert URL that will be used. Please note that the value of
this field needs to be a valid URL. If it's not valid, system will ignore it and redirect users to login page.
When you make the changes and submit the form, try logging out to confirm that everything is working properly.
activecollab.com/docs/…/developers 6/72
29/03/2011 05. Developer's Guide
Themes
activeCollab themes let you change the look and feel of the application without changing any core files:
Themes are per user setting, meaning that every user can pick their favorite theme from Change Settings page of his profile.
Administrators can select a default theme that is automatically selected when users are created. When default theme in administration is
changed, all user specific settings are dropped and theme is reseted for everyone to default theme.
To see how activeCollab looks like with just basic files included select Sandbox theme from your profile.
When files that apply basic styling are included, activeCollab includes theme files that overrides existing settings and adds colors and
other graphic elements. Default theme that ships with activeCollab is implemented as theme that extends sandbox and you can use it as
an example on how to create a theme of your own.
Creating a Theme
Creating a theme is as easy as creating a folder and placing a CSS file in it. To create a theme:
1. Navigate to /public/assets/themes.
2. Create a new folder. Folder name will be used as theme name by activeCollab in Select Theme field (as shown on the screenshot
bellow).
3. Create theme.css inside the theme folder you have just created. This file will be automatically included by activeCollab for all users
who select this theme from their profile pages.
4. Optionally create /images folder inside of the theme folder you've just created. Inside of theme.css write CSS rules that override
existing styling.
activecollab.com/docs/…/developers 7/72
29/03/2011 05. Developer's Guide
API
activeCollab API is a set of methods that can be called from other application. These methods are used to read and manipulate the data
stored by the system.
Making a Request
Methods are executed by calling specific URL-s and fetching formatted output. URL-s are in following format:
http://site.com/activecollab/public/api.php?path_info=#COMMAND#&token=#TOKEN#
Some requests may require more parameters. These parameters are added as regular query string (GET) parameters to the URL. Here is
an example with two additional parameters:
http://site.com/activecollab/public/api.php?path_info=#COMMAND#&token=#TOKEN#&variable1=value1&variable2=v
API URL that you need to sent request to and your token are available on API Setting page of your system profile:
1. Output Formats
Currently supported output formats are XML and JSON. There are two ways of specifying output format:
1. Recommended method is to set Accept request header. To get JSON, set it to 'application/json', or or 'application/xml' to
get XML.
2. Second method, added for convenience and to make testing easier is to add 'format' variable to a query string. Set it to
'json' to get JSON or 'xml' to get XML formatted output. Example:
http://example.com/api.php?path_info=people/1&format=json
Response status is returned with status codes. For example, you will get 200 on success, 403 if you don't have permissions to
access the page or 404 when you are trying to get an object that does not exist. You can learn more about HTTP status codes in
HTTP 1.1 documentation.
Note
When submitting data to activeCollab by using POST method, there needs to be a variable named "submitted" with value
"submitted". If you don't provide it, then activeCollab will reject your request (most probably with BAD REQUEST error).
Authentication
In order to use activeCollab API, first you will need to authenticate yourself to the system. This is what API key is for. It is available on API
page at user profile page:
activecollab.com/docs/…/developers 8/72
29/03/2011 05. Developer's Guide
When creating a request, API key needs to be passed as "token" GET variable. Sample request URL would look like this:
http://example.com/public/api.php?path_info=projects&token=1-55lTBjCvCALC6Jksg3vo2xQeymySDqFwkReL1H8s
Note
API key can be reset by user at any time. Also, it is automatically reset when user changes a password!
Disabled - All API requests are rejected. Please note that, when API is disabled, both RSS and iCalendar feeds will stop working.
Read-Only - Applications can only read data through the API, and all requests that alter or submit data are rejected. This is default
state in which activeCollab API is after installation.
Read and Write - API users can read and write data.
To change API state check for API_STATUS in your config/config.php. If that configuration directive does not exist, add the following
line to the file:
define('API_STATUS', 1);
0 - API is disabled
1 - API is read-only
2 - API supports both read and write requests
API Changes
This section contains information about changes to the API that significantly change the behavior and may break backward compatibility.
Note
This API documentation section was introduce when activeCollab 2.1 was launched.
1. activeCollab 2.1
activeCollab 2.0 introduce many improvements and some of them have resulted in changes that can break backward
compatibility:
activecollab.com/docs/…/developers 9/72
29/03/2011 05. Developer's Guide
System Information
This chapter lists commands that can be used to get information about activeCollab installation you are communicating with.
1. /info
Return system information about the installation you are working with. This information includes system versions, info about
logged user, mode in which API is, etc.
Method: GET
Example response:
<info>
<api_version>
<![CDATA[2.0]]>
</api_version>
<system_version>
<![CDATA[2.0.2]]>
</system_version>
<system_edition>
<![CDATA[corporate]]>
</system_edition>
<logged_user>
<![CDATA[http://activecollab.dev/people/1/users/1]]>
</logged_user>
<read_only>0</read_only>
</info>
1. /roles/system
Lists all system roles and role details (permissions included). For security reasons, if user is not system administrator or people
manager only default role ID is returned!
Method: GET
Example response:
<system_roles>
<system_role>
<id>...</id>
<name>...</name>
<is_default>0</is_default>
<permissions>
<system_access>1</system_access>
...
</permissions>
activecollab.com/docs/…/developers 10/72
29/03/2011 05. Developer's Guide
</system_role>
</system_roles>
2. /roles/project
Please note that system returns all project roles without checking user permissions. Each user will be able to execute this
operation and see all available project roles.
Method: GET
Example Response:
<project_roles>
<project_role>
<id>...</id>
<name>...</name>
<permissions>
<discussion>1</discussion>
...
</permissions>
</project_role>
</project_roles>
3. /roles/:role_id
Displays details of a specific role. This command can return both system and project roles and their settings.
Please note that role details are listed without checking user permissions. Each user will be able to read details of each role.
Method: GET
<system_role>
<id>...</id>
<name>...</name>
<is_default>0</is_default>
<permissions>
<system_access>1</system_access>
...
</permissions>
</system_role>
<project_role>
<id>...</id>
<name>...</name>
<permissions>
<discussion>1</discussion>
...
</permissions>
</project_role>
activecollab.com/docs/…/developers 11/72
29/03/2011 05. Developer's Guide
Working with Companies and Users
activeCollab offers several commands that let other applications create and manage company and user accounts.
1. Company Fields
1. name (string) - Company name. Value of this field is required and needs to be unique in the entire system.
2. User Fields
1. email (string) - User's email address. Value of this field is required when user account is created, it needs to be properly
formatted and there can be only one user with a given email address in the system.
2. password (string) - User's password. Value of this field is required when user account is created and minimal length is 3
characters.
3. first_name (string) -First name
4. last_name (string) - Last name
5. role_id (integer) - ID of the user's system role. Only administrators or people managers are able to change value of this
field.
Note
When new user account is created, user can set role_id to custom value only if he is Administrator or People Manager. If user
who creates an account is not Administrator or People manager, users role will be set to default role configured on
Administration > Roles page.
3. /people
Lists all companies defined in the system (both, active and archived companies).
Method: GET
Example response:
<companies>
<company>
<id>...</id>
<name>...</name>
<created_on>...</created_on>
<permalink>...</permalink>
<office_address>...</office_address>
<office_phone>...</office_phone>
<office_fax>...</office_fax>
<office_homepage>...</office_homepage>
</company>
</companies>
4. /people/add-company
This command will create a new company. On success, details of newly created company will be returned
Method: POST
Request example:
submitted=submitted
company[name]=New Company
Example response:
<company>
<id>...</id>
activecollab.com/docs/…/developers 12/72
29/03/2011 05. Developer's Guide
<name>...</name>
<created_on>...</created_on>
<permalink>...</permalink>
<office_address></office_address>
<office_phone></office_phone>
<office_fax></office_fax>
<office_homepage></office_homepage>
</company>
5. /people/:company_id
Method: GET.
Example response:
<company>
<id>...</id>
<name>...</name>
<created_on>...</created_on>
<permalink>...</permalink>
<office_address></office_address>
<office_phone></office_phone>
<office_fax></office_fax>
<office_homepage></office_homepage>
<users>
...
</users>
<logo_url>...</logo_url>
</company>
6. /people/:company_id/edit
Updates properties of an existing company. On success, updated company details are returned.
Method: POST.
Request example:
submitted=submitted
company[name]=Updated Company Name
Response example:
<company>
<id>...</id>
<name>...</name>
<created_on>...</created_on>
<permalink>...</permalink>
<office_address></office_address>
<office_phone></office_phone>
<office_fax></office_fax>
<office_homepage></office_homepage>
</company>
7. /people/:company_id/delete
Delete a company and all of its users. Projects this company and its users are related to will not be deleted! On success, system
activecollab.com/docs/…/developers 13/72
29/03/2011 05. Developer's Guide
returns HTTP status 200 OK.
Note
Method: POST.
Request example:
submitted=submitted
8. /people/:company_id/add-user
Creates a user account in the selected company. On success, function displays details of newly created user account.
Note
Only Administrators and People Managers can set role_id value. If user who creates new account is not Administrator or
People Manager, default role ID will be used.
Method: POST.
Request example:
submitted = submitted
user[email] = [email protected]
user[password] = new-password
user[password_a] = new-password
user[role_id] = 1
Response:
<user>
<id>...</id>
<company_id>...</company_id>
<first_name>...</first_name>
<last_name>...</last_name>
<email>...</email>
<last_visit_on>...</last_visit_on>
<permalink>...</permalink>
<role_id>...</role_id>
<is_administrator>...</is_administrator>
<is_project_manager>...</is_project_manager>
<is_people_manager>...</is_people_manager>
<token>...</token>
</user>
9. /people/:company_id/users/:user_id
Method: GET
Example response:
<user>
<id>...</id>
<first_name>...</first_name>
<last_name>...</last_name>
<email>...</email>
activecollab.com/docs/…/developers 14/72
29/03/2011 05. Developer's Guide
<last_visit_on>...</last_visit_on>
<permalink>...</permalink>
<role_id>...</role_id>
<is_administrator>...</is_administrator>
<is_project_manager>...</is_project_manager>
<is_people_manager>...</is_people_manager>
<token>...</token>
<company>
<id>...</id>
<name>...</name>
<created_on>...</created_on>
<permalink>...</permalink>
<office_address>...</office_address>
<office_phone>...</office_phone>
<office_fax>...</office_fax>
<office_homepage>...</office_homepage>
</company>
<avatar_url>...</avatar_url>
</user>
10. /people/:company_id/users/:user_id/edit
Method: POST.
Request example:
submitted = submitted
user[first_name] = John
user[last_name] = Doe
Example response:
<user>
<id>...</id>
<first_name>...</first_name>
<last_name>...</last_name>
<email>...</email>
<last_visit_on>...</last_visit_on>
<permalink>...</permalink>
<role_id>...</role_id>
<is_administrator>...</is_administrator>
<is_project_manager>...</is_project_manager>
<is_people_manager>...</is_people_manager>
<token>...</token>
<company>
<id>...</id>
<name>...</name>
<created_on>...</created_on>
<permalink>...</permalink>
<office_address>...</office_address>
<office_phone>...</office_phone>
<office_fax>...</office_fax>
<office_homepage>...</office_homepage>
</company>
<avatar_url>...</avatar_url>
</user>
activecollab.com/docs/…/developers 15/72
29/03/2011 05. Developer's Guide
11. /people/:company_id/users/:user_id/delete
Note
Data created by this user - project, tickets, discussions, comments, etc. will not be deleted.
Method: POST.
Request example:
submitted = submitted
1. Project Fields
2. /projects
Shows all projects that the authenticated user has access to. This function will show active, paused, completed and canceled
projects.
Method: GET
Example response:
<projects>
<project>
<id>1</id>
<name>
<![CDATA[First Project]]>
</name>
<overview>
<![CDATA[<p>This is overview of the first project</p>]]>
</overview>
<status>
<![CDATA[active]]>
</status>
<type>...</type>
<permalink>...</permalink>
<leader_id>...</leader_id>
<company_id>...</company_id>
<group_id>...</group_id>
</project>
</projects>
3. /projects/add
activecollab.com/docs/…/developers 16/72
29/03/2011 05. Developer's Guide
Creates a new project.
Method: POST.
Additionally you can include project_template_id variable. It needs to be a valid project ID. If this variable is present, new
project will be created based on that project as a template.
Example request:
submitted=submitted
project[name] = Testing API
project[leader_id] = 1
Response:
<project>
<id>2</id>
<name>
<![CDATA[Created through API]]>
</name>
<overview></overview>
<status>
<![CDATA[active]]>
</status>
<permalink>...</permalink>
<leader_id>...</leader_id>
<company_id>...</company_id>
<group_id>...</group_id>
</project>
4. /projects/:project_id
Shows the properties of the specific project. In addition to project properties, this request also returns:
Method: GET
Example response:
<project>
<id>2</id>
<name>
<![CDATA[Created through API]]>
</name>
<overview></overview>
<status>
<![CDATA[active]]>
</status>
<permalink>...</permalink>
<leader>...</leader>
<company_id>0</company_id>
<group_id>0</group_id>
<logged_user_permissions>
<role>
<![CDATA[administrator]]>
</role>
activecollab.com/docs/…/developers 17/72
29/03/2011 05. Developer's Guide
<permissions>
<milestone>3</milestone>
<discussion>3</discussion>
<file>3</file>
<page>3</page>
<ticket>3</ticket>
<timerecord>3</timerecord>
</permissions>
</logged_user_permissions>
<icon_url>...</icon_url>
</project>
5. /projects/:project_id/edit
Method: POST.
Request example:
submitted = submitted
project[name] = New name
project[company_id] = 16
<project>
<id>2</id>
<name>
<![CDATA[New name]]>
</name>
<overview></overview>
<status>
<![CDATA[active]]>
</status>
<permalink>...</permalink>
<leader_id>15</leader_id>
<company_id>16</company_id>
<group_id>0</group_id>
</project>
6. /projects/:project_id/edit-status
1. active
2. paused
3. completed
4. canceled
Method: POST.
Request example:
submitted = submitted
project[status] = completed
Response:
<project>
activecollab.com/docs/…/developers 18/72
29/03/2011 05. Developer's Guide
<id>2</id>
<name>
<![CDATA[Project Name]]>
</name>
<overview></overview>
<status>
<![CDATA[completed]]>
</status>
<permalink>...</permalink>
<leader_id>15</leader_id>
<company_id>16</company_id>
<group_id>0</group_id>
</project>
7. /projects/:project_id/delete
Delete selected project. On success, system returns HTTP status 200 OK.
Note
Method: POST.
Request example:
submitted=submitted
8. /projects/:project_id/user-tasks
Returns all tasks that are assigned to the logged in user in a particular project.
Method: GET
<assignments>
<assignment>
<id>10</id>
<type>
<![CDATA[Ticket]]>
</type>
<name>
<![CDATA[One ticket]]>
</name>
<body>...</body>
<state>3</state>
<visibility>0</visibility>
<created_on>2009-03-24 13:44:34</created_on>
<created_by_id>15</created_by_id>
<updated_on></updated_on>
<updated_by_id>0</updated_by_id>
<version>1</version>
<permalink>...</permalink>
<priority>0</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>0</completed_by_id>
<project_id>2</project_id>
<parent_id>0</parent_id>
activecollab.com/docs/…/developers 19/72
29/03/2011 05. Developer's Guide
<milestone_id>0</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
<ticket_id>1</ticket_id>
</assignment>
</assignments>
1. /projects/:project_id/people
Returns the list of people involved with a project and their permissions. Permissions are per module and have 4 possible values:
0 - no access
1 - has access, but can't create or manage objects
2 - has access and permission to create objects in a given module
3 - has access, creation and management permissions in a given module
Method: GET
Response:
<project_users>
<project_user>
<user_id>15</user_id>
<role>
<![CDATA[administrator]]>
</role>
<permissions>
<milestone>3</milestone>
<discussion>3</discussion>
<file>3</file>
<page>3</page>
<ticket>3</ticket>
<timerecord>3</timerecord>
</permissions>
<permalink>...</permalink>
</project_user>
<project_user>
<user_id>16</user_id>
<role>
<![CDATA[custom]]>
</role>
<permissions>
<milestone>1</milestone>
<discussion>1</discussion>
<file>1</file>
<page>2</page>
<ticket>2</ticket>
<timerecord>2</timerecord>
</permissions>
activecollab.com/docs/…/developers 20/72
29/03/2011 05. Developer's Guide
</project_user>
</project_users>
2. /projects/:project_id/people/add
Using this command, you can add one or more users to the project and set their permissions. This command accepts two
parameters:
Method: POST
This request will add users with ID-s 39 and 52 to the project and set their project role to role #10:
submitted=submitted
users[]=39
users[]=52
project_permissions[role_id]=10
This request will add users with ID-s 15 and 72 to the project, and set their permissions of tickets and discussions module to
Has access. All other sections will be set to No access:
submitted = submitted
users[] = 15
users[] = 72
project_permissions[permissions][discussion] = 1
project_permissions[permissions][ticket] = 1
3. /projects/:project_id/people/:user_id/change-permissions
Change permissions command accepts one parameter (project_permissions) with two fields:
1. project_permissions[role_id] - ID of the project role users will have in the project. This parameter is optional. If value is
not present, system will use project_permissions[permissions].
2. project_permissions[permissions] - Array of permissions for different sections users will have in the project. This
parameter is ignored when project_permissions[role_id] is present.
This request will change user permissions and his project role to role #10:
submitted=submitted
project_permissions[role_id]=10
This request will change user's permission so he has access to tickets and discussions module. All other sections will be set to
No access:
submitted = submitted
project_permissions[permissions][discussion] = 1
project_permissions[permissions][ticket] = 1
activecollab.com/docs/…/developers 21/72
29/03/2011 05. Developer's Guide
4. /projects/:project_id/people/:user_id/remove-from-project
Removes specific user from the project. On success, this function returns HTTP 200 OK status.
Method: POST
Note
Work with project groups through API is added to activeCollab 1.1.4 and is not available in older versions.
1. name (string) - Group name. Value of this field is required and it needs to be unique.
2. projects/groups
Method: GET.
Example response:
<project_groups>
<project_group>
<id>1</id>
<name>
<![CDATA[Default]]>
</name>
</project_group>
<project_group>
<id>2</id>
<name>
<![CDATA[First Group]]>
</name>
</project_group>
</project_groups>__
3. projects/groups/add
Method: POST.
Request example:
submitted=submitted
project_group[name] = Development
Response:
<project_group>
<id>4</id>
<name>
<![CDATA[Development]]>
</name>
</project_group>
activecollab.com/docs/…/developers 22/72
29/03/2011 05. Developer's Guide
4. projects/groups/:project_group_id
Method: GET.
<project_group>
<id>2</id>
<name>
<![CDATA[First Group]]>
</name>
<projects>
<project>
<id>1</id>
<name>
<![CDATA[First Project]]>
</name>
<overview>
<![CDATA[<p>This is overview of the first project</p>]]>
</overview>
<status>
<![CDATA[active]]>
</status>
<permalink>...</permalink>
<leader_id>15</leader_id>
<company_id>16</company_id>
<group_id>2</group_id>
</project>
</projects>
</project_group>
5. projects/groups/:project_group_id/edit
Method: POST.
Request example:
submitted=submitted
project_group[name] = Update group name
Response:
<project_group>
<id>2</id>
<name>
<![CDATA[Update group name]]>
</name>
</project_group>
6. projects/groups/:project_group_id/delete
Removes project group from database. On success, system will return HTTP status 200, OK.
Method: POST.
Note
activecollab.com/docs/…/developers 23/72
29/03/2011 05. Developer's Guide
Only empty project groups can be deleted.
Request example:
submitted=submitted
1. Discussion Fields
1. name (string) - Discussion topic. This field is required when topic is created.
2. body (string) - First message body. This field is required when topic is created.
3. tags (string) - List of comma-separated tags.
4. visibility (integer) - Discussion visibility. 0 is private and 1 is normal visibility.
5. milestone_id (integer) - ID of parent milestone.
6. parent_id (integer) - ID of parent category.
2. /projects/:project_id/discussions
Method: GET.
Example response:
<discussions>
<discussion>
<id>11</id>
<type>
<![CDATA[Discussion]]>
</type>
<name>
<![CDATA[Updated Name]]>
</name>
<body>
<![CDATA[This is first message!]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
</permissions>
</discussion>
</discussions>
activecollab.com/docs/…/developers 24/72
29/03/2011 05. Developer's Guide
3. /projects/:project_id/discussions/add
Method: POST.
Request example:
submitted=submitted
discussion[name] = New Discussion
discussion[body] = This is first message!
Response:
<discussion>
<id>11</id>
<type>
<![CDATA[Discussion]]>
</type>
<name>
<![CDATA[New Discussion]]>
</name>
<body>
<![CDATA[This is first message!]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>15</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
</permissions>
</discussion>
4. /projects/:project_id/discussions/:discussion_id
In addition to discussion details, this command also returns all comments people posted here as part of the comments
property.
Method: GET
Response:
<discussion>
<id>11</id>
activecollab.com/docs/…/developers 25/72
29/03/2011 05. Developer's Guide
<type>
<![CDATA[Discussion]]>
</type>
<name>
<![CDATA[New Discussion]]>
</name>
<body>
<![CDATA[This is first message!]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<comments>
<comment>
<id>12</id>
<type>
<![CDATA[Comment]]>
</type>
<name>
<![CDATA[Comment on New Discussion]]>
</name>
<body>
<![CDATA[<p>First discussion</p>]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
</permissions>
</comment>
</comments>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
activecollab.com/docs/…/developers 26/72
29/03/2011 05. Developer's Guide
</permissions>
</discussion>
5. /projects/:project_id/discussions/:discussion_id/edit
Method: POST.
Request example:
submitted=submitted
discussion[name] = Updated Name
parent_id = 1
Response:
<discussion>
<id>11</id>
<type>
<![CDATA[Discussion]]>
</type>
<name>
<![CDATA[Updated Name]]>
</name>
<body>
<![CDATA[This is first message!]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
</permissions>
</discussion>
Note
By default, Checklists module is not installed in activeCollab Corporate and these commands are not available. To install it, go to
Administration > Modules page and install it from the list of Available Modules.
1. Checklist Fields
activecollab.com/docs/…/developers 27/72
29/03/2011 05. Developer's Guide
1. name (string) - Object name or short, one line summary. Value of this field is required when checklist is created
2. body (text) - Full checklist description. Use HTML for formatting.
3. tags (string) - List of comma-separated object tags.
4. visibility (integer) - Object visibility. 0 is private and 1 is normal visibility.
5. milestone_id (integer) - ID of parent milestone.
2. /projects/:project_id/checklists
Method: GET.
Example response:
<checklists>
<checklist>
<id>13</id>
<type>
<![CDATA[Checklist]]>
</type>
<name>
<![CDATA[Updated name]]>
</name>
<body>
<![CDATA[Full description of this checklist]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>...</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
</checklist>
</checklists>
3. /projects/#project_id/checklists/archive
Method: GET.
Example response:
activecollab.com/docs/…/developers 28/72
29/03/2011 05. Developer's Guide
<checklists>
<checklist>
<id>13</id>
<type>
<![CDATA[Checklist]]>
</type>
<name>
<![CDATA[Updated name]]>
</name>
<body>
<![CDATA[Full description of this checklist]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>...</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
</checklist>
</checklists>
4. /projects/:project_id/checklists/add
Method: POST.
Request example:
submitted=submitted
checklist[name] = New checklist
checklist[body] = Full description of this checklist
checklist[visibility] = 1
Response:
<checklist>
<id>13</id>
<type>
<![CDATA[Checklist]]>
</type>
activecollab.com/docs/…/developers 29/72
29/03/2011 05. Developer's Guide
<name>
<![CDATA[New checklist]]>
</name>
<body>
<![CDATA[Full description of this checklist]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>...</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>1</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
</checklist>
5. /projects/:project_id/checklists/:checklist_id
This request also returns array of tasks attached to this checklist in the tasks property.
Method: GET.
Example response:
<checklist>
<id>13</id>
<type>
<![CDATA[Checklist]]>
</type>
<name>
<![CDATA[New checklist]]>
</name>
<body>
<![CDATA[Full description of this checklist]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
activecollab.com/docs/…/developers 30/72
29/03/2011 05. Developer's Guide
<permalink>...</permalink>
<priority>...</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<tasks>
...
</tasks>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
</checklist>
6. /projects/:project_id/checklists/:checklist_id/edit
Method: POST.
Request example:
submitted=submitted
checklist[name] = Updated name
Response:
<checklist>
<id>13</id>
<type>
<![CDATA[Checklist]]>
</type>
<name>
<![CDATA[Updated name]]>
</name>
<body>
<![CDATA[Full description of this checklist]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>...</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
activecollab.com/docs/…/developers 31/72
29/03/2011 05. Developer's Guide
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
</checklist>
1. File Fields
2. /projects/:project_id/files
Method: GET.
Example response:
<files>
<file>
<id>17</id>
<type>
<![CDATA[File]]>
</type>
<name>
<![CDATA[New-Name.png]]>
</name>
<body>
<![CDATA[Optional file description]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
activecollab.com/docs/…/developers 32/72
29/03/2011 05. Developer's Guide
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
</permissions>
</file>
</files>
3. /projects/:project_id/files/upload-single
If name property is not provided, system will use original file name.
Method: POST.
Additional requirement is a file to be uploaded (any name will work, but we recommend that you name file field 'attachment').
Request example:
submitted = submitted
file[name] = new_file.png
file[body] = Optional file description
Response:
<file>
<id>17</id>
<type>
<![CDATA[File]]>
</type>
<name>
<![CDATA[new_file.png]]>
</name>
<body>
<![CDATA[Optional file description]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
</permissions>
</file>
4. /projects/:project_id/files/:file_id
activecollab.com/docs/…/developers 33/72
29/03/2011 05. Developer's Guide
Displays file details.
In addition to file details, information about each file revision is provided as value of revisions property.
Method: GET.
<file>
<id>17</id>
<type>
<![CDATA[File]]>
</type>
<name>
<![CDATA[new_file.png]]>
</name>
<body>
<![CDATA[Optional file description]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
</permissions>
<revisions>
...
</revisions>
</file>
5. /projects/:project_id/files/:file_id/edit
Method: POST.
Example request:
submitted = submitted
file[name] = New-Name.png
Response:
<file>
<id>17</id>
<type>
<![CDATA[File]]>
</type>
<name>
activecollab.com/docs/…/developers 34/72
29/03/2011 05. Developer's Guide
<![CDATA[New-Name.png]]>
</name>
<body>
<![CDATA[Optional file description]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
</permissions>
</file>
1. Milestone Fields
1. name (string) - Milestone summary. Value of this field is required when milestone is created.
2. body (text) - File Description.
3. start_on (date) - Date when the milestone starts. Value of this field is required when milestone is created.
4. due_on (date) - Date when the milestone is due. Value of this field is required when milestone is created.
5. priority (integer) - Milestone priority. Priority can have five integer values ranging from -2 (lowest) to 2 (highest). 0 is
normal.
6. assignees (array) - Array of people assigned to the object. First element of array is list of assignees (as array). Second
parameter is an ID of the person responsible for a task (ID must be in the first list).
7. tags (string) - List of comma-separated tags for milestone.
8. visibility (integer) - Object visibility. 0 is private and 1 is normal visibility.
2. /projects/:project_id/milestones
Method: GET.
Response example:
<milestones>
<milestone>
<id>18</id>
<type>
<![CDATA[Milestone]]>
</type>
<name>
<![CDATA[Update name]]>
</name>
<body>...</body>
<state>...</state>
activecollab.com/docs/…/developers 35/72
29/03/2011 05. Developer's Guide
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>...</priority>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
<start_on>2008-05-05</start_on>
<due_on>2008-05-08</due_on>
</milestone>
</milestones>
3. /projects/:project_id/milestones/add
Method: POST.
Example request:
submitted = submitted
milestone[name] = Test milestone
milestone[start_on] = 2008-05-05
milestone[due_on] = 2008-05-08
Response:
<milestone>
<id>18</id>
<type>
<![CDATA[Milestone]]>
</type>
<name>
<![CDATA[Test milestone]]>
</name>
<body>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
activecollab.com/docs/…/developers 36/72
29/03/2011 05. Developer's Guide
<priority>...</priority>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
<start_on>2008-05-05</start_on>
<due_on>2008-05-08</due_on>
</milestone>
4. /projects/:project_id/milestones/:milestone_id
Method: GET
Example response:
<milestone>
<id>18</id>
<type>
<![CDATA[Milestone]]>
</type>
<name>
<![CDATA[Test milestone]]>
</name>
<body>...</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>...</priority>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<assignees>...</assignees>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
<start_on>2008-05-05</start_on>
<due_on>2008-05-08</due_on>
</milestone>
activecollab.com/docs/…/developers 37/72
29/03/2011 05. Developer's Guide
5. /projects/:project_id/milestones/:milestone_id/edit
Method: POST.
Request example:
submitted = submitted
milestone[name] = Update name
Response:
milestone>
<id>18</id>
<type>
<![CDATA[Milestone]]>
</type>
<name>
<![CDATA[Update name]]>
</name>
<body>...</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>...</priority>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
<start_on>2008-05-05</start_on>
<due_on>2008-05-08</due_on>
</milestone>
1. Ticket Fields
1. name (string) - Ticket summary. Value of this field is required when ticket is created.
2. body (text) - Full ticket description.
3. tags (string) - List of comma-separated object tags.
4. visibility (integer) - Object visibility. 0 is private and 1 is normal visibility.
5. priority (integer) - Priority can have one of the five integer values, ranging from -2 (lowest) to 2 (highest). 0 is normal.
6. due_on (date) - Ticket due date
activecollab.com/docs/…/developers 38/72
29/03/2011 05. Developer's Guide
7. assignees (array) - Array of people assigned to the ticket. First element of array is list of assignees (as array). Second
parameter is an ID of the person responsible for the ticket (ID must be in the first list).
8. milestone_id (integer) - ID of the parent milestone.
9. parent_id (integer) - ID of the parent object (category, ticket for tasks, and so on).
2. /projects/:project_id/tickets
Method: GET
<tickets>
<ticket>
<id>9</id>
<type>
<![CDATA[Ticket]]>
</type>
<name>
<![CDATA[Updated summary]]>
</name>
<body>...</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>...</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
<ticket_id>1</ticket_id>
</ticket>
</tickets>
3. /projects/:project_id/tickets/archive
Method: GET
<tickets>
<ticket>
<id>9</id>
<type>
<![CDATA[Ticket]]>
activecollab.com/docs/…/developers 39/72
29/03/2011 05. Developer's Guide
</type>
<name>
<![CDATA[Updated summary]]>
</name>
<body>...</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>...</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
<ticket_id>1</ticket_id>
</ticket>
</tickets>
4. /projects/:project_id/tickets/add
Method: POST.
Request example:
submitted = submitted
ticket[name] = This is summary
Response:
<ticket>
<id>19</id>
<type>
<![CDATA[Ticket]]>
</type>
<name>
<![CDATA[This is summary]]>
</name>
<body>...</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
activecollab.com/docs/…/developers 40/72
29/03/2011 05. Developer's Guide
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>...</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
<ticket_id>2</ticket_id>
</ticket>
5. /projects/:project_id/tickets/:ticket_id
Method: GET
Note
When making a request, please use ticket ID for that particular project, not project object ID.
<ticket>
<id>9</id>
<type>
<![CDATA[Ticket]]>
</type>
<name>
<![CDATA[My ticket]]>
</name>
<body>...</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>...</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<comments>
...
</comments>
activecollab.com/docs/…/developers 41/72
29/03/2011 05. Developer's Guide
<tasks>
...
</tasks>
<attachments>
...
</attachments>
<assignees>
...
</assignees>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
<ticket_id>1</ticket_id>
</ticket>
6. /projects/:project_id/tickets/:ticket_id/edit
Method: POST.
Note
When making a request, please use the ticket ID for that particular project, not project object ID.
Reqest example:
submitted = submitted
ticket[name] = Updated summary
Response:
<ticket>
<id>9</id>
<type>
<![CDATA[Ticket]]>
</type>
<name>
<![CDATA[Updated summary]]>
</name>
<body>...</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>
<![CDATA[http://localhost/corporate_12/public/index.php?path_info=projects%2F1%2Ftickets%2F1]]
</permalink>
<priority>...</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
activecollab.com/docs/…/developers 42/72
29/03/2011 05. Developer's Guide
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>1</can_move>
<can_copy>1</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
<ticket_id>1</ticket_id>
</ticket>
1. Time Fields
Legacy fields:
In activeCollab 1.1.5 is_billable and is_billed fields were replaced with billable_status field. These two fields are still available
for compatibility reasons:
2. /projects/:project_id/time
Method: GET
<time_records>
<time_record>
<id>20</id>
<type>
<![CDATA[TimeRecord]]>
</type>
<name>
<![CDATA[3.75 hours]]>
</name>
<body>...</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
activecollab.com/docs/…/developers 43/72
29/03/2011 05. Developer's Guide
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
</permissions>
<billable_status>0</billable_status>
<value>3.75</value>
<record_date>2008-05-01</record_date>
<is_billable>0</is_billable>
<is_billed>0</is_billed>
<user_id>1</user_id>
</time_record>
</time_records>
3. /projects/:project_id/time/add
Method: POST
Request example:
submitted = submitted
time[user_id] = 1
time[value] = 3:30
time[record_date] = 2008-05-01
Response:
<time_record>
<id>20</id>
<type>
<![CDATA[TimeRecord]]>
</type>
<name>
<![CDATA[3.5 hours]]>
</name>
<body>...</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>1</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
activecollab.com/docs/…/developers 44/72
29/03/2011 05. Developer's Guide
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
</permissions>
<billable_status>0</billable_status>
<value>3.5</value>
<record_date>2008-05-01</record_date>
<is_billable>...</is_billable>
<is_billed>...</is_billed>
<user_id>1</user_id>
</time_record>
4. /projects/:project_id/time/:record_id
Method: GET
Example response:
<time_record>
<id>20</id>
<type>
<![CDATA[TimeRecord]]>
</type>
<name>
<![CDATA[3.5 hours]]>
</name>
<body>...</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
</permissions>
<billable_status>0</billable_status>
<value>3.5</value>
<record_date>2008-05-01</record_date>
<is_billable>0</is_billable>
<is_billed>0</is_billed>
<user_id>1</user_id>
</time_record>
activecollab.com/docs/…/developers 45/72
29/03/2011 05. Developer's Guide
5. /projects/:project_id/time/:record_id/edit
Method: POST
Request example:
submitted = submitted
time[value] = 3:45
Response:
<time_record>
<id>20</id>
<type>
<![CDATA[TimeRecord]]>
</type>
<name>
<![CDATA[3.75 hours]]>
</name>
<body>...</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
</permissions>
<billable_status>...</billable_status>
<value>3.75</value>
<record_date>2008-05-01</record_date>
<is_billable>0</is_billable>
<is_billed>0</is_billed>
<user_id>1</user_id>
</time_record>
1. Page Fields
1. name (string) - Page title. Value of this field is required when page is created.
2. body (text) - Page body. Value of this field is required when page is created.
3. tags (string) - List of comma-separated tags.
4. visibility (integer) - Object visibility. 0 is private and 1 is normal visibility.
5. milestone_id (integer) - ID of the parent milestone.
6. parent_id (integer) - ID of the parent object (category, ticket for tasks so on). Value of this field is required when page is
activecollab.com/docs/…/developers 46/72
29/03/2011 05. Developer's Guide
created.
2. /projects/:project_id/pages
Method: GET
<categories>
<category>
<id>3</id>
<type>
<![CDATA[Category]]>
</type>
<name>
<![CDATA[General]]>
</name>
<body>...</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>1</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
</permissions>
</category>
</categories>
3. /projects/:project_id/pages/add
Method: POST.
Request example:
submitted = submitted
page[name] = New Page
page[body] = Page content
page[parent_id] = 12
Response:
<page>
<id>21</id>
<type>
<![CDATA[Page]]>
</type>
activecollab.com/docs/…/developers 47/72
29/03/2011 05. Developer's Guide
<name>
<![CDATA[New Page]]>
</name>
<body>
<![CDATA[Page content]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>3</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
</permissions>
<revision_num>1</revision_num>
</page>
4. /projects/:project_id/pages/:page_id
Method: GET
Example response:
<page>
<id>21</id>
<type>
<![CDATA[Page]]>
</type>
<name>
<![CDATA[New Page]]>
</name>
<body>
<![CDATA[<p>Page content. Made a couple of changes to make a new version</p>]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<comments>
...
activecollab.com/docs/…/developers 48/72
29/03/2011 05. Developer's Guide
</comments>
<tasks>
...
</tasks>
<attachments>
...
</attachments>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
</permissions>
<revision_num>2</revision_num>
<subpages>
...
</subpages>
<revisions>
...
</revisions>
</page>
5. /projects/:project_id/pages/:page_id/edit
By setting is_minor_revision to 1 when updating the page, system will consider changes to be a minor change and will not
create a new page revision. Email notification will not be sent to subscribers in this case.
Method: POST
Request example:
submitted = submitted
page[name] = New Name
page[is_minor_revision] = 1
Response:
<page>
<id>21</id>
<type>
<![CDATA[Page]]>
</type>
<name>
<![CDATA[New Name]]>
</name>
<body>
<![CDATA[<p>Page content. Made a couple of changes to get a new version</p>]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
activecollab.com/docs/…/developers 49/72
29/03/2011 05. Developer's Guide
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
</permissions>
<revision_num>3</revision_num>
</page>
6. /projects/:project_id/pages/:page_id/archive
Marks selected page as archived. On success, system will return updated page details.
Method: POST.
7. /projects/:project_id/pages/:page_id/unarchive
Marks selected page as archived. On success, system will return updated page details.
Method: POST.
1. /status
Lists 50 recent status messages. Pass user_id through query string to filter only messages posted by the specific user.
Method: GET
Example response:
<messages>
<message>
<message>
<![CDATA[It works great]]>
</message>
<created_on>2009-03-24 19:07:09</created_on>
<created_by>
<id>15</id>
<name>
<![CDATA[[email protected]]]>
</name>
</created_by>
</message>
</messages>
2. /status/add
Method: POST
Example request:
activecollab.com/docs/…/developers 50/72
29/03/2011 05. Developer's Guide
submitted = submitted
status[message] = I did something interesting
Response:
<message>
<message>
<![CDATA[I did something interesting]]>
</message>
<created_on>2009-03-24 19:19:37</created_on>
<created_by>
<id>15</id>
<name>
<![CDATA[[email protected]]]>
</name>
</created_by>
</message>
1. Comment Fields
1. body (string) - Comment body. Value of this field is required when new comment is created.
2. /projects/:project_id/comments/add&parent_id=:parent_id
Method: POST.
Request example:
submitted = submitted
comment[body] = My comment!
Response:
<comment>
<id>23</id>
<type>
<![CDATA[Comment]]>
</type>
<name>
<![CDATA[Comment on One ticket]]>
</name>
<body>
<![CDATA[My comment!]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
activecollab.com/docs/…/developers 51/72
29/03/2011 05. Developer's Guide
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
</permissions>
</comment>
3. /projects/:project_id/comments/:comment_id
Method: GET
<comment>
<id>23</id>
<type>
<![CDATA[Comment]]>
</type>
<name>
<![CDATA[Comment on One ticket]]>
</name>
<body>
<![CDATA[My comment!]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>2</project_id>
<parent_id>10</parent_id>
<milestone_id>
</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
</permissions>
</comment>
4. /projects/:project_id/comments/:comment_id/edit
Method: POST
Request example:
submitted = submitted
comment[body] = Updating my comment!
activecollab.com/docs/…/developers 52/72
29/03/2011 05. Developer's Guide
Response:
<comment>
<id>23</id>
<type>
<![CDATA[Comment]]>
</type>
<name>
<![CDATA[Comment on One ticket]]>
</name>
<body>
<![CDATA[Updating my comment!]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
</permissions>
</comment>
1. Task Fields
1. body (text) - Task summary. Value of this field is required when new task is added.
2. priority (integer) - Priority can have five integer values ranging from -2 (lowest) to 2 (highest). 0 is normal.
3. due_on (date) - When task is due.
4. assignees (array) - Array of people assigned to the object. First element of array is list of assignees (as array). Second
parameter is an ID of a person responsible for a task (ID must be in the first list).
2. /projects/:project_id/tasks/add&parent_id=:parent_id
Method: POST
Request example:
submitted = submitted
task[body] = Go shopping
task[priority] = -2
Response:
<task>
activecollab.com/docs/…/developers 53/72
29/03/2011 05. Developer's Guide
<id>25</id>
<type>
<![CDATA[Task]]>
</type>
<name>
<![CDATA[Go shopping]]>
</name>
<body>
<![CDATA[Go shopping]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>-2</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
</task>
3. /projects/:project_id/tasks/:task_id
Method: GET.
Example response:
<task>
<id>25</id>
<type>
<![CDATA[Task]]>
</type>
<name>
<![CDATA[Go shopping]]>
</name>
<body>
<![CDATA[Go shopping]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
activecollab.com/docs/…/developers 54/72
29/03/2011 05. Developer's Guide
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>-2</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
</task>
4. /projects/:project_id/tasks/:task_id/edit
Method: POST
Request example:
submitted = submitted
task[priority] = 0
Response:
<task>
<id>25</id>
<type>
<![CDATA[Task]]>
</type>
<name>
<![CDATA[Go shopping]]>
</name>
<body>
<![CDATA[Go shopping]]>
</body>
<state>...</state>
<visibility>...</visibility>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<updated_on>...</updated_on>
<updated_by_id>...</updated_by_id>
<version>...</version>
<permalink>...</permalink>
<priority>...</priority>
<due_on>...</due_on>
<completed_on>...</completed_on>
<completed_by_id>...</completed_by_id>
<project_id>...</project_id>
<parent_id>...</parent_id>
activecollab.com/docs/…/developers 55/72
29/03/2011 05. Developer's Guide
<milestone_id>...</milestone_id>
<permissions>
<can_edit>1</can_edit>
<can_delete>1</can_delete>
<can_change_visibility>1</can_change_visibility>
<can_move>0</can_move>
<can_copy>0</can_copy>
<can_change_complete_status>1</can_change_complete_status>
</permissions>
</task>
1. /projects/:project_id/objects/:object_id/attachments
<attachments>
<attachment>
<id>...</id>
<name>...</name>
<mime_type>...</mime_type>
<size>...</size>
<created_on>...</created_on>
<created_by_id>...</created_by_id>
<permalink>...</permalink>
</attachment>
</attachments>
If POST request is submitted, system will attach all the uploaded files and attach them to the object. When done, last
attachment details are returned.
1. /projects/:project_id/objects/:object_id/complete
Method: POST
1. Milestones
2. Checklists
3. Tickets
4. Subtasks
2. /projects/:project_id/objects/:object_id/open
Method: POST
1. Milestones
2. Checklists
3. Tickets
activecollab.com/docs/…/developers 56/72
29/03/2011 05. Developer's Guide
4. Subtasks
3. /projects/:project_id/objects/:object_id/star
Marks specific object as starred. On success object system returns object details.
Method: POST
4. /projects/:project_id/objects/:object_id/unstar
Marks specific object as not starred. On success, system returns object details.
Method: POST
5. /projects/:project_id/objects/:object_id/subscribe
Method: POST
1. Milestones
2. Discussions
3. Checklists
4. Files
5. Pages
6. Tickets
7. Subtasks
6. /projects/:project_id/objects/:object_id/unsubscribe
Unsubscribes users from the specific object. On success system returns object details.
Method: POST
Users can be unsubscribed from following object types if they are already subscribed to them:
1. Milestones
2. Discussions
3. Checklists
4. Files
5. Pages
6. Tickets
7. Subtasks
7. /projects/:project_id/objects/:object_id/move-to-trash
Moves specific object into Trash. On success system will return object details.
Method: POST
8. /projects/:project_id/objects/:object_id/restore-from-trash
Restores object from Trash. System will return object details on success.
Method: POST
activecollab.com/docs/…/developers 57/72
29/03/2011 05. Developer's Guide
API Wrapper
activeCollab API Wrapper is a set of PHP classes that make use of activeCollab API much easier, by providing object oriented interface to
it. Instead of making HTTP requests from your code and handling responses, wrapper layer lets you call simple set of methods and work
with the result in form of PHP native types, such are arrays, objects, boolean values etc.
activeCollab API Wrapper is Free Software released under LGPL licenses, and you are free to use it in your commercial projects, in-house
applications, open source projects or any other type of application that you are working on, completely free of charge. Check LICENSE.txt
for details.
Getting Started
Usage of activeCollab API in your code goes in three steps: load API wrapper code (files located in /lib folder), provide authentication
parameters and finally execute one or more commands against the API:
<?php
// Authenticate
ActiveCollab::setAPIUrl('http://localhost/corporate/public/api.php');
ActiveCollab::setKey('4-EUASVXm3VgJXhUfIsN1uGRASO1i0gIiLrIsbuF5e');
// List projects
print '<pre>';
$projects = ActiveCollab::listProjects();
if($projects) {
foreach($projects as $project) {
print 'Project #' . $project->getId() . ': ' . htmlspecialchars($project->getName()) . '<br />';
} // foreach
} // if
print '</pre>';
?>
To find your token key and API URL, go to API Settings page of your user profile:
After meeting those requirements you can create objects and call methods in order to read and manipulate activeCollab data.
Some of the methods can throw an exception if they receive invalid parameters. In the following example, we'll use try / catch block to
handle any error that might happen (group with ID 1 does not exist, authentication problems, insufficient permissions etc):
try {
$group = ActiveCollab::findProjectGroupById(1);
activecollab.com/docs/…/developers 58/72
29/03/2011 05. Developer's Guide
} catch (Exception $e) {
echo $e->getMessage();
echo $e->getFile();
echo $e->getLine();
}
System Information
This chapter lists methods that can be used to get information about activeCollab installation you are communicating with. They are
contained in class ActiveCollab. Methods can be called directly (as static methods) or through an object.
1. getVersion
Description:
Return Value:
2. listProjects
Description:
Return Value:
3. listProjectsGroups
Description:
Return Value:
4. listTicketCategoriesByProjectId
Description:
Parameters:
Return Value:
5. listDiscussionCategoriesByProjectId
Description:
Parameters:
Return Value:
activecollab.com/docs/…/developers 59/72
29/03/2011 05. Developer's Guide
6. listFileCategoriesByProjectId
Description:
Parameters:
Return Value:
7. listPageCategoriesByProjectId
Description:
Parameters:
Return Value:
8. listTicketsByCategoryId
Description:
array listTicketsByCategoryId( int $project_id, int $category_id ) - List all tickets for a specific project and category
Parameters:
Return Value:
9. listFilesByCategoryId
Description:
array listFilesByCategoryId( int $project_id, int $category_id ) - List all files for a specific project and category
Parameters:
Return Value:
10. listPagesByCategoryId
Description:
array listPagesByCategoryId( int $project_id, int $category_id ) - List all pages for a specific project and category
Parameters:
Return Value:
11. listDiscussionsByCategoryId
activecollab.com/docs/…/developers 60/72
29/03/2011 05. Developer's Guide
Description:
array listDiscussionsByCategoryId( int $project_id, int $category_id ) - List all discussions for a specific project and category
Parameters:
Return Value:
12. listSystemRoles
Description:
Return Value:
13. listProjectRoles
Description:
Return Value:
14. findRoleDetailsById
Description:
Parameters:
Return Value:
15. listCompanies
Description:
Return Value:
16. listStatusMessages
Description:
Return Value:
17. listStatusMessagesByUserId
Description:
array listStatusMessagesByUserId( int $user_id ) - List all status messages created by specific user
activecollab.com/docs/…/developers 61/72
29/03/2011 05. Developer's Guide
Parameters:
user_id - id of a user
Return Value:
18. listPeopleByProjectId
Description:
array listPeopleByProjectId( int $project_id ) - List all people involved with a project and their permissions
Parameters:
project_id - id of a project
Return Value:
19. listTicketsByProjectId
Description:
array listTicketsByProjectId( int $project_id ) - List all tickets for a specific project
Parameters:
project_id - id of a project
Return Value:
20. listArchivedTicketsByProjectId
Description:
array listArchivedTicketsByProjectId( int $project_id ) - List all archived tickets for a specific project
Parameters:
project_id - id of a project
Return Value:
21. listFilesByProjectId
Description:
array listFilesByProjectId( int $project_id ) - List all files for a specific project
Parameters:
project_id - id of a project
Return Value:
22. listDiscussionsByProjectId
Description:
array listDiscussionsByProjectId( int $project_id ) - List all discussions for a specific project
Parameters:
activecollab.com/docs/…/developers 62/72
29/03/2011 05. Developer's Guide
project_id - id of a project
Return Value:
23. listMilestonesByProjectId
Description:
array listMilestonesByProjectId( int $project_id ) - List all milestones for a specific project
Parameters:
project_id - id of a project
Return Value:
24. listChecklistsByProjectId
Description:
array listChecklistsByProjectId( int $project_id ) - List all checklists for a specific project
Parameters:
project_id - id of a project
Return Value:
25. listArchivedChecklistsByProjectId
Description:
array listArchivedChecklistsByProjectId( int $project_id ) - List all archived checklists for a specific project
Parameters:
project_id - id of a project
Return Value:
26. listTimeRecordsByProjectId
Description:
array listTimeRecordsByProjectId( int $project_id ) - List all time records for a specific project
Parameters:
project_id - id of a project
Return Value:
1. Fetching a company
activecollab.com/docs/…/developers 63/72
29/03/2011 05. Developer's Guide
Parameters:
1. Fetching a user
Parameters:
object $user = new ActiveCollabUser( int $company_id ) - Creates new ActiveCollabUser object
activecollab.com/docs/…/developers 64/72
29/03/2011 05. Developer's Guide
Working With Projects
This section covers methods used for managing projects in activeCollab.
1. Fetching a project
Parameters:
4. People on project
These methods are used for adding users and their project roles to the project.
Example code:
$project = ActiveCollab::findProjectById(5);
$permission = array();
$permission['milestone'] = ACTIVECOLLAB_PERMISSION_NO_ACCESS;
$permission['discussion'] = ACTIVECOLLAB_PERMISSION_HAS_ACCESS;
$permission['file'] = ACTIVECOLLAB_PERMISSION_NO_ACCESS;
$permission['page'] = ACTIVECOLLAB_PERMISSION_HAS_ACCESS;
$permission['ticket'] = ACTIVECOLLAB_PERMISSION_CAN_CREATE;
$permission['checklist'] = ACTIVECOLLAB_PERMISSION_CAN_CREATE;
$permission['timerecord'] = ACTIVECOLLAB_PERMISSION_CAN_MANAGE;
$project->addUsers(array(5),$permission);
$project->changeUserPermission(5,$permission);
$project->removeUserFromProject(5);
• ACTIVECOLLAB_PERMISSION_NO_ACCESS
• ACTIVECOLLAB_PERMISSION_HAS_ACCESS
• ACTIVECOLLAB_PERMISSION_CAN_CREATE
activecollab.com/docs/…/developers 65/72
29/03/2011 05. Developer's Guide
• ACTIVECOLLAB_PERMISSION_CAN_MANAGE
1. Fetching a discussion
Parameters:
Parameters:
• setCreatedByEmail(string $email) - Sets an email of the user who created this discussion
• setCreatedByName(string $name) - Sets the name of the user who created this discussion
• setName(string $name) - Sets the name of this discussion
• setBody(string $body) - Sets the description of this discussion
• setTags(array of string $tagArr) - Sets tags for this discussion
• setVisibility(int $visibility) - Sets the visibility of this discussion; the visibility parame
• setParentId(int $parent_id) - Sets the parent for this discussion
• setMilestoneId(int $milestone_id) - Sets the milestone for this discussion
• addAttachments(array of file $arr_files) - Adds array of files to a discussion
• save(void) - Saves the discussion object into activeCollab
1. Fetching a checklist
Parameters:
activecollab.com/docs/…/developers 66/72
29/03/2011 05. Developer's Guide
Return value: Object instance of ActiveCollabChecklist
Parameters:
• setCreatedByEmail(string $email) - Sets an email of the user who created this checklist
• setCreatedByName(string $name) - Sets the name of the user who created this checklist
• setName(string $name) - Sets the name of this checklist
• setBody(string $body) - Sets the description of this checklist
• setTags(array of string $tagArr) - Sets tags for this checklist
• setVisibility(int $visibility) - Sets the visibility of this checklist; the visibility paramet
• setMilestoneId(int $milestone_id) - Sets the milestone for this checklist
• save(void) - Saves the checklist object into activeCollab
1. Fetching a file
Parameters:
Parameters:
• setCreatedByEmail(string $email) - Sets an email of the user who created this file
• setCreatedByName(string $name) - Sets the name of the user who created this file
• setName(string $name) - Sets the name of this file
• setBody(string $body) - Sets the description of this file
• setTags(array of string $tagArr) - Sets tags for this file
• setVisibility(int $visibility) - Sets the visibility of this file; the visibility parameter ca
• setParentId(int $parent_id) - Sets the parent for this file
• setMilestoneId(int $milestone_id) - Sets the milestone for this file
• addFile(file $file) - Uploads an file and bounds it to a ActiveCollabFile object
• getRevisions(void) - Returns revisions of this file
• save(void) - Saves the file object into activeCollab
activecollab.com/docs/…/developers 67/72
29/03/2011 05. Developer's Guide
1. Fetching a milestone
Parameters:
Parameters:
• setCreatedByEmail(string $email) - Sets an email of the user who created this milestone
• setCreatedByName(string $name) - Sets the name of the user who created this milestone
• setName(string $name) - Sets the name of this milestone
• setBody(string $body) - Sets the description of this milestone
• setPriority(int $priority) - Sets the priority of this milestone; the priority parameter can b
• setTags(array of string $tagArr) - Sets tags for this milestone
• setStartOn(timestamp $date) - Sets the date when the milestone is starting
• setDueOn(timestamp $date) - Sets the date when the milestone is due
• setAssignees(array of int $assignees, int $responsible_person) - Sets assignees and responsibl
• save(void) - Saves the milestone object into activeCollab
1. Fetching a ticket
Parameters:
Parameters:
activecollab.com/docs/…/developers 68/72
29/03/2011 05. Developer's Guide
These methods are callout through an ticket object.
• setCreatedByEmail(string $email) - Sets an email of the user who created this ticket
• setCreatedByName(string $name) - Sets the name of the user who created this ticket
• setName(string $name) - Sets the name of this ticket
• setBody(string $body) - Sets the description of this ticket
• setPriority(int $priority) - Sets the priority of this ticket; the priority parameter can be a
• setTags(array of string $tagArr) - Sets tags for this ticket
• setVisibility(int $visibility) - Sets the visibility of this ticket; the visibility parameter
• setDueOn(timestamp $date) - Sets the date when the ticket is due
• setParentId(int $parent_id) - Sets the parent for this ticket
• setMilestoneId(int $milestone_id) - Sets the milestone for this ticket
• setAssignees(array of int $assignees, int $responsible_person) - Sets assignees and responsibl
• addAttachments(array of file $arr_files) - Adds array of files to a ticket
• save(void) - Saves the ticket object into activeCollab
Parameters:
Parameters:
• setCreatedByEmail(string $email) - Sets an email of the user who created this time
• setCreatedByName(string $name) - Sets the name of the user who created this time
• setBody(string $body) - Sets the description of this time
• setUserId(int $user_id) - Id of user for whom time is created
• setBillableStatus(int $status) - Sets the billable status of this time; the status parameter c
• setValue(float $value) - Sets value for this time
• setRecordDate(timestamp $date) - Sets the date when the time record is created
• setParentId(int $parent_id) - Sets the parent for this time
• save(void) - Saves the time object into activeCollab
1. Fetching a page
activecollab.com/docs/…/developers 69/72
29/03/2011 05. Developer's Guide
Parameters:
Parameters:
• setCreatedByEmail(string $email) - Sets an email of the user who created this page
• setCreatedByName(string $name) - Sets the name of the user who created this page
• setName(string $name) - Sets the name of this page
• setBody(string $body) - Sets the description of this page
• setTags(array of string $tagArr) - Sets tags for this page
• setVisibility(int $visibility) - Sets the visibility of this page; the visibility parameter ca
• setParentId(int $parent_id) - Sets the parent for this page
• setMilestoneId(int $milestone_id) - Sets the milestone for this page
• addAttachments(array of file $arr_files) - Adds array of files to a page
• save(void) - Saves the page object into activeCollab
1. Fetching a comment
Parameters:
Parameters:
• setCreatedByEmail(string $email) - Sets an email of the user who created this comment
• setCreatedByName(string $name) - Sets the name of the user who created this comment
• setBody(string $body) - Sets the description of this comment
• setParentId(int $parent_id) - Sets the parent for this comment
• addAttachments(array of file $arr_files) - Adds array of files to a comment
• save(void) - Saves the comment object into activeCollab
1. Fetching a subtask
Parameters:
Parameters:
• setCreatedByEmail(string $email) - Sets an email of the user who created this subtask
• setCreatedByName(string $name) - Sets the name of the user who created this subtask
• setBody(string $body) - Sets the description of this subtask
• setDueOn(timestamp $date) - Sets the date when the subtask is due
• setParentId(int $parent_id) - Sets the parent for this subtask
• setAssignees(array of int $assignees, int $responsible_person) - Sets assignees and responsibl
• save(void) - Saves the subtask object into activeCollab
activecollab.com/docs/…/developers 72/72