messages.forwardToGroupOfUsers()

This method allows you to forward a message to a new group of Users with or without priority.

It is required to specify the organizationId option, since conversations with the same users can be present in different organizations.

Definition

client.messages.forwardToGroupOfUsers(
messageId: string|Object,
userIds: Array<string>|Array<User>,
options: ?Object
)

Parameters

ParameterTypeDescription
messageIdstring|MessageA message ID or message object that is to be forwarded
userIdsArray<string>|Array<User>Users to add to the new group
options?ObjectOptions (described below)

Options

ParameterTypeDescription
organizationIdstringThe organization in which the message should be sent
priority?stringIndicates priority level of message. Values: NORMAL (default), HIGH
senderId?stringID of the user who is forwarding the message, default is current user

Returns

An error will be thrown if the messageId or userIds are invalid.

Otherwise, once the returned Promise is resolved, you will have a newly forwarded Message.

Example

Forward to group of users with normal priority:

const forwardedMessage = await client.messages.forwardToGroupOfUsers(
'some-message-id',
['user-id-1', 'user-id-2'],
{
organizationId: 'some-org-id',
priority: client.enums.MessagePriority.NORMAL
}
);
console.log(
'forwarded message to', forwardedMessage.counterParty.name,
'with priority of ', forwardedMessage.priority,
'original message from', forwardedMessage.originalSender.name
);