Endpoint #
POST /wp-json/rtcl/v1/listing/report
Description #
Allows a logged-in user to report a listing to the site administrator with a message.
The listing owner cannot report their own listing.
Required Headers #
| Header | Required | Description |
|---|---|---|
Content-Type | ✅ | application/json |
X-API-KEY | ✅ | REST API key |
Authorization | ✅ | Bearer <access_token> |
Request Parameters #
| Field | Type | Required | Description |
|---|---|---|---|
listing_id | integer | ✅ | Listing ID to report |
message | string | ✅ | Report message / reason |
cURL Example #
curl -X POST "https://example.com/wp-json/rtcl/v1/listing/report" \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"listing_id": 245,
"message": "This listing contains misleading information."
}'
Success Response #
Returns the total abuse report count for the listing.
3
Meaning: This listing has been reported 3 times in total.
Error Responses #
Not Logged In #
{
"status": "error",
"error": "FORBIDDEN",
"code": "403",
"error_message": "You are not logged in."
}
Listing Not Found / Invalid Post Type #
{
"status": "error",
"error": "BADREQUEST",
"code": "400",
"error_message": "Listing not found."
}
Reporting Own Listing #
{
"status": "error",
"error": "BADREQUEST",
"code": "400",
"error_message": "You are not permitted to report."
}
Email Sending Failed #
{
"status": "error",
"error": "BADGATEWAY",
"code": "502",
"error_message": "Error while sending mail for some server issue."
}