Endpoint #
GET /wp-json/rtcl/v1/my/chat/conversation
Description #
Fetch messages of a specific chat conversation for the authenticated user.
Authentication #
This endpoint is protected and requires:
- ✅ REST API enabled
- ✅ Valid API Key
- ✅ Valid JWT Bearer Token
Required Headers #
| Header | Value |
|---|---|
| Authorization | Bearer YOUR_JWT_TOKEN |
| X-API-KEY | YOUR_API_KEY |
| Content-Type | application/json |
Query Parameters #
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| con_id | integer | ✅ Yes | — | Conversation ID |
| per_page | integer | ❌ No | 50 | Messages per page |
| page | integer | ❌ No | 1 | Current page |
Example Request (cURL) #
curl -X GET "https://example.com/wp-json/rtcl/v1/my/chat/conversation?con_id=10&per_page=20&page=1" \
-H "Authorization: Bearer DEMO_JWT_TOKEN" \
-H "X-API-KEY: DEMO_API_KEY"
Success Response (200) #
{
"con_id": 2,
"listing": {
"id": 101,
"title": "Demo Listing",
"url": "http://example.com/listing/demo-listing/",
"images": [],
"amount": "<div class=\"rtcl-price price-type-fixed\"><span class=\"rtcl-price-amount amount\"><bdi>100<span class=\"rtcl-price-currencySymbol\">$</span></bdi></span></div>",
"raw_price": "100",
"location": [],
"category": [
{
"term_id": 1,
"name": "Demo Category",
"slug": "demo-category",
"term_group": 0,
"term_taxonomy_id": 1,
"taxonomy": "rtcl_category",
"description": "",
"parent": 0,
"count": 2,
"filter": "raw"
}
]
},
"unread_count": 0,
"sender": {
"id": 2,
"name": "Demo Sender",
"email": "sender@example.com",
"phone": "",
"whatsapp": "",
"website": "",
"profile_picture": "https://www.gravatar.com/avatar/demo1?s=96&d=mm&r=g"
},
"recipient": {
"id": 1,
"name": "Demo Recipient",
"email": "recipient@example.com",
"phone": "",
"whatsapp": "",
"website": "",
"profile_picture": "https://www.gravatar.com/avatar/demo2?s=96&d=mm&r=g"
},
"listing_id": 101,
"sender_id": 2,
"recipient_id": 1,
"sender_delete": false,
"recipient_delete": false,
"last_message_id": 6,
"sender_review": false,
"recipient_review": false,
"invert_review": false,
"created_at": "2026-01-27 09:44:04",
"updated_at": "2026-01-27 09:44:38",
"last_message": "Price is $300",
"last_message_created_at": "2026-01-27 09:44:38",
"messages": [
{
"message_id": "6",
"con_id": "2",
"source_id": "1",
"type": "text",
"message": "Price is $300",
"attachments": null,
"meta": null,
"is_read": "1",
"created_at": "2026-01-27 09:44:38"
},
{
"message_id": "5",
"con_id": "2",
"source_id": "1",
"type": "text",
"message": "Hello!",
"attachments": null,
"meta": null,
"is_read": "1",
"created_at": "2026-01-27 09:44:32"
},
{
"message_id": "4",
"con_id": "2",
"source_id": "2",
"type": "text",
"message": "What is the price?",
"attachments": null,
"meta": null,
"is_read": "1",
"created_at": "2026-01-27 09:44:08"
},
{
"message_id": "3",
"con_id": "2",
"source_id": "2",
"type": "text",
"message": "Hi there!",
"attachments": null,
"meta": null,
"is_read": "1",
"created_at": "2026-01-27 09:44:04"
}
],
"pagination": {
"total": 4,
"per_page": 50,
"current_page": 1,
"total_pages": 1
}
}
Error Responses #
Not Logged In (403) #
{
"code": "FORBIDDEN",
"message": "You are not logged in."
}
Invalid Conversation / No Access (403) #
{
"code": "FORBIDDEN",
"message": "You are not permitted to access this conversation."
}
Missing Authorization Header #
{
"status": "error",
"error": "MISSING_AUTHORIZATION_HEADER",
"code": "401",
"error_message": "Authorization header not received. Either authorization header was not sent or it was removed by your server due to security reasons."
}
Invalid Authorization Token Type #
{
"status": "error",
"error": "INVALID_AUTHORIZATION_HEADER_TOKEN_TYPE",
"code": "401",
"error_message": "Authorization header must be type of Bearer Token."
}
Invalid JWT Format (Segment Fault) #
{
"status": "error",
"error": "SEGMENT_FAULT",
"code": "401",
"error_message": "Incorrect JWT Format."
}
Invalid JWT Signature #
{
"status": "error",
"error": "INVALID_TOKEN",
"code": "401",
"error_message": "JWT signature verification failed."
}
REST API Access Disabled #
{
"code": "DENIED_REST_API",
"message": "Denied api call",
"data": {
"status": 403
}
}