POST
/
messages
/
{id}
/
thread
Send Threaded Message
curl --request POST \
  --url https://{appid}.api-{region}.cometchat.io/v3/messages/{id}/thread \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --header 'onBehalfOf: <onbehalfof>' \
  --data '{
  "receiver": "<string>",
  "receiverType": "user",
  "category": "message",
  "type": "text",
  "data": {
    "text": "Hi Tom!",
    "metadata": {
      "key1": "value1",
      "key2": "value2"
    }
  },
  "multipleReceivers": {
    "uids": [
      "uid1",
      "uid2"
    ],
    "guids": [
      "guid1"
    ]
  },
  "tags": [
    "tag1"
  ]
}'
{
  "data": {
    "id": "2",
    "conversationId": "superhero3_user_superhero5",
    "sender": "superhero3",
    "receiverType": "user",
    "receiver": "superhero5",
    "category": "message",
    "type": "text",
    "data": {
      "text": "test     hello",
      "metadata": {
        "key1": "val1"
      },
      "entities": {
        "sender": {
          "entity": {
            "uid": "superhero3",
            "name": "Spiderman",
            "avatar": "https://data-us.cometchat.io/assets/images/avatars/spiderman.png",
            "status": "offline",
            "role": "default",
            "createdAt": 1638361550
          },
          "entityType": "user"
        },
        "receiver": {
          "entity": {
            "uid": "superhero5",
            "name": "Cyclops",
            "avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png",
            "status": "offline",
            "role": "default",
            "createdAt": 1638361550,
            "conversationId": "superhero3_user_superhero5"
          },
          "entityType": "user"
        }
      }
    },
    "sentAt": 1638423490,
    "updatedAt": 1638423490,
    "parentId": "1"
  }
}

Authorizations

apikey
string
header
required

API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).

Headers

onBehalfOf
string
required

UID of the user on whose behalf the action is performed.

Path Parameters

id
string
required

Id of the message for which thread message to be sent

Body

application/json
receiver
string

The receiver of the message.

receiverType
enum<string>

The receiverType of the message. either user or group

Available options:
user,
group
category
enum<string>
default:message

Category of the message. The available categories are message and custom.

Available options:
message,
custom
type
enum<string>
default:text

Type of the message. The available values are text, image, file, audio, video.

Available options:
text,
image,
file,
audio,
video
data
object

JSON containing message attributes.

multipleReceivers
object

JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {"uids": ["uid1","uid2"], "guids":["guid1"]}

tags
string[]

A list of tags to identify specific messages.

Response

200 - application/json

Create Message

data
object

Response data