messages.ensureRecipientStatus()

Fetches all message.statusesPerRecipient for both 1-on-1 and group messages.

This should be called when a message is visible in the conversation (in UI), and for last messages that show up in the inbox.

If there are multiple statuses being changed at once, the server may batch them automatically.

Definition

client.messages.ensureRecipientStatus(
id: string|Message,
options: ?Object
):Promise<MessageStatusPerRecipient[],Error>

Parameters

ParameterTypeDescription
idstring|ObjectA message ID or Message object
options?ObjectOptions (described below)

Options

ParameterTypeDescription
includeUsersbooleanWhether to ensure that all users are also loaded (default: false)
queuebooleanIf false, do not allow this request to be batched and fetch the statuses immediately (default: true)

Returns

An error will be thrown if any of the arguments are invalid.

Otherwise, once the returned Promise is resolved, returns the message.statusesPerRecipient array (of type MessageStatusPerRecipient).

Example

const statusesPerRecipient = await client.messages.ensureRecipientStatus(
id: 'some-message-id',
{
includeUsers: 'true',
queue: 'true',
}
)
message.statusesPerRecipient.forEach(function (status) {
console.log(status.user.displayName, status.status, status.createdAt);
});