Setup

To use the Conversations API, install the @wix/inbox package using npm or Yarn:

Copy
1
npm install @wix/inbox

or

Copy
1
yarn add @wix/inbox

Then import { conversations } from @wix/inbox:

Copy
1
import { conversations } from '@wix/inbox'
Was this helpful?
Yes
No

getConversation( )

Developer Preview

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

Retrieves a conversation by conversation ID.

If you don't have the conversation ID, use getOrCreateConversation() to retrieve the conversation using the visitor, contact, or member ID.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Inbox Messages
Read Inbox Messages
Learn more about permission scopes.
Copy
function getConversation(conversationId: string): Promise<Conversation>
Method Parameters
conversationIdstringRequired
Conversation ID.
Returns
Return Type:Promise<Conversation>
Was this helpful?
Yes
No

getOrCreateConversation( )

Developer Preview

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

Retrieves a conversation by the specified visitor, contact, or member ID. If the conversation does not exist for the provided visitor, contact, or member, the function creates a new conversation.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Inbox Messages
Learn more about permission scopes.
Copy
function getOrCreateConversation(participantId: ParticipantId): Promise<GetOrCreateConversationResponse>
Method Parameters
participantIdParticipantIdRequired
ID of the visitor, contact, or member chatting with the business.
Returns
Return Type:Promise<GetOrCreateConversationResponse>
Was this helpful?
Yes
No