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.

1. File Fields

  1. name (string) - File name;
  2. body (text) - File description;
  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 the parent milestone;
  6. parent_id (integer) - File category ID.

All fields are optional as long as valid file is uploaded.

2. /projects/:project_id/files

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>

3. /projects/:project_id/files/upload-single

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>

4. /projects/:project_id/files/:file_id

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>

5. /projects/:project_id/files/:file_id/edit

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>