Skip to main content

Get messages of a conversation

GET 

/api/partner-gateway/inbox/conversations/:chatId/messages

Returns one page of the messages of a conversation: the most recent ones in the requested ID range, at most 20 per call, ordered oldest first.

  • Each message carries its direction (inbound or outbound), timestamp, content and delivery status.
  • Range: idFrom and idTo bound the range by message ID, both inclusive. The newest messages of the range are returned, selected by creation time, so take the smallest ID of a page from all its messages, not from the first one.
  • Older messages: call again with idTo set to the smallest ID received minus 1, until a page comes back with fewer than 20 messages.
  • Catching up: call with idFrom set to the ID of the last message you hold plus 1. When 20 messages come back there may be more in between: keep idFrom and page backwards with idTo until a page has fewer than 20 messages.

A call without idFrom and idTo also marks the conversation as read. Its unread counter goes to 0 and the channel is told that every unread inbound message was read, so the contact can see a read receipt. The messages of that same response can still show isRead false. To read the latest page without that effect, pass idFrom=1: it returns the same page and leaves the unread counter alone.

Request​

Responses​

One page of messages, oldest first.