Skip to main content

List Comments

Retrieve paginated top-level comments for a content item (e.g. a post). Each comment includes a reply count and inline reaction data.

Endpoint

GET /api/chat

Authentication

Optional. When authenticated, each comment includes myReactions showing the caller's own emoji reactions.

Query Parameters

ParameterTypeRequiredDescription
contentIdintegerYesThe content item ID whose comments to fetch
itemsPerPageintegerNoNumber of comments per page. Default: 25
currentPageintegerNoPage number (1-based). Default: 1

Response

Success Response

Status Code: 200 OK

{
"items": [
{
"id": 1693,
"message": "<p>So glad to hear that!</p>",
"messagePlain": "So glad to hear that!",
"displayName": "Bruce van Zyl",
"deleted": false,
"moderationCategory": null,
"isEdited": false,
"editedAt": null,
"createdAt": "2024-08-09T22:36:45.000Z",
"replyCount": 3,
"reactions": [
{ "emoji": "heart", "count": 5 },
{ "emoji": "thumbs_up", "count": 2 }
],
"myReactions": ["heart"],
"User": {
"id": 6604,
"name": "Bruce van Zyl",
"photoUrl": "1639671861952.png",
"banned": false
}
}
],
"totalItems": 12,
"currentPage": 1,
"itemsPerPage": 25,
"totalPages": 1
}

Key Response Fields

FieldTypeDescription
replyCountintegerNumber of threaded replies under this comment
reactionsarrayArray of { emoji, count } — aggregated reaction counts
myReactionsstring[]Emoji identifiers the authenticated user has reacted with
messagePlainstringPlain text version of the comment body
deletedbooleanSoft-deleted comments still appear (display "deleted" in UI)
moderationCategorystringComments flagged as Profanity or Spam are excluded from results

Notes

  • Only top-level comments are returned (parentCommentId = null). Use GET /api/replies with the comment's id to fetch threaded replies.
  • Deleted comments are included in results with deleted: true — the frontend should render them as "[deleted]".
  • Comments flagged by moderation (Profanity, Spam) are automatically excluded.
  • Results are ordered by creation date.

Example

Fetch comments on a post

curl -X GET "https://api.tribesocial.io/api/chat?contentId=4212&itemsPerPage=10&currentPage=1" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"

Fetch comments (unauthenticated)

curl -X GET "https://api.tribesocial.io/api/chat?contentId=4212"