10 endpoints.
| Method | Path | Summary |
|---|---|---|
GET | /api/{resourceType}/{resourceId}/comments | Get all comments for a resource |
POST | /api/{resourceType}/{resourceId}/comments | Add a comment to a resource |
POST | /api/{resourceType}/{resourceId}/comments/{commentId} | Reply to a comment (nested comment) |
DELETE | /api/comments/{commentId} | Delete a comment |
PATCH | /api/comments/{commentId} | Edit a comment |
DELETE | /api/comments/{commentId}/like | Unlike a comment |
POST | /api/comments/{commentId}/like | Like a comment |
GET | /api/tweets/{tweetId}/comments | Get tweet comments (تعليقات المنشور) |
POST | /api/tweets/{tweetId}/comments | Add comment to tweet (إضافة تعليق) |
POST | /api/tweets/{tweetId}/comments/{commentId} | Reply to a comment (الرد على تعليق) |
GET /api/{resourceType}/{resourceId}/commentsAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
resourceType | path | yes | string | — |
resourceId | path | yes | string (uuid) | — |
page | query | no | integer | — |
limit | query | no | integer | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | List of comments | — |
POST /api/{resourceType}/{resourceId}/commentsAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
resourceType | path | yes | string | — |
resourceId | path | yes | string (uuid) | — |
Request body (required) — multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
content | string | yes | — |
file | string (binary) | no | — |
Responses
| Status | Description | Body |
|---|---|---|
201 | Comment added successfully | — |
POST /api/{resourceType}/{resourceId}/comments/{commentId}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
resourceType | path | yes | string | — |
resourceId | path | yes | string (uuid) | — |
commentId | path | yes | string (uuid) | — |
Request body (required) — multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
content | string | yes | — |
file | string (binary) | no | — |
Responses
| Status | Description | Body |
|---|---|---|
201 | Reply added successfully | — |
DELETE /api/comments/{commentId}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
commentId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Comment deleted successfully | — |
403 | Not authorized to delete this comment | — |
PATCH /api/comments/{commentId}Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
commentId | path | yes | string (uuid) | — |
Request body (required) — application/json
| Field | Type | Required | Description |
|---|---|---|---|
content | string | yes | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Comment updated successfully | — |
403 | Not authorized to edit this comment | — |
DELETE /api/comments/{commentId}/likeAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
commentId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Comment unliked successfully | — |
POST /api/comments/{commentId}/likeAuth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
commentId | path | yes | string (uuid) | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Comment liked successfully | — |
GET /api/tweets/{tweetId}/commentsReturns paginated comments for a tweet Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
page | query | no | integer | — |
limit | query | no | integer | — |
Responses
| Status | Description | Body |
|---|---|---|
200 | Paginated list of comments | — |
POST /api/tweets/{tweetId}/commentsAdd a new comment to a tweet Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
Request body (required) — application/json
Type: CreateCommentRequest
Responses
| Status | Description | Body |
|---|---|---|
201 | Comment added successfully | — |
403 | User is restricted from commenting | — |
POST /api/tweets/{tweetId}/comments/{commentId}Add a reply to an existing comment Auth: Bearer JWT required.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
tweetId | path | yes | string (uuid) | — |
commentId | path | yes | string (uuid) | — |
Request body (required) — application/json
Type: CreateCommentRequest
Responses
| Status | Description | Body |
|---|---|---|
201 | Reply added successfully | — |