This page is about an old version of Active Collab that's not developed anymore.
Click here to open the documentation for the latest version.

Working with Text Documents

The commands listed in this article are used for manipulating Text Documents created in the Files section of activeCollab via the activeCollab API.

Compatibility Note

These commands were introduced in activeCollab 3.3.9 and are not available in earlier releases.

About Text Documents #

The following fields can be set via the API:

  • name (string) - The Text Document name is a required field when adding a new document to the Files section.
  • body (text) - The content of the Text Document is a required field when adding a new document to the Files section.
  • visibility (integer) - Object visibility. 0 marks private and 1 normal visibility.
  • milestone_id (integer) - The ID of the parent Milestone.
  • category_id (integer) - The Category ID.

Resources related to Text Documents can be found here:

Additional commands can be found in the following articles:

projects/:project_id/files/text-documents #

This command lists all Text Documents from a selected project.

Method: GET

Example response:

1
2
3
4
5
6
7
8
9
10
<text_documents>
  <text_document>
    <id>1</id>
    <name>
      <![CDATA[New Document Title]]>
    </name>
    ...
  </text_document>
  ...
</text_documents>

projects/:project_id/files/text-documents/add #

This command adds a new Text Document to your activeCollab.

Method: POST

Request example:

1
2
3
text_document[name]=New Text Document
text_document[body]=Lorem ipsum dolor sit amet
submitted=submitted

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
<text_document>
  <id>1</id>
  <name>
    <![CDATA[New Text Document]]>
  </name>
  <body>
    <![CDATA[Lorem ipsum dolor sit amet]]>
  </body>
  <body_formatted>
    <![CDATA[Lorem ipsum dolor sit amet]]>
  </body_formatted>
  ...
</text_document>

projects/:project_id/files/text-documents/:text_document_id #

This command displays the details for a specific Text Document.

Method: GET

Response:

1
2
3
4
5
6
7
<text_document>
  <id>1</id>
  <name>
    <![CDATA[Updated Document Title]]>
  </name>
  ...
</text_document>

projects/:project_id/files/text-documents/:text_document_id/edit #

This command updates the properties and the content of a specific Text Document.

When a Text Document is updated, it will automatically save the older version. If you wish to update the properties without saving the old version, make sure that text_document[create_new_version] is set to 0 when you prepare and send your update request.

Method: POST

Example request:

1
2
3
text_document[name]=Updated Document Title
text_document[create_new_version]=1
submitted=submitted

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<text_document>
  <id>1</id>
  <name>
    <![CDATA[Updated Document Title]]>
  </name>
  <body>
    <![CDATA[Lorem ipsum dolor sit amet]]>
  </body>
  <body_formatted>
    <![CDATA[Lorem ipsum dolor sit amet]]>
  </body_formatted>
  ...
  <versions>
    <version>
      ...
    </version>
    ...
  </versions>
</text_document>