Send a message to a room.
Name | Requires Auth | Permission | Setting |
---|---|---|---|
sendMessage |
Yes |
Argument | Example | Required | Description |
---|---|---|---|
message |
|
||
"_id": "8gMsLe9ApZjo2D2iB", |
"rid": "64a1f373376181965ab77f54",
"msg": "Hello World!"
}
| Required | The message object. |
The message
object contains the following properties:
_id | 8gMsLe9ApZjo2D2iB | The message id |
rid | 64a1f373376181965ab77f54 | The room id where the message should be sent |
msg | Hello World | The message content to be sent. |
{
"msg": "method",
"method": "sendMessage",
"id": "423",
"params": [
{
"_id": "8gMsLe9A7pZjo2D2iB",
"rid": "64a1f373376181965ab77f54",
"msg": "Hello World!"
}
]
}
{
"msg": "result",
"id": "423",
"result": {
"_id": "8gMsLe9A7pZjo2D2iB",
"rid": "64a1f373376181965ab77f54",
"msg": "Hello World!",
"ts": {
"$date": 1688421337724
},
"u": {
"_id": "LFdhbcNHx5zsMA7T4",
"username": "test.rc",
"name": "Test RC"
},
"_updatedAt": {
"$date": 1688421337830
},
"urls": [],
"mentions": [],
"channels": [],
"md": [
{
"type": "PARAGRAPH",
"value": [
{
"type": "PLAIN_TEXT",
"value": "Hello World!"
}
]
}
]
}
}
{% hint style="info" %} To send a file, use the Upload File to a Room endpoint. {% endhint %}