Search.../
  1. Home
  2. Getting Started
  3. Overview
Generate a test token to explore our APIs

Send Message

Sends a text message to a specific channel (AKA chat) on behalf of the site owner

Authorization

This endpoint requires an authorization header - pass the access token from the OAuth installation flow.

Permissions

This endpoint requires the Manage Chats permission scope.

POST

https://www.wixapis.com/chat/v1/channels/{channelId}/messages

Path Params

NAME
TYPE
DESCRIPTION
channelId
Required

string

Chat ID this message is part of

Body Params

NAME
TYPE
DESCRIPTION
type

string

Supported values: TEXT.

Message type (e.g., text, image, file). Currently only text is supported

payload

object

Message payload

metadata

object

Set of key-value pairs. Any extra data that is valuable for this message

Response Object

Send message response

NAME
TYPE
DESCRIPTION
message

object

Message that was sent

Status/Error Codes

The response will include an HTTP status code.

Was this helpful?

Request

curl

Copy Code
1curl -X POST \
2 https://www.wixapis.com/chat/v1/channels/3762db18-9231-41db-bfc6-0adcdf01c41d/messages \
3 -H 'authorization: <AUTH>' \
4 -H 'cache-control: no-cache' \
5 -H 'content-type: application/json' \
6 -d '{
7 "channelId": "3762db18-9231-41db-bfc6-0adcdf01c41d",
8 "type": "TEXT",
9 "payload": {
10 "text": "testing from rest"
11 },
12 "metadata": {}
13}'

Response

json

1
2{"message": {
3 "sequence": "1581520287964268",
4 "channelId": "3762db18-9231-41db-bfc6-0adcdf01c41d",
5 "type": "TEXT",
6 "summary": "testing from rest",
7 "participantId": "2551a0f7-65ad-430e-b073-73b842a21d1f",
8 "createdDate": "2020-02-12T15:11:27Z",
9 "metadata": {},
10 "payload": {"text": "testing from rest"},
11 "sender": {
12 "id": "8ac81d4e-45d0-426c-bd2d-2597af00dac0",
13 "role": "Admin"
14 },
15 "direction": "BusinessToVisitor"
16}}