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
Optionally, you can set the page from which to start retrieving results. This is usually used in conjunction with the parameter pageSize.
See How does paging work for more detailed documentation on pagination. For example: ?page=2&pageSize=10 will retrieve results 10-20.
- Name
pageSize
- Type
- integer
- Description
The amount of comments returned can be limited using this parameter. Normally used in conjunction with the page parameter. Minimum: 1
- Default
100
- 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 - The order to sort the returned data
- Default
asc
- Allowed values
asc
desc
- Name
updatedAfterDate
- Type
- string
- Description
YYYYMMDDHHMMSS format timestamp - will return only comments updated since this eg. 20121119013000.
- Name
getLikes
- Type
- boolean
- Description
- Default
false
- Name
getReactions
- Type
- boolean
- Description
- Default
false
- 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.
- Default
false
- Name
includeArchivedProjects
- Type
- boolean
- Description
Defaulted to false.
- Default
false
Responses
- Code
- 200
- Type
- object
- Schema
- Description
- 200 Response
200 Response
{
"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"
}