The activeCollab authentication system can be extended to include other "authentication sources", such is LDAP, or the database of another web application (your website's CMS or forum, for example). This can be achieved by using Authentication Providers and in this chapter we'll show you how to do just that.
An Authentication Provider is a piece of custom code that you need to develop in order to check users against any authentication source you wish. Most of the code is already prepared. You'll only need to add things specific to your authentication source.
Authentication Providers are not a replacement for activeCollab authentication, they are a bridge to connect it to other applications. The provider will still need to return an instance of a User class that exists in the activeCollab users table.
Here are four important methods in the Authentication Provider:
In this example we will cover how to make a provider that extends the system by attempting to log a user in against another user database (a website CMS or forum for example). If this fails, then we will try to authenticate the user against the activeCollab user database.
We will start by creating a CustomAuthenticationProvider.class.php within the /activecollab/angie/classes/auth/providers folder. We'll use this code for the foundation:
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 automatically, without the need to implement them once again.
Let's implement the behavior now. In this example, we want to check if a user exists and that their password is valid in another database after they click hit the Submit button on an activeCollab form. For that, we will need to override the 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')) {
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 the config/config.php file and add the following line to the block with constant definitions:
define('AUTH_PROVIDER', 'CustomAuthenticationProvider');
In this example, we assume that your system administrator has configured the system so that Apache knows you by the username you used to login to your computer and that it makes this information available to PHP in the authenticated_user variable. In this setup, we can completely skip the login screen and log you in directly, based on the data provided by the system.
We will call this authentication provider ApacheAuthenticationProvider and we'll define it in /activecollab/angie/classes/auth/providers/ApacheAuthenticationProvider.class.php. Because we're not using the normal activeCollab login process, we can skip the authentication() method and implement the initialization() method instead:
class ServerAuthenticationProvider extends AuthenticationProvider {
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 the login screen and automatically log you in every time you visit activeCollab .
If you wish, you can integrate activeCollab within your website and enable registered users to login easily. To achieve this activeCollab lets you do the following:
In the following articles you'll find a more detailed explanation on how to set this up.
You can add a form that will authenticate users with activeCollab directly from your website. To do this, you need to add a form with specific fields that submits a POST request to activeCollab's login page.
Required fields for this are:
Additionally you need to include a "submitted" hidden field with a "submitted" value for activeCollab to accept the submitted data.
Here is the example form markup:
<form method="post" action="http://www.activecollab.com/my/ac/public/index.php?path_info=login"> Email: <input type="text" name="login[email]" /> Password: <input type="password" name="login[password]" /> Remember me: <input type="checkbox" name="login[remember]" /> <input type="hidden" name="submitted" value="submitted" /> <button type="submit">Go baby go!</button> </form>
Feel free to change it to fit your needs, but please make sure that the names of the fields are not changed and that the form action points to the login form of your activeCollab. installation.
Since activeCollab 2 you can choose the URL that users will be redirected to when they logout.
By default, they will be redirected back to the login page, but if you provide another location (a certain page of your website, for example) then users will land there instead after they logout from activeCollab. To set-up the landing page up, open Administration > General settings page:
At the bottom of the General Settings page there is When User Logs Out switch:
When you make the changes and submit the form, try logging out to confirm that everything is working as it should.
activeCollab lets you change the look and feel of the application without changing any core files. To do this you can use activeCollab Themes:
One interesting fact about themes is that every user can have a theme of their own, which they can select from the Change Settings page in their profile area. Administrators can also select a default theme that is automatically used when new users are created. When the default theme is changed by an administrator, all user specific settings are dropped and every user's theme is reset to the default one.
Besides the themes that are shipped with activeCollab ('Sandbox' and 'Default') you can use also use any custom themes that you've created.
Themes work by building on activeCollab's default styling with CSS files that are added once the basic styling elements (page layout, form widgets and other basic page elements) have been loaded. These basic elements serve to make activeCollab fully usable, but with a minimum number of graphic elements on the page.
To see how activeCollab looks with only basic files included, select the Sandbox theme on your profile page.
When changes to basic styling are required, activeCollab uses theme files to override these existing settings and adds colors and other graphic elements. The Default theme that is shipped with activeCollab is an example of a theme that extends Sandbox and is also something that you can use as an example for creating your own.
To create your own theme in activeCollab you will need some CSS knowledge (and to be creative!). To make your theme, simply follow these steps:
The activeCollab API (Application Programming Interface) is a set of methods that can be called (accessed) from another application. These methods are used to read and manipulate the data stored by the system.
Methods are executed by calling specific URLs and fetching the formatted output. URLs are formatted in the 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=value2
The API URL that you need to use to send a request (and your token) are available on the API Setting page of your profile page in activeCollab:
Currently supported output formats are XML and JSON. There are two ways of specifying output format:
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.
When submitting data to activeCollab by using a POST method, there needs to be a variable named "submitted" with a value of "submitted". If you don't provide it, then activeCollab will reject your request (probably with BAD REQUEST error).
In order to use the activeCollab API, first you will need to authenticate yourself to the system, which you can do using your API key. This key is available on the API Settings page of your activeCollab user profile:
When creating a request, the API key must be passed as a "token" GET variable. The sample request URL would then look like this:
http://example.com/public/api.php?path_info=projects&token=1-55lTBjCvCALC6Jksg3vo2xQeymySDqFwkReL1H8s
Your API key can be reset at any time. All you need to do is to click the Reset Key link. Please also be aware that your API key will be automatically reset whenever you change your password!
There are three states within the activeCollab API:
To change the API state check for the API_STATUS in your config/config.php file. If that configuration directive does not exist, add the following line to the file:
define('API_STATUS', 1);
Values this directive can have are:
This section contains information about changes made to the API that could affect its behavior and may break backward compatibility.
This API documentation section was introduced when activeCollab 2.1 was launched.
activeCollab 2.0 introduced many improvements, though consequently some have resulted in changes that can break backward compatibility:
In this chapter we list all the commands that you can use to get information about the activeCollab installation you are communicating with.
Returns system information about the installation you are working with. This information includes system versions; info about logged in users; the mode the API is in etc.
Method: GET
Information that you will receive when using this request is:
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>
activeCollab supports several methods for listing the System Roles that a user can have, as well as for reading the permissions included in each role.
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
Since: activeCollab 1.1.4
Example response:
<system_roles>
<system_role>
<id>...</id>
<name>...</name>
<is_default>0</is_default>
<permissions>
<system_access>1</system_access>
...
</permissions>
</system_role>
</system_roles>
Lists all project roles and displays their permissions.
Please note that the 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
Since: activeCollab 1.1.4
Example Response:
<project_roles>
<project_role>
<id>...</id>
<name>...</name>
<permissions>
<discussion>1</discussion>
...
</permissions>
</project_role>
</project_roles>
Displays the details from 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, so each user will be able to read details of each role.
Method: GET
Since: activeCollab 1.1.4
Example of the system role response:
<system_role>
<id>...</id>
<name>...</name>
<is_default>0</is_default>
<permissions>
<system_access>1</system_access>
...
</permissions>
</system_role>
Example of the project role Response:
<project_role>
<id>...</id>
<name>...</name>
<permissions>
<discussion>1</discussion>
...
</permissions>
</project_role>
activeCollab offers several commands which are designed to allow other applications to create and manage company or user accounts.
When a new user account is created, a user can set the role_id to a custom value only if he/she is an Administrator or has the manage_people permission in their Role. If a user who creates an account is not an Administrator or People manager, then the user's role will be set to the default role configured on the Administration > Roles page.
Lists all the companies defined in the System, no matter if they are Active or Archived.
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>
This command will create a new company, and if the post is successful, then details of the newly created company will be returned.
Method: POST
Request example:
submitted=submitted company[name]=New Company
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> </company>
Displays the properties of a specific company.
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>
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>
You can use this to delete a company and all of its users. Projects that this company and its users were assigned to will not be deleted! If successful, the system will return a HTTP status of 200 OK.
There is one company which can't be deleted - the Owner Company!
Method: POST.
Request example:
submitted=submitted
Creates a user account in the selected company. If successful, the function will display details of the newly created user account.
Only Administrators and people with manage_people permission included in their System Role can set role_id value. If a user who creates the new account is not an Administrator or People Manager, the default role ID will be used.
Method: POST.
Request example:
submitted = submitted user[email] = ilija@a51dev.com 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>
Shows details of a specific user.
Method: GET
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>
Updates details of an existing user.
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>
Delete a specific user account. if successful, a HTTP 200 OK status will be returned.
Data created by this user - project, tickets, discussions, comments, etc. will not be deleted.
Method: POST.
Request example:
submitted = submitted
Commands listed in this chapter are used for management of your projects via the API.
Displays all projects that the authenticated user has access to. This function will show all - 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>
Creates a new project.
Method: POST.
Additionally you can include a project_template_id variable, which should be a valid project ID. If this variable is included, the new project will be created using an existing project (determined by the ID that has been passed) 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>
Shows properties of the specific project. Besides 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>
<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>
Updates project properties.
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>
Updates the project status, which can have four different values:
Method: POST.
Request example:
submitted = submitted project[status] = completed
Response:
<project>
<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>
Delete a selected project. If successful, system will return a HTTP status 200 OK message.
This operation is final and when it is executed you will not be able to restore it. There is no undo option!
Method: POST.
Request example:
submitted=submitted
Returns all tasks assigned to a logged in user for that particular project.
Method: GET
Since: activeCollab 1.1.2
<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>
<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>
Displays the list of people involved with the project and the permissions included in their Project Role. Project Permissions are organized per module and have four possible values:
Method: GET
Since: activeCollab 1.1.4
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>
</project_user>
</project_users>
By using this command, you can add one or more users to the project and set their Project Permissions. This command accepts two parameters:
Method: POST
Since: activeCollab 2.0.3
This example request will add users with ID 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 example request will add users with ID 15 and 72 to the project, and set their permissions for tickets and discussions module to Has access. All their other module permissions will be set to No access:
submitted = submitted users[] = 15 users[] = 72 project_permissions[permissions][discussion] = 1 project_permissions[permissions][ticket] = 1
This command is used for changing the set of Project Permissions for the selected user in a given project.
This command accepts two parameters:
In this example, the Project Permissions for this user and his Project Role will be changed to Project Role #10:
submitted=submitted project_permissions[role_id]=10
This example request will change a user's Project Permission so that he/she has access to the Tickets and Discussions modules. All other module permissions will be set to No access:
submitted = submitted project_permissions[permissions][discussion] = 1 project_permissions[permissions][ticket] = 1
This command will remove a specific user from the project. If successful, this function will return a HTTP 200 OK status.
Method: POST
Since: activeCollab 2.0.3
Project Group commands let you organise manage project groups from an external application.
The ability to work with project groups through the API was added in activeCollab 1.1.4 and is not available in older versions.
Lists all available project groups in your activeCollab.
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>__
Creates a new project group. The name of the group needs to be unique.
Method: POST.
Request example:
submitted=submitted project_group[name] = Development
Response:
<project_group>
<id>4</id>
<name>
<![CDATA[Development]]>
</name>
</project_group>
Displays group details, including all projects that belong to a group.
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>
This command updates the existing project group name.
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>
Removes a project group from the database. If successful, the system will return a HTTP status 200 OK message.
Method: POST.
Be aware that only empty project groups can be deleted.
Request example:
submitted=submitted
Discussions are a key part of activeCollab where people can discuss various aspects of a project in an environment similar to online forums. Each project has a separate discussion area.
Displays all discussions in a project.
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>
Creates a new discussion in the specified project
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>
Displays discussion details. In addition to discussion details, this command also returns all comments posted, as part of comments property.
Method: GET
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>...</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>
</permissions>
</discussion>
Updates existing discussion details.
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>
The commands described in this chapter will enable you to manage Checklists within a project in your edition of activeCollab. Each project has its own separate set of Checklists.
By default, the Checklists module is not installed in activeCollab Corporate edition and these commands are not available. To install it, go to the Administration > Modules page and install it from the list of Available Modules.
Displays all active Checklists for a given project.
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>
Lists all completed Checklists in the project.
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>
This command will create a new checklist.
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>
<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>
Displays checklist details.
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>
<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>
Updates the properties of an existing checklist.
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>
<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>
Each project has a separate section where files can be uploaded, discussed and file versions tracked. The commands described on the following pages will allow you to manage all these files.
All fields are optional as long as valid file is uploaded.
Lists all the files from a given project.
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>
<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>
This command will enable you to upload a single file from your computer to activeCollab.
If the name property is not provided, the system will use the original file name.
Method: POST.
Additional requirement for a file to be uploaded (any name will work, but we recommend that you name the 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>
Displays file details.
In addition to file details, information about each file revision is provided as a value in the 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>
Updates file details.
Method: POST.
Example request:
submitted = submitted file[name] = New-Name.png
Response:
<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>
<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>
Lists all active milestones for a specific project.
Method: GET.
Response example:
<milestones>
<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>
</milestones>
Creates a new milestone.
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>
<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>
Displays milestone details.
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>
Updates milestone details
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>
Lists all active tickets in a project.
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>
Displays all completed tickets in a project.
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>
Creates a new ticket for the project.
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>
<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>
Displays ticket details.
Method: GET
When you are making a request, please use the ticket ID for that particular project, not the 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>
<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>
Updates properties of the existing ticket.
Method: POST.
When you are making a request, please use the ticket ID for that particular project, not the 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>
<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>
In activeCollab 1.1.5 is_billable and is_billed fields were replaced with a billable_status field. These two fields are still available for compatibility reasons:
This command displays all the time records for a given project.
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>
<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>
Adds a new time record to the time log in a defined project.
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>
<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>
Displays record details.
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>
Updates the time record properties.
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>
This command lists all page categories in a given project.
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>
Creates a new page.
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>
<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>
Displays page details with a list of all subpages and revisions.
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>
...
</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>
Updates the properties and content of the page.
By setting is_minor_revision to value 1 when updating the page, the system will consider changes as minor ones and will not create a new page revision. Email notifications 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>
<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>
This command will mark the selected page as archived. If successful, the system will return the updated page details.
Method: POST.
Marks a selected page as unarchived. If successful, the system will return updated page details and that page will no longer be in the Archive.
Method: POST.
The Status module was introduced in activeCollab 1.1 and API support for this module was included in activeCollab's API a couple of months later with the release of activeCollab 1.1.4. Therefore, all commands described in this section are not available in versions of activeCollab before version 1.1.4.
Lists the 50 most recent status messages. If you pass the user_id through the query string, you will get filtered messages posted by that specific user only.
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[ilija.studen@gmail.com]]>
</name>
</created_by>
</message>
</messages>
This command will submit a new status message.
Method: POST
Example request:
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[john.doe@gmail.com]]>
</name>
</created_by>
</message>
This command will post a new comment on the specified object in the given project.
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>
<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>
Displays comment details.
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>
Updates an existing comment.
Method: POST
Request example:
submitted = submitted comment[body] = Updating my comment!
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>
This command will create a new subtask and attach it to the parent object.
Method: POST
Request example:
submitted = submitted task[body] = Go shopping task[priority] = -2
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>-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>
Displays task details.
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>
<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>
Updates task details.
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>
<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>
This command will lists all files attached to a specific object in the given project.
Method: GET or POST
Example response for GET request:
<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 a POST request is submitted, the system will attach all uploaded files to the defined object. When this operation is complete, details of the last attachment will be returned.
Marks a specific object as completed. If successful, the system will return all of the object's details.
Method: POST
The types of project objects that can marked as completed are:
Marks specific object as open. If successful, the system will return the object's details.
Method: POST
Types of project objects that can be completed and re-opened:
Marks a specific project object as starred. if successful, the system will return the object's details.
Method: POST
Any project object can be starred.
This command will mark a specific project object as not starred. If successful, the system will return the object's details.
Method: POST
Any project object can be un-starred.
Subscribes users to a specific object. If successful, the system will return the object's details.
Method: POST
Users can be subscribed to following project object types:
Unsubscribes users from the specific project object. If successful, the system returns the object's details.
Method: POST
Users can be unsubscribed from the following project object types (if they are already subscribed to them):
Moves the specific project object to Trash. If successful, the system will return the object's details.
Method: POST
Any project object type can be moved to Trash.
Restores an object from the Trash. The system will return the object's details if the command is completed successfully.
Method: POST
Any project object type can be restored from the Trash.
The activeCollab API Wrapper is a set of PHP classes that makes using the activeCollab API much easier, by providing an object oriented interface. Instead of making HTTP requests from your code and handling responses, the wrapper layer lets you call a simple set of methods and work with the results in a form of PHP native types, such as arrays, objects, boolean values etc.
The activeCollab API Wrapper is free software released under LGPL licenses, and you are welcome 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 the LICENSE.txt file, available in the activeCollab API Wrapper folder that you can download here, for more details.
Using the activeCollab API wrapper in your code should be done in three steps:
<?php
// Include activeCollab API wrapper
require_once '/lib/include.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 these methods can throw an exception if they receive invalid parameters. In the following example, we'll use a try/catch block to handle any error that may happen (group with ID 1 does not exist; authentication problems; insufficient permissions etc):
try {
$group = ActiveCollab::findProjectGroupById(1);
} catch (Exception $e) {
echo $e->getMessage();
echo $e->getFile();
echo $e->getLine();
}
This chapter describes the methods that can be used to get information about the activeCollab installation you are communicating with. These are contained in class ActiveCollab. Methods can be called directly (as static methods) or through an object.
Description:
array getVersion( void ) - Return API Version
Return Value:
Array containing the information about API
Description:
array listProjects( void ) - List all Projects
Return Value:
Array containing the objects of Projects
Description:
array listProjectsGroups( void ) - List all available project groups
Return Value:
Array containing the objects of Project groups
Description:
array listTicketCategoriesByProjectId( int $project_id ) - List ticket categories in one project
Parameters:
project_id - id value of the project
Return Value:
Array containing the objects of Ticket categories
Description:
array listDiscussionCategoriesByProjectId( int $project_id ) - List discussion categories in one project
Parameters:
project_id - id value of the project
Return Value:
Array containing the objects of Discussion categories
Description:
array listFileCategoriesByProjectId( int $project_id ) - List file categories in one project
Parameters:
project_id - id value of the project
Return Value:
Array containing the objects of File categories
Description:
array listPageCategoriesByProjectId( int $project_id ) - List page categories in one project
Parameters:
project_id - id value of the project
Return Value:
Array containing the objects of Page categories
Description:
array listTicketsByCategoryId( int $project_id, int $category_id ) - List all tickets for a specific project and category
Parameters:
project_id - id value of the project category_id - id value of the category
Return Value:
Array of ActiveCollabTicket objects
Description:
array listFilesByCategoryId( int $project_id, int $category_id ) - List all files for a specific project and category
Parameters:
project_id - id value of the project category_id - id value of the category
Return Value:
Array of ActiveCollabFile objects
Description:
array listPagesByCategoryId( int $project_id, int $category_id ) - List all pages for a specific project and category
Parameters:
project_id - id value of the project category_id - id value of the category
Return Value:
Array of ActiveCollabPage objects
Description:
array listDiscussionsByCategoryId( int $project_id, int $category_id ) - List all discussions for a specific project and category
Parameters:
project_id - id value of the project category_id - id value of the category
Return Value:
Array of ActiveCollabDiscussion objects
Description:
array listSystemRoles( void ) - List all system roles
Return Value:
Array containing the system roles
Description:
array listProjectRoles( void ) - List all project roles
Return Value:
Array containing the project roles
Description:
array findRoleDetailsById( int $role_id ) - List role details
Parameters:
role_id - id of the role
Return Value:
Array containing the information about the role
Description:
array listCompanies( void ) - List all companies
Return Value:
Array of ActiveCollabCompany objects
Description:
array listStatusMessages( void ) - List all status messages
Return Value:
Array of ActiveCollabStatusMessage objects
Description:
array listStatusMessagesByUserId( int $user_id ) - List all status messages created by specific user
Parameters:
user_id - id of a user
Return Value:
Array of ActiveCollabStatusMessage objects
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:
Array of ActiveCollabUser objects
Description:
array listTicketsByProjectId( int $project_id ) - List all tickets for a specific project
Parameters:
project_id - id of a project
Return Value:
Array of ActiveCollabTicket objects
Description:
array listArchivedTicketsByProjectId( int $project_id ) - List all archived tickets for a specific project
Parameters:
project_id - id of a project
Return Value:
Array of ActiveCollabTicket objects
Description:
array listFilesByProjectId( int $project_id ) - List all files for a specific project
Parameters:
project_id - id of a project
Return Value:
Array of ActiveCollabFile objects
Description:
array listDiscussionsByProjectId( int $project_id ) - List all discussions for a specific project
Parameters:
project_id - id of a project
Return Value:
Array of ActiveCollabDiscussion objects
Description:
array listMilestonesByProjectId( int $project_id ) - List all milestones for a specific project
Parameters:
project_id - id of a project
Return Value:
Array of ActiveCollabMilestone objects
Description:
array listChecklistsByProjectId( int $project_id ) - List all checklists for a specific project
Parameters:
project_id - id of a project
Return Value:
Array of ActiveCollabChecklist objects
Description:
array listArchivedChecklistsByProjectId( int $project_id ) - List all archived checklists for a specific project
Parameters:
project_id - id of a project
Return Value:
Array of ActiveCollabChecklists objects
Description:
array listTimeRecordsByProjectId( int $project_id ) - List all time records for a specific project
Parameters:
project_id - id of a project
Return Value:
Array of ActiveCollabTime objects
In this article we will describe the methods that can allow you to manage companies in your installation of activeCollab.
object ActiveCollab::findCompanyById( int $company_id) - Fetches the ActiveCollabCompany object
Parameters:
company_id - id of a specific company
Return value: Object instance of ActiveCollabCompany
object $company = new ActiveCollabCompany( void ) - Creates a new ActiveCollabCompany object
Variable value: Object instance of ActiveCollabCompany
These methods are called out through a company object:
• setName(string $name) - Sets the name of the company
• setOfficeAddress(string $address) - Sets the address of the company
• setOfficePhone(string $phone) - Sets the phone of the company
• setOfficeFax(string $fax) - Sets the fax of the company
• setOfficeHomepage(string $homepage) - Sets the homepage of the company
• save(void) - Saves the company object into activeCollab
• delete(void) - Deletes the company from activeCollab
These methods allow you to manage users in your activeCollab setup:
object ActiveCollab::findUserById( int $user_id) - Fetches the ActiveCollabUser object
Parameters:
user_id - id of a specific user
Return value: Object instance of ActiveCollabUser;
ActiveCollabCompany company->getCompanyUsers(void) - Gets all users in the company
Return value: Array of object instances of ActiveCollabUser
object $user = new ActiveCollabUser( int $company_id ) - Creates a new ActiveCollabUser object
Parameters: company_id - id of a company in which the user is going to be created
Variable value: Object instance of ActiveCollabUser
These methods are called out through an user object.
• setFirstName(string $first_name) - Sets the first name of the user
• setLastName(string $last_name) - Sets the last name of the user
• setEmail(string $email) - Sets the email of the user
• setPassword(string $password) - Sets the password of the user
• setPasswordA(string $password_confirm) - Sets the confirmation password of the user
• setRoleId(int $role) - Sets the role of the user
• setAvatarURL(string $avatar) - Sets the URL of the avatar of the user
• save(void) - Saves the user object into activeCollab
• delete(void) - Deletes the user from activeCollab
This section covers methods used for managing projects in activeCollab.
object ActiveCollab::findProjectById( int $project_id) - Fetches an ActiveCollabProject object
Parameters:
project_id - id of a specific project
Return value: Object instance of ActiveCollabProject
object $project = new ActiveCollabProject(void) - Creates a new ActiveCollabProject object
Variable value: Object instance of ActiveCollabProject
These methods are called out through an project object.
• setCompanyId(int $company_id) - Sets the id of the company of the project
• setStartsOn(string $starts_on) - Sets the start date of the project
• setGroupID(int $group_id) - Sets the id of the group of the project
• setName(string $name) - Sets the name of the project
• setOverview(string $overview) - Sets the overview of the project
• setLeaderId(int $user) - Sets the id of the leader user of the project
• save(void) - Saves the project object into activeCollab
• delete(void) - Deletes the project from activeCollab
• changeStatus(int $status) - Sets the status of the project; the status parameter can be a combination of the following constants: ACTIVECOLLAB_PROJECT_STATUS_ACTIVE, ACTIVECOLLAB_PROJECT_STATUS_PAUSED,ACTIVECOLLAB_PROJECT_STATUS_COMPLETED,ACTIVECOLLAB_PROJECT_STATUS_CANCELED
• getUserLoggedUserPermission(void) - gets permission of the logged user
• getIconUrl(void) - gets the URL of the project icon
• getUserTasks(void) - list all the tasks of the user (returns array of ticket objects)
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);
Available permission constants:
• ACTIVECOLLAB_PERMISSION_NO_ACCESS
• ACTIVECOLLAB_PERMISSION_HAS_ACCESS
• ACTIVECOLLAB_PERMISSION_CAN_CREATE
• ACTIVECOLLAB_PERMISSION_CAN_MANAGE
These methods are used for managing project groups.
$group = new ActiveCollabProjectGroup();
$group = ActiveCollab::findProjectGroupById(1);
$group->setName('Gavric11');
$group->save();
$group->delete();
In this article we will talk about the methods used for manipulating Discussions in your activeCollab.
object ActiveCollab::findDiscussionById(int $project_id, int $discussion_id) - Fetches an ActiveCollabDiscussion object
Parameters:
project_id - id of a project which the Discussion is in discussion_id - id of a specific discussion
Return value: Object instance of ActiveCollabDiscussion
object $discussion = new ActiveCollabDiscussion(int $project_id) - Creates a new ActiveCollabDiscussion object
Parameters:
project_id - id of a project in which the discussion is going to be created
Variable value: Object instance of ActiveCollabDiscussion
These methods are called out through an discussion object.
• 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 parameter can be a combination of the following constants: ACTIVECOLLAB_VISIBILITY_PRIVATE, ACTIVECOLLAB_VISIBILITY_NORMAL
• 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
In this article we describe the methods used to manipulate Checklists in activeCollab.
object ActiveCollab::findChecklistById(int $project_id, int $checklist_id) - Fetches an ActiveCollabChecklist object
Parameters:
project_id - id of the project where the checklist is located checklist_id - id of a specific checklist
Return value: Object instance of ActiveCollabChecklist
object $checklist = new ActiveCollabChecklist(int $project_id) - Creates new ActiveCollabChecklist object
Parameters:
project_id - id of the project in which the checklist is going to be created
Variable value: Object instance of ActiveCollabChecklist
These methods are called out through an checklist object.
• 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 parameter can be a combination of the following constants: ACTIVECOLLAB_VISIBILITY_PRIVATE, ACTIVECOLLAB_VISIBILITY_NORMAL
• setMilestoneId(int $milestone_id) - Sets the milestone for this checklist
• save(void) - Saves the checklist object into activeCollab
The following methods are used for managing Files within a project.
object ActiveCollab::findFileById(int $project_id, int $file_id) - Fetches an ActiveCollabFile object
Parameters:
project_id - d of a project which the file is in file_id - id of a specific file
Return value: Object instance of ActiveCollabFile
object $file = new ActiveCollabFile(int $project_id) - Creates new a ActiveCollabFile object
Parameters:
project_id - id of the project where the file is going to be created
Variable value: Object instance of ActiveCollabFile
These methods are called out through an file object.
• 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 can be a combination of the following constants: ACTIVECOLLAB_VISIBILITY_PRIVATE, ACTIVECOLLAB_VISIBILITY_NORMAL
• 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
This article covers all Milestone-related methods in activeCollab.
object ActiveCollab::findMilestoneById(int $project_id, int $milestone_id) - Fetches an ActiveCollabMilestone object
Parameters:
project_id - d of a Project which contains the Milestone milestone_id - id of a specific milestone
Return value: Object instance of ActiveCollabMilestone
object $milestone = new ActiveCollabMilestone(int $project_id) - Creates new a ActiveCollabMilestone object
Parameters:
project_id - the id of the Project in which the Milestone will be created
Variable value: Object instance of ActiveCollabMilestone
These methods are called out through an milestone object.
• 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 be a combination of the following constants: ACTIVECOLLAB_PRIORITY_LOWEST, ACTIVECOLLAB_PRIORITY_LOW, ACTIVECOLLAB_PRIORITY_NORMAL, ACTIVECOLLAB_PRIORITY_HIGH, ACTIVECOLLAB_PRIORITY_HIGHEST
• 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 responsible person for this milestone
• save(void) - Saves the milestone object into activeCollab
This article covers manipulating Tickets in your activeCollab setup using the API Wrapper.
object ActiveCollab::findTicketById(int $project_id, int $ticket_id) - Fetches an ActiveCollabTicket object
Parameters:
project_id - id of the Project which contains the Ticket ticket_id - id of a specific Ticket
Return value: Object instance of ActiveCollabTicket
object $ticket = new ActiveCollabTicket(int $project_id) - Creates a new ActiveCollabTicket object
Parameters:
project_id - id of the Project in which the Ticket will be created
Variable value: Object instance of ActiveCollabTicket
These methods are called out 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 combination of the following constants: ACTIVECOLLAB_PRIORITY_LOWEST, ACTIVECOLLAB_PRIORITY_LOW, ACTIVECOLLAB_PRIORITY_NORMAL, ACTIVECOLLAB_PRIORITY_HIGH, ACTIVECOLLAB_PRIORITY_HIGHEST
• setTags(array of string $tagArr) - Sets tags for this ticket
• setVisibility(int $visibility) - Sets the visibility of this ticket; the visibility parameter can be a combination of the following constants: ACTIVECOLLAB_VISIBILITY_PRIVATE, ACTIVECOLLAB_VISIBILITY_NORMAL
• 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 responsible person for this ticket
• addAttachments(array of file $arr_files) - Adds array of files to a ticket
• save(void) - Saves the ticket object into activeCollab
These methods are used for managing Time Tracking in activeCollab.
object ActiveCollab::findTimeById(int $project_id, int $time_id) - Fetches an ActiveCollabTime object
Parameters:
project_id - d of the Project where the time record comes from time_id - id of a specific time record
Return value: Object instance of ActiveCollabTime
object $time = new ActiveCollabTime(int $project_id) - Creates a new ActiveCollabTime object
Parameters:
project_id - id of the Project in which the Time record is going to be created
Variable value: Object instance of ActiveCollabTime
These methods are called out through an time object.
• 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 can be a combination of the following constants: ACTIVECOLLAB_BILLABLE_STATUS_NOT_BILLABLE, ACTIVECOLLAB_BILLABLE_STATUS_BILLABLE, ACTIVECOLLAB_BILLABLE_STATUS_BILLABLE_AND_PENDING, ACTIVECOLLAB_BILLABLE_STATUS_BILLED
• 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
This article lists the methods for manipulating Pages in activeCollab.
object ActiveCollab::findPageById(int $project_id, int $page_id) - Fetches an ActiveCollabPage object
Parameters:
project_id - id of the Project which contains the Page page_id - id of a specific Page
Return value: Object instance of ActiveCollabPage
object $page = new ActiveCollabPage(int $project_id) - Creates a new ActiveCollabPage object
Parameters:
project_id - id of the Project where the Page will be created
Variable value: Object instance of ActiveCollabPage
These methods are called out through an page object.
• 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 can be a combination of the following constants: ACTIVECOLLAB_VISIBILITY_PRIVATE, ACTIVECOLLAB_VISIBILITY_NORMAL
• 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
These methods are used for managing Status messages.
object $message = new ActiveCollabStatusMessage( void ) - Creates a new ActiveCollabStatusMessage object
Variable value: Object instance of ActiveCollabStatusMessage
These methods are called out through an status message object:
$sm = new ActiveCollabStatusMessage();
$sm->setMessage('roke');
$sm->save();
This article covers managing comments in activeCollab using the API Wrapper.
object ActiveCollab::findCommentById(int $project_id, int $comment_id) - Fetches an ActiveCollabComment object
Parameters:
project_id - id of the Project where the comment is located comment_id - id of a specific comment
Return value: Object instance of ActiveCollabComment
object $comment = new ActiveCollabComment(int $project_id) - Creates a new ActiveCollabComment object
Parameters:
project_id - id of the Project where the comment will be created
Variable value: Object instance of ActiveCollabComment
These methods are called out through an comment object.
• 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
The following methods allow you to manipulate Subtasks in activeCollab.
object ActiveCollab::findSubTaskById(int $project_id, int $subtask_id) - Fetches an ActiveCollabSubTask object
Parameters:
project_id - iid of the Project in which the Subtask is located subtask_id - id of a specific Subtask
Return value: Object instance of ActiveCollabSubtask
object $subtask = new ActiveCollabSubTask(int $project_id) - Creates a new ActiveCollabSubTask object
Parameters:
project_id - id of the Project in which the Subtask is going to be created
Variable value: Object instance of ActiveCollabSubtask
These methods are called out through an subtask object.
• 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 responsible person for this subtask
• save(void) - Saves the subtask object into activeCollab
The following are some common project operations that can be used with all activeCollab objects.
• starObject(void) - object becomes starred
• unstarObject(void) - object becomes unstarred
• openObject(void) - opens an object
• completeObject(void) - completes an object
• subscribeUser(void) - subscribes an user
• unsubscribeUser(void) - unsubscribes an user
• moveToTrash(void) - moves an object to the trash
• restoreFromTrash(void) - restores an object from the trash
• addNewSubTask(void) - creates a subtask for an object
• addNewComment(void) - creates a comment for an object
• addAttachments(void) - creates an attachment for an object
• getDetails(void) - return object details as array
• getComments(void) - returns comments (array of object Comment)
• getSubTasks(void) - returns subtasks (array of object SubTask)
• getAttachments(void) - returns attachments (array of object Attachment)