Developer Documentation

Riffre API Reference

Everything you need to send WhatsApp text, template, media and interactive messages from your own systems.

Get Conversation History

Fetch the last 10 messages exchanged with one customer number, oldest first, with time, sender and message text.

Last updated 14 Aug 2026

Endpoint

GET /conversation-history.php

Requires the Authorization: Bearer header described in Authentication.

Query parameters

FieldTypeRequiredDescription
tostringyesThe customer's phone number, digits only after stripping non-digit characters.

Example request

curl "https://your-riffre-domain.com/api/v1/conversation-history.php?to=919876543210" \
  -H "Authorization: Bearer rf_live_YOUR_API_KEY"

Success response

200 OK:

{
  "to": "919876543210",
  "messages": [
    {
      "time": "2026-08-14 12:40:11",
      "direction": "inbound",
      "sender": "Asha Rao",
      "type": "text",
      "message": "Is my order still on the way?"
    },
    {
      "time": "2026-08-14 12:42:03",
      "direction": "outbound",
      "sender": "Agent · Priya Nair",
      "type": "text",
      "message": "Yes! It left our warehouse this morning and should arrive tomorrow."
    }
  ]
}
FieldDescription
timeWhen the message was sent or received.
directioninbound (from the customer) or outbound (from your account).
senderThe contact's name for inbound messages; "Agent · <name>" or "Client" for outbound messages, matching who actually sent it.
typeThe WhatsApp message type (text, image, template, interactive, etc).
messageHuman-readable message text - the rendered template body for template messages, the caption or a type label for media.

Returns up to the last 10 messages, oldest first.

Errors specific to this endpoint

error slugHTTP statusCause
a_valid_to_number_is_required422to is missing, or is not 8-15 digits after stripping non-digit characters.
no_conversation_was_found_with_that_number404No conversation exists with to on this WhatsApp number.

For the full error shape and general status codes, see Errors.