sendMessage( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Sends a message to the business or participant.

Specify the message type in message.content by including the appropriate object: basic, template, minimal, or form. For more information on message types and how each type renders in Inbox and the Chat widget, see Message Types.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Inbox Messages
Learn more about app permissions.
Method Declaration
Copy
function sendMessage(
  conversationId: string,
  message: Message,
  options: SendMessageOptions,
): Promise<SendMessageResponse>;
Method Parameters
conversationIdstringRequired

ID of the conversation to add the message to.


messageMessageRequired

Message to send.


optionsSendMessageOptions

Additional options for sending a message.

Returns
Return Type:Promise<SendMessageResponse>
JavaScript
import { messages } from "@wix/inbox"; async function sendMessage(conversationId, message, options) { const response = await messages.sendMessage(conversationId, message, options); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?