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:
idFromandidTobound 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
idToset to the smallest ID received minus 1, until a page comes back with fewer than 20 messages. - Catching up: call with
idFromset to the ID of the last message you hold plus 1. When 20 messages come back there may be more in between: keepidFromand page backwards withidTountil a page has fewer than 20 messages.
A call without
idFromandidToalso 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 showisReadfalse. To read the latest page without that effect, passidFrom=1: it returns the same page and leaves the unread counter alone.
Request
Responses
- 200
- 401
- 404
One page of messages, oldest first.
The API key is missing, invalid, or lacks the INBOX operation.
No conversation with this ID in your account.