Send a new livechat message to a visitor.
HTTP Method | URL | Requires Auth |
---|---|---|
POST | /api/v1/livechat/message | no |
Key | Example Value | Description |
---|---|---|
token * | iNKE8a6k6cjbqWhWd | The visitor token. |
rid * | zRAeTszXor8CCPceB | The room ID. |
msg * | Hello World! | The message to send to the visitor. |
_id | abcdje928390 | If you do not enter any value, a message ID is automatically generated. If you want to override the message ID in the database with your own, enter a random unique string. |
agent |
| The agent parameter is an object. Enter the ID and the username of the agent. |
{% code overflow="wrap" %}
curl --location 'http://localhost:3000/api/v1/livechat/message' \
--header 'Content-Type: application/json' \
--data '{
"token": "54fc5544030bcecda053311cb6b",
"rid": "hGFwSKA28nRKut3pD",
"msg": "Hello World!",
"agent": {
"agentId": "CkCPNcvsvCDfmWLqC",
"username": "kim.jane"
}
}'
{% endcode %}
{
"message": {
"_id": "djsajdkscks787",
"rid": "hGFwSKA28nRKut3pD",
"msg": "Hello World!",
"token": "54fc5544030bcecda053311cb6b98920bdf953f242c129d7b8065000b1f9b2e9",
"alias": "Baek",
"ts": "2023-10-31T13:14:29.804Z",
"u": {
"_id": "6523dc0ba2f73c7460e18d4d",
"username": "guest-35",
"name": "Baek"
},
"_updatedAt": "2023-10-31T13:14:29.960Z",
"urls": [],
"mentions": [],
"channels": [],
"md": [
{
"type": "PARAGRAPH",
"value": [
{
"type": "PLAIN_TEXT",
"value": "Hello World!"
}
]
}
]
},
"success": true
}