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
| Parameter | Type | Required | Description |
|---|---|---|---|
contentId | integer | Yes | The content item ID whose comments to fetch |
itemsPerPage | integer | No | Number of comments per page. Default: 25 |
currentPage | integer | No | Page 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
| Field | Type | Description |
|---|---|---|
replyCount | integer | Number of threaded replies under this comment |
reactions | array | Array of { emoji, count } — aggregated reaction counts |
myReactions | string[] | Emoji identifiers the authenticated user has reacted with |
messagePlain | string | Plain text version of the comment body |
deleted | boolean | Soft-deleted comments still appear (display "deleted" in UI) |
moderationCategory | string | Comments flagged as Profanity or Spam are excluded from results |
Notes
- Only top-level comments are returned (
parentCommentId = null). UseGET /api/replieswith the comment'sidto 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¤tPage=1" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"
Fetch comments (unauthenticated)
curl -X GET "https://api.tribesocial.io/api/chat?contentId=4212"