GET/comments.json

Retrieving Comments across all types

Get call to get all recent comments without passing in a resource. The field 'commentable_type' will tell you which resource the comment is linked with.

Notes

Passing in "page" and "pageSize": eg. GET /tasks/7/comments.json?page=2&pageSize=50.

The following headers are returned:

  • X-Records - The total number of replies
  • X-Pages - The total number of pages
  • X-Page - The page you requested

Important Note:

When returned comments on a file, the returned commentable_type field is file but the commentable-id field relates to the File Version ID


Query Params

  • Name
    page
    Type
    integer
    Description
  • Name
    pageSize
    Type
    integer
    Description
  • Name
    objectType
    Type
    string
    Description
    Use this filter the comment type. Default="task,notebook,milestone,file,resource,link"
  • Name
    userId
    Type
    string
    Description
    List of users who commented.
  • Name
    orderBy
    Type
    string
    Description
    Defaulted to date.
  • Name
    sortOrder
    Type
    string
    Description
    asc or desc. Default asc.
  • Name
    updatedAfterDate
    Type
    string
    Description
    YYYYMMDDHHMMSS format timestamp - will return only comments updated since this eg. 20121119013000.
  • Name
    getLikes
    Type
    boolean
    Description
  • Name
    getReactions
    Type
    boolean
    Description
  • Name
    projectStatuses
    Type
    string
    Description
    Filter based on if the project is active. Default "all".
  • Name
    projectCompanyIds
    Type
    integer
    Description
    List of company ids to return comments from thoses companies.
  • Name
    projectCategoryIds
    Type
    integer
    Description
  • Name
    projectOwnerIds
    Type
    integer
    Description
  • Name
    onlyStarredProjects
    Type
    boolean
    Description
    Defaulted to false.
  • Name
    includeArchivedProjects
    Type
    boolean
    Description
    Defaulted to false.

Responses

  • Code
    200
    Type
    object
    Schema
    Description
    200 Response

Examples

200 Response

application/json
{
  "comments": [
    {
      "project-id": "999",
      "attachments_count": "0",
      "author-lastname": "User",
      "commentable-id": "999",
      "commentable_type": "todo_items",
      "emailed-from": "",
      "isRead": "1",
      "private": "0",
      "lockdown-id": "",
      "datetime": "2014-03-31T13:03:29Z",
      "author-avatar-url": "https://s3.amazonaws.com/TWFiles/2/users/999.avatar",
      "author_id": "999",
      "id": "999",
      "company-name": "Demo 1 Company",
      "last-changed-on": "",
      "content-type": "HTML",
      "nr-notified-people": "0",
      "type": "task",
      "item-name": "Test Task",
      "attachments-count": "0",
      "_author_id": {
        "deprecated": true
      },
      "company-id": "999",
      "html-body": "A test comment",
      "project-name": "demo",
      "body": "A test comment",
      "commentNo": "1",
      "attachments": [],
      "author-firstname": "Demo",
      "comment-link": "tasks/436523?c=93",
      "author-id": "999"
    }
  ],
  "STATUS": "OK"
}