API Comment Reports
This section provides API endpoints for managing reported comments, allowing administrators to review, delete, or block users based on reports.
API Calls
- Fetch all comment reports:
fetchAllCommentReports
- Get a specific report:
fetchCommentReportById
- Take action on a report:
handleCommentReportAction
- Delete a report:
deleteCommentReport
- Get pending reports count:
getPendingCommentReportsCount
API Documentation
1. Get All Comment Reports
Endpoint: /reports/comments
Method: GET
Description: Retrieves all comment reports with filtering options.
Query Parameters:
page
: Number (pagination)limit
: Number (pagination limit)status
: String (pending
,resolved
)blockAuthor
: String (yes
,no
)
Response:
2. Get a Specific Report
Endpoint: /reports/comments/{reportId}
Method: GET
Description: Retrieves details of a specific reported comment.
Response:
3. Take Action on a Comment Report
Endpoint: /reports/comments/{reportId}/action
Method: POST
Description: Performs administrative actions on a reported comment.
Request Body:
Available Actions:
delete_comment
– Deletes the reported comment.block_author
– Blocks the author of the comment.resolve
– Marks the report as resolved.
Response:
4. Delete a Comment Report
Endpoint: /reports/comments/{reportId}
Method: DELETE
Description: Deletes a comment report from the system.
Response:
5. Get Pending Comment Reports Count
Endpoint: /reports/comments/pending-count
Method: GET
Description: Retrieves the number of pending comment reports.
Response:
Conclusion
The Comment Reports Management system ensures that administrators can efficiently handle reported comments, maintaining content integrity on the platform. The API endpoints streamline moderation and provide a structured approach to handling reports.