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.
You can only call this method when authenticated as a Wix app or Wix user identity.
ID of the conversation to add the message to.
Message to send.
Controls whether the message triggers notifications when it's received.
Defaults to false
.
Controls whether the unread count and conversation summary are updated in the Message List.
If true
, unread count and conversation summary are not updated.
Defaults to false
.
Controls which identity to use in the message's sender
property.
CALLER
: Uses the identity included in the request header.PARTICIPANT
: Uses the anonymousVisitorId
, contactId
, or memberId
of the conversation's participant.BUSINESS_USER
: For internal use. Uses the wixUserId
of the person sending messages on behalf of the business.Defaults to CALLER
.
For 3rd-party apps, the app is the caller.
Sent message.
curl -X POST \
'https://www.wixapis.com/inbox/v2/messages' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
"conversation_id": "6202c3bb-f263-3c16-8c90-d6387d9ed420",
"send_notifications": true,
"silent": false,
"typing_delay": 0,
"send_as": "CALLER",
"message": {
"badges": [
{
"text": "Email",
"badge_visibility": "BUSINESS",
"icon_url": "https://wixmp-9127dea18607b759d29e6784.wixmp.com/badges/mailSmallFlat.png"
}],
"target_channels": [
"EMAIL"
],
"content": {
"preview_text": "Hey!",
"basic": {
"items": [
{
"text": "Hey!"
}
]
}
},
"source_channel": "CHAT",
"visibility": "BUSINESS_AND_PARTICIPANT",
"direction": "BUSINESS_TO_PARTICIPANT"
}
}'
{
"message": {
"id": "1640849952353627",
"content": {
"previewText": "Hey!",
"basic": {
"items": [
{
"text": "Hey!"
}
]
}
},
"sender": {
"wixUserId": "5a0c4737-a2a0-4c37-a07e-d9fd87027023"
},
"badges": [
{
"text": "Email",
"iconUrl": "https://wixmp-9127dea18607b759d29e6784.wixmp.com/badges/mailSmallFlat.png",
"badgeVisibility": "BUSINESS"
}
],
"targetChannels": ["EMAIL"],
"sourceChannel": "CHAT",
"appId": "141fbfae-511e-6817-c9f0-48993a7547d1",
"visibility": "BUSINESS_AND_PARTICIPANT",
"sequence": "1640849952353627",
"direction": "BUSINESS_TO_PARTICIPANT",
"createdDate": "2021-12-30T07:39:12.353Z"
}
}
There is 1 error with this status code.
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.