SysUpdateChatMessage
Update the specified chat message. Message can have been from any user (or system). Version provided must match (or pass -1 to bypass version enforcement).
Service | Operation |
---|---|
chat | SYS_UPDATE_CHAT_MESSAGE |
Method Parameters
Parameter | Description |
---|---|
channelId | The channel id of the message. |
msgId | The id of the message to update. |
version | The version of the message. Pass it -1 to bypass version checking. |
content | The replacement content for the message. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
var channelId = "55555:gl:bcDev";
var msgId = "the-message-id";
var version = 1;
var content = {
"text": "New plain text message",
"custom": {
"somethingNew": "amazing"
}
};
var chatProxy = bridge.getChatServiceProxy();
var postResult = chatProxy.sysUpdateChatMessage(channelId, msgId, version, content);
if (postResult.status == 200) {
// Success!
}
{
"service": "chat",
"operation": "SYS_UPDATE_CHAT_MESSAGE",
"data": {
"channelId": "55555:gl:bcDev",
"msgId": "the-message-id",
"version": 1,
"content": {
"text": "New plain text message",
"custom": {
"somethingNew": "amazing"
}
}
}
}
JSON Response
{
"status": 200,
"data": {}
}
Common Error Code
Status Codes
Code | Name | Description |
---|---|---|
40346 | INSUFFICIDENT_PERMISSIONS | The channel id provided is invalid. |
40595 | CHAT_MESSASAGE_NOT_FOUND | The specified message cannot be found |
40601 | RTT_NOT_ENABLED | RTT must be enabled for this feature |
40603 | CHAT_UNRECOGNIZED_CHANNEL | The specified channel is invalid |
40616 | CLOUD_CODE_ONLY | Method only available via cloud code |