Get task comments
curl --request GET \
--url https://app.thareja.ai/api/v3/task/comment/getList/{taskId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.thareja.ai/api/v3/task/comment/getList/{taskId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.thareja.ai/api/v3/task/comment/getList/{taskId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.thareja.ai/api/v3/task/comment/getList/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.thareja.ai/api/v3/task/comment/getList/{taskId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.thareja.ai/api/v3/task/comment/getList/{taskId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.thareja.ai/api/v3/task/comment/getList/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": 401,
"message": "Invalid or missing authentication token"
}
{
"error": 404,
"message": "Task with ID 456 does not exist"
}
{
"error": 403,
"message": "You don't have permission to view comments for this task"
}
Task Comments
Get Task Comments
Retrieve all comments for a specific task in descending order (newest first)
GET
/
api
/
v3
/
task
/
comment
/
getList
/
{taskId}
Get task comments
curl --request GET \
--url https://app.thareja.ai/api/v3/task/comment/getList/{taskId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.thareja.ai/api/v3/task/comment/getList/{taskId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.thareja.ai/api/v3/task/comment/getList/{taskId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.thareja.ai/api/v3/task/comment/getList/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.thareja.ai/api/v3/task/comment/getList/{taskId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.thareja.ai/api/v3/task/comment/getList/{taskId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.thareja.ai/api/v3/task/comment/getList/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": 401,
"message": "Invalid or missing authentication token"
}
{
"error": 404,
"message": "Task with ID 456 does not exist"
}
{
"error": 403,
"message": "You don't have permission to view comments for this task"
}
Overview
Retrieve all comments for a specific task. Comments are returned in descending order (newest first) with relative timestamps based on the user’s timezone.Path Parameters
integer
required
The unique identifier of the task to retrieve comments for.Example:
456Response
Returns an array of comment objects.integer
The unique identifier of the comment.
integer
The ID of the task this comment belongs to.
integer
Reference ID (same as task_id).
integer
The ID of the user who created the comment.
integer
The ID of the team.
string
The comment text.
string
The type of comment.
object
array
Array of users who reacted to this comment (extracted from reaction object for convenience).
string
Human-readable relative time since the comment was posted.Formats:
"X second ago"- Less than 1 minute"X minutes ago"- 1 minute to 1 hour"X hours X minutes ago"- 1 hour to 12 hours"DD/MMM/YYYY HH:MM AM/PM"- More than 12 hours
string
The timestamp when the comment was created (ISO 8601 format).
string
The timestamp when the comment was last updated (ISO 8601 format).
Example Request
curl --request GET \
--url https://staging.thareja.org/api/v3/task/comment/456 \
--header 'Authorization: Bearer YOUR_API_TOKEN'
Example Request (JavaScript)
fetch('https://staging.thareja.org/api/v3/task/comment/456', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
})
.then(response => response.json())
.then(data => console.log(data));
Example Response
[
{
"id": 789,
"task_id": 456,
"refrence_id": 456,
"user_id": 1,
"team_id": 1,
"comment": "This task is progressing well. I've completed the first phase.",
"type": "update",
"reaction": {
"reaction": {
"like": {
"total": 3,
"value": "like"
},
"love": {
"total": 1,
"value": "love"
},
"haha": {
"total": 0,
"value": "haha"
},
"wow": {
"total": 0,
"value": "wow"
},
"sad": {
"total": 0,
"value": "sad"
},
"angry": {
"total": 0,
"value": "angry"
},
"dislike": {
"total": 0,
"value": "dislike"
}
},
"users": [
{
"user_id": 5,
"name": "John Doe",
"reaction": "like"
},
{
"user_id": 7,
"name": "Jane Smith",
"reaction": "like"
}
]
},
"reactedUsers": [
{
"user_id": 5,
"name": "John Doe",
"reaction": "like"
},
{
"user_id": 7,
"name": "Jane Smith",
"reaction": "like"
}
],
"time": "5 minutes ago",
"created_at": "2025-11-28T10:25:00Z",
"updated_at": "2025-11-28T10:25:00Z"
},
{
"id": 788,
"task_id": 456,
"refrence_id": 456,
"user_id": 3,
"team_id": 1,
"comment": "I have a question about the requirements.",
"type": "question",
"reaction": {
"reaction": {
"like": {
"total": 0,
"value": "like"
},
"love": {
"total": 0,
"value": "love"
},
"haha": {
"total": 0,
"value": "haha"
},
"wow": {
"total": 0,
"value": "wow"
},
"sad": {
"total": 0,
"value": "sad"
},
"angry": {
"total": 0,
"value": "angry"
},
"dislike": {
"total": 0,
"value": "dislike"
}
},
"users": []
},
"reactedUsers": [],
"time": "2 hours 15 minutes ago",
"created_at": "2025-11-28T08:15:00Z",
"updated_at": "2025-11-28T08:15:00Z"
},
{
"id": 787,
"task_id": 456,
"refrence_id": 456,
"user_id": 2,
"team_id": 1,
"comment": "Task created and assigned.",
"type": null,
"reaction": {
"reaction": {
"like": {
"total": 1,
"value": "like"
},
"love": {
"total": 0,
"value": "love"
},
"haha": {
"total": 0,
"value": "haha"
},
"wow": {
"total": 0,
"value": "wow"
},
"sad": {
"total": 0,
"value": "sad"
},
"angry": {
"total": 0,
"value": "angry"
},
"dislike": {
"total": 0,
"value": "dislike"
}
},
"users": [
{
"user_id": 1,
"name": "Admin User",
"reaction": "like"
}
]
},
"reactedUsers": [
{
"user_id": 1,
"name": "Admin User",
"reaction": "like"
}
],
"time": "27/Nov/2025 15:30 PM",
"created_at": "2025-11-27T15:30:00Z",
"updated_at": "2025-11-27T15:30:00Z"
}
]
Example Response - Empty Comments
[]
Time Display Format
Thetime field is calculated based on the user’s timezone and displays in the following formats:
| Time Elapsed | Format | Example |
|---|---|---|
| Less than 1 minute | X second ago | "30 second ago" |
| 1 minute to 1 hour | X minutes ago | "15 minutes ago" |
| 1 hour to 12 hours | X hours X minutes ago | "2 hours 30 minutes ago" |
| More than 12 hours | DD/MMM/YYYY HH:MM AM/PM | "27/Nov/2025 15:30 PM" |
Error Responses
{
"error": 401,
"message": "Invalid or missing authentication token"
}
{
"error": 404,
"message": "Task with ID 456 does not exist"
}
{
"error": 403,
"message": "You don't have permission to view comments for this task"
}
Notes
- Timezone awareness: All timestamps are converted to the user’s timezone for display
- Descending order: Comments are returned with the newest first (DESC order by ID)
- Empty arrays: If a task has no comments, an empty array
[]is returned - Reaction data: Each comment includes full reaction data and a convenient
reactedUsersarray - HTML support: Comments may contain HTML formatting
- Relative time: The
timefield provides human-readable timestamps - User timezone: Timestamps are automatically adjusted to match the authenticated user’s timezone setting
- No pagination: All comments are returned in a single response (consider pagination for tasks with many comments)
Use Cases
- Display comment history: Show all discussion on a task
- Track updates: See who commented and when
- Review reactions: Check which comments received reactions
- Timeline view: Build a timeline of task discussions
- Notification context: Provide context for comment notifications
Best Practices
- Cache comment data when possible to reduce API calls
- Refresh comment list after adding/updating/deleting comments
- Display reactions inline for better user engagement
- Consider implementing pagination for tasks with many comments
- Handle empty comment arrays gracefully in your UI
- Use the
timefield for display, butcreated_atfor sorting/filtering
Related Endpoints
- Add Comment - Add a new comment to a task
- Update Comment - Edit an existing comment
- Delete Comment - Remove a comment
- Add Reaction - React to a comment
- Get Task - Retrieve task details