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.

Shared Resource: Comments

The commands described in this article are used for managing different Comments via the activeCollab API.

About Comments #

The following fields can be used when managing comments:

  • body (string) - Comment text

You can find comment resources in the article Attachments.

{context}/comments #

This command will return all comments posted to a parent object (Task, Discussion, Project Request, etc).

Method: GET

Example response:

1
2
3
4
5
6
7
8
9
<comments>
  <comment>
    <id>10</id>
    <body>
      <![CDATA[<p>This is a new comment</p>]]>
    </body>
    ...
  </comment>
</comments>

{context}/comments/add #

This command posts a new comment in the specified object in the given project.

Method: POST

Request example:

1
2
comment[body]=Making a new comment using API
submitted=submitted

Response:

1
2
3
4
5
6
7
<comment>
  <id>3</id>
  <body>
    <![CDATA[Making a new comment using API]]>
  </body>
  ...
</comment>

{context}/comments/lock #

This command disables the commenting feature and returns a detailed description of the parent object.

Method: POST

Request example:

1
submitted = submitted

Response:

1
2
3
4
5
6
7
8
9
10
<discussion>
  <id>2</id>
  <name>
    <![CDATA[Example Discussion]]>
  </name>
  ...
  <comments_count>3</comments_count>
  <is_locked>1</is_locked>
  ...
</discussion>

{context}/comments/unlock #

This command enables the commenting feature and returns a detailed description of the parent object.

Method: POST

Request example:

1
submitted = submitted

Response:

1
2
3
4
5
6
7
8
9
10
<discussion>
  <id>2</id>
  <name>
    <![CDATA[Example Discussion]]>
  </name>
  ...
  <comments_count>3</comments_count>
  <is_locked>0</is_locked>
  ...
</discussion>

{context}/comments/:comment_id #

This command displays comment details.

Method: GET

Response:

1
2
3
4
5
6
7
<comment>
  <id>3</id>
  <body>
    <![CDATA[Comment Text]]>
  </body>
  ...
</comment>

{context}/comments/:comment_id/edit #

This command updates an existing comment.

Method: POST

Request example:

1
2
comment[body]=Comment updated using API
submitted=submitted

Response:

1
2
3
4
5
6
7
<comment>
  <id>3</id>
  <body>
    <![CDATA[Comment updated using API]]>
  </body>
  ...
</comment>