Send a new message

Ask the Community

Add a message to a thread or create a new one


Overview #

Add a new message to a thread. The message will be authored by the current user and belong to their current group.
Vanilla JavaScript:
await window.CordSDK.thread.sendMessage(
  'my-awesome-thread-id',
  {
    content: [{ type: 'p', children: [{ text: 'Amazing job!' }]}],
  }
);
await window.CordSDK.thread.sendMessage(
  'my-awesome-thread-id',
  {
    content: [{ type: 'p', children: [{ text: 'Amazing job!' }]}],
  }
);
Copy

What this function returns #

A promise that resolves to true if the operation succeeded or rejects if it failed.

Arguments this function takes #


threadID #

required
string
The ID of the thread to add the message to. If this thread does not yet exist, the createThread parameter determines what happens.


data #

required
ClientCreateMessage
The data values for the new message.

This is an object with the following fields:

Show property details


Not finding the answer you need? Ask our Developer Community

Ask Cordy