Skip to content
View as Markdown
Enter your site to enable Send. Requests are sent from your browser, so the site must allow cross-origin calls (CORS).

GET Subscriber WhatsApp Messages​

GET
/whatsapp/subscribers/{id}/messages

Paginated WhatsApp conversation history for one contact, read from the contact's WhatsApp thread (fc_message_threads / fc_messages). A contact with no WhatsApp thread returns an empty page, not an error, and the contact ID is not checked for existence. Default order is oldest first (the chat panel loads the last page for the newest messages and pages backwards); pass order=desc for newest first. Ordering uses COALESCE(sent_at, created_at) with the ID as tie-break.

The same response also carries stats and session, so one poll refreshes the counters, the 24-hour window banner and the composer state.

PRO (FluentCampaign Pro). The route exists only while the Messaging module (the messaging_module experimental setting) is switched on, and the policy answers 403 unless at least one channel (SMS or WhatsApp) is active.

Required capability: fcrm_read_emails or fcrm_manage_emails — which one applies depends on the action being performed.

Enforced by MessagePolicy::verifyRequest(), the policy default for this route group.

Requires: FluentCampaign Pro with the Messaging module enabled. While no messaging channel (SMS or WhatsApp) is switched on the route is not registered at all and returns a 404.

Authorizations​

ApplicationPasswords

WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password

Type
API Key (header: Authorization)

Parameters​

Path Parameters

id*

Contact (subscriber) ID.

Type
integer
Required

Query Parameters

page

Page number.

Type
integer
Default
1
per_page

Rows per page, 1-200; any other value falls back to 20.

Type
integer
Default
20
order

Sort direction by message time.

Type
string
Valid values
"asc""desc"
Default
"asc"
filter_type

Narrow the history; unknown values return everything.

Type
string
Valid values
"sent""received""campaign""custom""read"

Responses​

Messages, stats and session state.

application/json
JSON
{
"messages": {
"total": 0,
"per_page": 0,
"current_page": 0,
"last_page": 0,
"from": 0,
"to": 0,
"next_page_url": "string",
"prev_page_url": "string",
"data": [
{
"id": 0,
"thread_id": 0,
"direction": "string",
"content": "string",
"message_content": "string",
"message_type": "string",
"template_name": "string",
"ref_type": "string",
"ref_id": 0,
"status": "string",
"provider_message_id": "string",
"scheduled_at": "string",
"sent_at": "string",
"timestamp": "string",
"meta": {
},
"media": [
{
"type": "string",
"url": "string",
"mime_type": "string",
"filename": "string",
"caption": "string",
"filesize": 0,
"stored": true
}
],
"created_by": 0,
"created_at": "string",
"updated_at": "string"
}
]
},
"stats": {
"total": 0,
"sent": 0,
"received": 0,
"campaign": 0,
"read": 0
},
"session": {
"has_active_session": true,
"last_inbound_at": "string",
"expires_at": "string",
"last_inbound_at_iso": "string",
"expires_at_iso": "string",
"inbound_count": 0
}
}

Playground​

Authorization
Variables
Key
Value

Samples​

Powered by VitePress OpenAPI