Skip to main content
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>'
{
  "error": 401,
  "message": "Invalid or missing authentication token"
}

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

taskId
integer
required
The unique identifier of the task to retrieve comments for.Example: 456

Response

Returns an array of comment objects.
id
integer
The unique identifier of the comment.
task_id
integer
The ID of the task this comment belongs to.
refrence_id
integer
Reference ID (same as task_id).
user_id
integer
The ID of the user who created the comment.
team_id
integer
The ID of the team.
comment
string
The comment text.
type
string
The type of comment.
reaction
object
Reaction data object containing reaction counts and users.
reactedUsers
array
Array of users who reacted to this comment (extracted from reaction object for convenience).
time
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
created_at
string
The timestamp when the comment was created (ISO 8601 format).
updated_at
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

The time field is calculated based on the user’s timezone and displays in the following formats:
Time ElapsedFormatExample
Less than 1 minuteX second ago"30 second ago"
1 minute to 1 hourX minutes ago"15 minutes ago"
1 hour to 12 hoursX hours X minutes ago"2 hours 30 minutes ago"
More than 12 hoursDD/MMM/YYYY HH:MM AM/PM"27/Nov/2025 15:30 PM"

Error Responses

{
  "error": 401,
  "message": "Invalid or missing authentication token"
}

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 reactedUsers array
  • HTML support: Comments may contain HTML formatting
  • Relative time: The time field 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 time field for display, but created_at for sorting/filtering

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

taskId
integer<int64>
required

The unique identifier of the task

Example:

456