ZEGOCLOUD's In-app Chat (the ZIM SDK) provides the capability of message management, allowing you to send and receive one-to-one, group, in-room messages, query message history, delete messages, and more. With the message management feature, you can meet different requirements of various scenarios such as social entertainment, online shopping, online education, interactive live streaming, and more.
This document describes how to delete the specified messages in a specified session, delete all the messages in a specified session, and delete the specified messages for everyone in a session.
Warning
The ZIM SDK currently supports deleting messages in "one-to-one" and "group" conversations, but does not support deleting messages in "room" conversations.
Implementation process
The ZIM SDK supports deleting specific messages in a conversation or deleting all messages in a conversation. Deleting messages can be divided into "delete local message records" and "delete server message records". Developers can use the ZIMMessageDeleteConfig object to set advanced properties for deleting messages.
By default, a deletion operation only takes effect for the current user. To make the specified messages invisible to all members in the conversation, refer to Delete for Everyone.
Taking the example of client A deleting certain messages or all messages with client B:
Delete the specified messages
The following process shows how Client A deletes the specified messages with Client B:
Client A and Client B log in to the ZIM SDK to send and receive messages to and from each other.
When Client A wants to delete the specified messages with Client B:
Client A logs in to the ZIM SDK first.
Client A calls the deleteMessagesmethod and pass the messageList and config parameters.
// Delete the specified messages.
String conversationID = "xxxx";
ArrayList<ZIMMessage> deleteMessageList = new ArrayList();
ZIMMessageDeleteConfig config = new ZIMMessageDeleteConfig();
config.isAlsoDeleteServerMessage = false;
zim.deleteMessages(deleteMessageList, conversationID, ZIMConversationType.PEER, config, new ZIMMessageDeletedCallback() {
@Override
public void onMessageDeleted(String conversationID, ZIMConversationType conversationType, ZIMError errorInfo) {
}
});
// Delete the specified messages.
String conversationID = "xxxx";
ArrayList<ZIMMessage> deleteMessageList = new ArrayList();
ZIMMessageDeleteConfig config = new ZIMMessageDeleteConfig();
config.isAlsoDeleteServerMessage = false;
zim.deleteMessages(deleteMessageList, conversationID, ZIMConversationType.PEER, config, new ZIMMessageDeletedCallback() {
@Override
public void onMessageDeleted(String conversationID, ZIMConversationType conversationType, ZIMError errorInfo) {
}
});
SampleCode
// Delete the specified messages.
NSMutableArray *deleteMessageList = [[NSMutableArray alloc] init];
ZIMMessageDeleteConfig *config = [[ZIMMessageDeleteConfig alloc] init];
// Used to determine whether to delete messages from the server.
config.isAlsoDeleteServerMessage = true;
[self.zim deleteMessages:messageList conversationID:conversationID conversationType:conversationType config:config callback:^(NSString * _Nonnull conversationID, ZIMConversationType conversationType, ZIMError * _Nonnull errorInfo) {
// You can listen for the callback to check whether the messages are deleted successfully.
}];
// Delete the specified messages.
NSMutableArray *deleteMessageList = [[NSMutableArray alloc] init];
ZIMMessageDeleteConfig *config = [[ZIMMessageDeleteConfig alloc] init];
// Used to determine whether to delete messages from the server.
config.isAlsoDeleteServerMessage = true;
[self.zim deleteMessages:messageList conversationID:conversationID conversationType:conversationType config:config callback:^(NSString * _Nonnull conversationID, ZIMConversationType conversationType, ZIMError * _Nonnull errorInfo) {
// You can listen for the callback to check whether the messages are deleted successfully.
}];
SampleCode
// Delete the specified messages.
std::vector<std::shared_ptr<ZIMMessage>> messageList;
zim::ZIMMessageDeleteConfig config;
// Used to determine whether to delete messages from the server.
config.isAlsoDeleteServerMessage = true;
zim_->deleteMessages(messageList, "conversationID", zim::ZIM_CONVERSATION_TYPE_PEER, config, callback);
// Delete the specified messages.
std::vector<std::shared_ptr<ZIMMessage>> messageList;
zim::ZIMMessageDeleteConfig config;
// Used to determine whether to delete messages from the server.
config.isAlsoDeleteServerMessage = true;
zim_->deleteMessages(messageList, "conversationID", zim::ZIM_CONVERSATION_TYPE_PEER, config, callback);
This feature is supported since the ZIM SDK 3.2.0.
By default, a deletion operation only takes effect for the current user, and other members in the conversation can still see the deleted messages. To make the specified messages invisible to all members in the conversation, set isAlsoDeleteForEveryone of ZIMMessageDeleteConfig to true when calling deleteMessages.
After the deletion succeeds, the operator and other members in the conversation will receive the deletion result notifications respectively:
Other members in the conversation receive the notification through the onMessageDeleted callback. In the callback parameter ZIMMessageDeletedInfo, messageDeleteType is the "delete specified messages" type, and messageList is the list of deleted messages.
The following sample code shows how to delete messages for everyone, and how the operator and other members receive the deletion result notifications:
Sample code
// Delete the specified messages for everyone in the conversation
String conversationID = "xxxx";
ArrayList<ZIMMessage> deleteMessageList = new ArrayList<>();
ZIMMessageDeleteConfig config = new ZIMMessageDeleteConfig();
// When deleting messages for everyone, server messages must also be deleted
config.isAlsoDeleteServerMessage = true;
config.isAlsoDeleteForEveryone = true;
zim.deleteMessages(deleteMessageList, conversationID, ZIMConversationType.GROUP, config, new ZIMMessageDeletedCallback() {
@Override
public void onMessageDeleted(String conversationID, ZIMConversationType conversationType, ZIMError errorInfo) {
// Developers can listen for whether the messages are deleted successfully through this callback.
}
});
// Other members in the conversation are notified of the message deletion through this callback
zim.setEventHandler(new ZIMEventHandler() {
@Override
public void onMessageDeleted(ZIM zim, ZIMMessageDeletedInfo deletedInfo) {
if (deletedInfo.messageDeleteType == ZIMMessageDeleteType.MESSAGE_LIST_DELETED) {
// deletedInfo.messageList is the list of deleted messages, where you can refresh the UI
}
}
});
// Delete the specified messages for everyone in the conversation
String conversationID = "xxxx";
ArrayList<ZIMMessage> deleteMessageList = new ArrayList<>();
ZIMMessageDeleteConfig config = new ZIMMessageDeleteConfig();
// When deleting messages for everyone, server messages must also be deleted
config.isAlsoDeleteServerMessage = true;
config.isAlsoDeleteForEveryone = true;
zim.deleteMessages(deleteMessageList, conversationID, ZIMConversationType.GROUP, config, new ZIMMessageDeletedCallback() {
@Override
public void onMessageDeleted(String conversationID, ZIMConversationType conversationType, ZIMError errorInfo) {
// Developers can listen for whether the messages are deleted successfully through this callback.
}
});
// Other members in the conversation are notified of the message deletion through this callback
zim.setEventHandler(new ZIMEventHandler() {
@Override
public void onMessageDeleted(ZIM zim, ZIMMessageDeletedInfo deletedInfo) {
if (deletedInfo.messageDeleteType == ZIMMessageDeleteType.MESSAGE_LIST_DELETED) {
// deletedInfo.messageList is the list of deleted messages, where you can refresh the UI
}
}
});
Sample code
// Delete the specified messages for everyone in the conversation
NSMutableArray *deleteMessageList = [[NSMutableArray alloc] init];
ZIMMessageDeleteConfig *config = [[ZIMMessageDeleteConfig alloc] init];
// When deleting messages for everyone, server messages must also be deleted
config.isAlsoDeleteServerMessage = YES;
config.isAlsoDeleteForEveryone = YES;
[self.zim deleteMessages:deleteMessageList conversationID:conversationID conversationType:ZIMConversationTypeGroup config:config callback:^(NSString * _Nonnull conversationID, ZIMConversationType conversationType, ZIMError * _Nonnull errorInfo) {
// Developers can listen for whether the messages are deleted successfully through this callback.
}];
// Other members in the conversation are notified of the message deletion through this callback
- (void)zim:(ZIM *)zim messageDeleted:(ZIMMessageDeletedInfo *)deletedInfo {
if (deletedInfo.messageDeleteType == ZIMMessageDeleteTypeMessageListDeleted) {
// deletedInfo.messageList is the list of deleted messages, where you can refresh the UI
}
}
// Delete the specified messages for everyone in the conversation
NSMutableArray *deleteMessageList = [[NSMutableArray alloc] init];
ZIMMessageDeleteConfig *config = [[ZIMMessageDeleteConfig alloc] init];
// When deleting messages for everyone, server messages must also be deleted
config.isAlsoDeleteServerMessage = YES;
config.isAlsoDeleteForEveryone = YES;
[self.zim deleteMessages:deleteMessageList conversationID:conversationID conversationType:ZIMConversationTypeGroup config:config callback:^(NSString * _Nonnull conversationID, ZIMConversationType conversationType, ZIMError * _Nonnull errorInfo) {
// Developers can listen for whether the messages are deleted successfully through this callback.
}];
// Other members in the conversation are notified of the message deletion through this callback
- (void)zim:(ZIM *)zim messageDeleted:(ZIMMessageDeletedInfo *)deletedInfo {
if (deletedInfo.messageDeleteType == ZIMMessageDeleteTypeMessageListDeleted) {
// deletedInfo.messageList is the list of deleted messages, where you can refresh the UI
}
}
Sample code
// Delete the specified messages for everyone in the conversation
std::vector<std::shared_ptr<zim::ZIMMessage>> messageList;
zim::ZIMMessageDeleteConfig config;
// When deleting messages for everyone, server messages must also be deleted
config.isAlsoDeleteServerMessage = true;
config.isAlsoDeleteForEveryone = true;
zim_->deleteMessages(messageList, "conversationID", zim::ZIM_CONVERSATION_TYPE_GROUP, config, callback);
// Other members in the conversation are notified of the message deletion through this callback
void onMessageDeleted(zim::ZIM *zim, const zim::ZIMMessageDeletedInfo &deletedInfo) override {
if (deletedInfo.messageDeleteType == zim::ZIM_MESSAGE_DELETE_TYPE_MESSAGE_LIST_DELETED) {
// deletedInfo.messageList is the list of deleted messages, where you can refresh the UI
}
}
// Delete the specified messages for everyone in the conversation
std::vector<std::shared_ptr<zim::ZIMMessage>> messageList;
zim::ZIMMessageDeleteConfig config;
// When deleting messages for everyone, server messages must also be deleted
config.isAlsoDeleteServerMessage = true;
config.isAlsoDeleteForEveryone = true;
zim_->deleteMessages(messageList, "conversationID", zim::ZIM_CONVERSATION_TYPE_GROUP, config, callback);
// Other members in the conversation are notified of the message deletion through this callback
void onMessageDeleted(zim::ZIM *zim, const zim::ZIMMessageDeletedInfo &deletedInfo) override {
if (deletedInfo.messageDeleteType == zim::ZIM_MESSAGE_DELETE_TYPE_MESSAGE_LIST_DELETED) {
// deletedInfo.messageList is the list of deleted messages, where you can refresh the UI
}
}
Sample code
// Delete the specified messages for everyone in the conversation
String conversationID = 'xxxx';
List<ZIMMessage> messageList = [];
ZIMMessageDeleteConfig config = ZIMMessageDeleteConfig();
// When deleting messages for everyone, server messages must also be deleted
config.isAlsoDeleteServerMessage = true;
config.isAlsoDeleteForEveryone = true;
await ZIM
.getInstance()
!.deleteMessages(
messageList, conversationID, ZIMConversationType.group, config)
.then((value) => {})
.catchError((onError) {});
// Other members in the conversation are notified of the message deletion through this callback
ZIMEventHandler.onMessageDeleted = (zim, deletedInfo) {
if (deletedInfo.messageDeleteType == ZIMMessageDeleteType.messageListDeleted) {
// deletedInfo.messageList is the list of deleted messages, where you can refresh the UI
}
};
// Delete the specified messages for everyone in the conversation
String conversationID = 'xxxx';
List<ZIMMessage> messageList = [];
ZIMMessageDeleteConfig config = ZIMMessageDeleteConfig();
// When deleting messages for everyone, server messages must also be deleted
config.isAlsoDeleteServerMessage = true;
config.isAlsoDeleteForEveryone = true;
await ZIM
.getInstance()
!.deleteMessages(
messageList, conversationID, ZIMConversationType.group, config)
.then((value) => {})
.catchError((onError) {});
// Other members in the conversation are notified of the message deletion through this callback
ZIMEventHandler.onMessageDeleted = (zim, deletedInfo) {
if (deletedInfo.messageDeleteType == ZIMMessageDeleteType.messageListDeleted) {
// deletedInfo.messageList is the list of deleted messages, where you can refresh the UI
}
};
Sample code
// Delete the specified messages for everyone in the conversation
const conversationID = '';
const conversationType = 2; // Group conversation
const deleteMessageList: ZIMMessage[] = [];
const config: ZIMMessageDeleteConfig = {
// When deleting messages for everyone, server messages must also be deleted
isAlsoDeleteServerMessage: true,
isAlsoDeleteForEveryone: true,
};
zim.deleteMessages(deleteMessageList, conversationID, conversationType, config)
.then((res: ZIMMessageDeletedResult) => {
// Operation successful.
})
.catch((err: ZIMError) => {
// Operation failed.
});
// Other members in the conversation are notified of the message deletion through this callback
zim.on('messageDeleted', (zim: ZIM, data: ZIMMessageDeletedEventResult) => {
if (data.messageDeleteType == 0) {
// data.messageList is the list of deleted messages, where you can refresh the UI
}
});
// Delete the specified messages for everyone in the conversation
const conversationID = '';
const conversationType = 2; // Group conversation
const deleteMessageList: ZIMMessage[] = [];
const config: ZIMMessageDeleteConfig = {
// When deleting messages for everyone, server messages must also be deleted
isAlsoDeleteServerMessage: true,
isAlsoDeleteForEveryone: true,
};
zim.deleteMessages(deleteMessageList, conversationID, conversationType, config)
.then((res: ZIMMessageDeletedResult) => {
// Operation successful.
})
.catch((err: ZIMError) => {
// Operation failed.
});
// Other members in the conversation are notified of the message deletion through this callback
zim.on('messageDeleted', (zim: ZIM, data: ZIMMessageDeletedEventResult) => {
if (data.messageDeleteType == 0) {
// data.messageList is the list of deleted messages, where you can refresh the UI
}
});
When using this configuration, isAlsoDeleteServerMessage must also be set to true.
A maximum of 100 messages can be deleted at a time.
This operation takes effect for the entire batch: as long as any message in the passed-in list does not meet the conditions (exceeding the validity period, no operation permission, etc.), the entire batch fails, and the remaining valid messages in the list will not be deleted.
Validity period
Only messages within the validity period can be deleted for everyone, and the validity period starts from the time the message is sent. The default validity period is 24 hours and can be configured to up to 7 days. To modify the configuration, contact ZEGO technical support.
It is recommended that the business layer decide whether to display the "Delete for everyone" entry to users based on the difference between the timestamp of the message and the current time. If this operation is mistakenly triggered due to inaccurate local device time, the interface returns an error code as a fallback.
Operation permissions
The scope of messages that conversation members can delete for everyone is as follows:
Conversation type
Messages that can be deleted for everyone
One-to-one
Only the messages sent by yourself can be deleted, and deleting the messages sent by the other party is not supported.
Group
Regular members can only delete the messages sent by themselves; admins can delete the messages sent by themselves and regular members; the group owner can delete the messages sent by themselves, admins, and regular members.
In group conversations, it is recommended that the business layer first query the identities of the operator and the message sender in the group through queryGroupMemberInfo, and then decide whether to display the "Delete for everyone" entry to users.
Note
For group targeted messages, only the target members of the message will receive the deletion notification, and non-target members are not affected.
Error codes
When the call fails, the common error codes are as follows:
Error code
Description
6000001
Parameter error. isAlsoDeleteServerMessage is not set to true at the same time, or more than 100 messages are deleted at a time.
6000288
The message to be deleted has exceeded the validity period for deletion for everyone.
6000285
No operation permission in the one-to-one conversation scenario, that is, an attempt is made to delete a message sent by the other party.
6000541
No operation permission in the group conversation scenario, that is, an attempt is made to delete a message sent by a member whose permission is higher than or equal to your own.
Delete all messages of the specified session
The following process shows how Client A deletes all messages with Client B:
Client A and Client B log in to the ZIM SDK to send and receive messages to and from each other.
When Client A wants to delete all messages with Client B:
Client A logs in to the ZIM SDK first.
Client A calls the deleteAllMessage method and pass the conversationID, conversationType, and config parameters.
// Delete all messages of the specified session.
String conversationID = "xxxx";
ZIMMessageDeleteConfig config = new ZIMMessageDeleteConfig();
config.isAlsoDeleteServerMessage = false;
zim.deleteAllMessage(conversationID, ZIMConversationType.PEER, config, new ZIMMessageDeletedCallback() {
@Override
public void onMessageDeleted(String conversationID, ZIMConversationType conversationType, ZIMError errorInfo) {
}
});
// Delete all messages of the specified session.
String conversationID = "xxxx";
ZIMMessageDeleteConfig config = new ZIMMessageDeleteConfig();
config.isAlsoDeleteServerMessage = false;
zim.deleteAllMessage(conversationID, ZIMConversationType.PEER, config, new ZIMMessageDeletedCallback() {
@Override
public void onMessageDeleted(String conversationID, ZIMConversationType conversationType, ZIMError errorInfo) {
}
});
SampleCode
// Delete all messages of the specified session.
NSMutableArray *deleteMessageList = [[NSMutableArray alloc] init];
ZIMMessageDeleteConfig *config = [[ZIMMessageDeleteConfig alloc] init];
//Used to determine whether to delete messages from the server.
config.isAlsoDeleteServerMessage = true;
[self.zim deleteAllMessageByConversationID:conversationID conversationType:conversationType config:config callback:^(NSString * _Nonnull conversationID, ZIMConversationType conversationType, ZIMError * _Nonnull errorInfo) {
// You can listen for the callback to check whether the messages are deleted successfully.
}];
// Delete all messages of the specified session.
NSMutableArray *deleteMessageList = [[NSMutableArray alloc] init];
ZIMMessageDeleteConfig *config = [[ZIMMessageDeleteConfig alloc] init];
//Used to determine whether to delete messages from the server.
config.isAlsoDeleteServerMessage = true;
[self.zim deleteAllMessageByConversationID:conversationID conversationType:conversationType config:config callback:^(NSString * _Nonnull conversationID, ZIMConversationType conversationType, ZIMError * _Nonnull errorInfo) {
// You can listen for the callback to check whether the messages are deleted successfully.
}];
SampleCode
//Used to determine whether to delete messages from the server.
ZIMMessageDeleteConfig config;
config.isAlsoDeleteServerMessage = true;
zim_->deleteAllMessage("conversationID", zim::ZIM_CONVERSATION_TYPE_PEER, config, callback);
//Used to determine whether to delete messages from the server.
ZIMMessageDeleteConfig config;
config.isAlsoDeleteServerMessage = true;
zim_->deleteAllMessage("conversationID", zim::ZIM_CONVERSATION_TYPE_PEER, config, callback);
SampleCode
// Delete all messages in the specified conversation
String conversationID = "xxxx";
ZIMMessageDeleteConfig config = ZIMMessageDeleteConfig();
config.isAlsoDeleteServerMessage = false;
await ZIM
.getInstance()
!.deleteAllMessage(conversationID, ZIMConversationType.peer, config)
.then((value) => {})
.catchError((onError) {});
// Delete all messages in the specified conversation
String conversationID = "xxxx";
ZIMMessageDeleteConfig config = ZIMMessageDeleteConfig();
config.isAlsoDeleteServerMessage = false;
await ZIM
.getInstance()
!.deleteAllMessage(conversationID, ZIMConversationType.peer, config)
.then((value) => {})
.catchError((onError) {});
After logging into the ZIM SDK, you can call the deleteAllConversationMessages method and pass the ZIMMessageDeleteConfig parameter to configure whether to delete messages stored on the server. This will delete all messages in one-on-one and group conversations.
If you want to keep the existing conversation list and update the lastMessage displayed in the conversation list to be empty, please Pull the conversation list.
//Delete all messages in all conversations
// Set whether to delete messages stored on the server
ZIMMessageDeleteConfig config = new ZIMMessageDeleteConfig();
config.isAlsoDeleteServerMessage = true;
zim.deleteAllConversationMessages(config, new ZIMConversationMessagesAllDeletedCallback() {
@Override
public void onConversationMessagesAllDeleted(ZIMError errorInfo) {
// Developers can use this callback to monitor whether the message is deleted successfully.
}
});
//Delete all messages in all conversations
// Set whether to delete messages stored on the server
ZIMMessageDeleteConfig config = new ZIMMessageDeleteConfig();
config.isAlsoDeleteServerMessage = true;
zim.deleteAllConversationMessages(config, new ZIMConversationMessagesAllDeletedCallback() {
@Override
public void onConversationMessagesAllDeleted(ZIMError errorInfo) {
// Developers can use this callback to monitor whether the message is deleted successfully.
}
});
objective-c
// Delete all messages in all conversations
// et whether to delete server messages
ZIMMessageDeleteConfig *config = [[ZIMMessageDeleteConfig alloc] init];
// Whether to delete server messages
config.isAlsoDeleteServerMessage = true;
[self.zim deleteAllConversationMessagesWithConfig:config callback:^(ZIMError * _Nonnull errorInfo) {
// Developers can use this callback to listen for successful message deletion.
}];
// Delete all messages in all conversations
// et whether to delete server messages
ZIMMessageDeleteConfig *config = [[ZIMMessageDeleteConfig alloc] init];
// Whether to delete server messages
config.isAlsoDeleteServerMessage = true;
[self.zim deleteAllConversationMessagesWithConfig:config callback:^(ZIMError * _Nonnull errorInfo) {
// Developers can use this callback to listen for successful message deletion.
}];
objective-c
// Delete all messages in all conversations
// et whether to delete server messages
ZIMMessageDeleteConfig *config = [[ZIMMessageDeleteConfig alloc] init];
// Whether to delete server messages
config.isAlsoDeleteServerMessage = true;
[self.zim deleteAllConversationMessagesWithConfig:config callback:^(ZIMError * _Nonnull errorInfo) {
// Developers can use this callback to listen for successful message deletion.
}];
// Delete all messages in all conversations
// et whether to delete server messages
ZIMMessageDeleteConfig *config = [[ZIMMessageDeleteConfig alloc] init];
// Whether to delete server messages
config.isAlsoDeleteServerMessage = true;
[self.zim deleteAllConversationMessagesWithConfig:config callback:^(ZIMError * _Nonnull errorInfo) {
// Developers can use this callback to listen for successful message deletion.
}];
cpp
// Delete all messages in all conversations
// Set whether to delete messages stored on the server
zim::ZIMMessageDeleteConfig config;
config.isAlsoDeleteServerMessage = true;
zim::ZIM::getInstance()->deleteAllConversationMessages(config, [=](const zim::ZIMError& errorInfo) {
// Result of deleting messages
if (errorInfo.code == zim::ZIM_ERROR_CODE_SUCCESS) {
// Business logic after deletion
}
else {
// Please check the error code document for solutions
}
});
// Delete all messages in all conversations
// Set whether to delete messages stored on the server
zim::ZIMMessageDeleteConfig config;
config.isAlsoDeleteServerMessage = true;
zim::ZIM::getInstance()->deleteAllConversationMessages(config, [=](const zim::ZIMError& errorInfo) {
// Result of deleting messages
if (errorInfo.code == zim::ZIM_ERROR_CODE_SUCCESS) {
// Business logic after deletion
}
else {
// Please check the error code document for solutions
}
});
dart
// Delete all messages in conversations
// Set whether to delete messages stored on the server
ZIMMessageDeleteConfig config = ZIMMessageDeleteConfig();
config.isAlsoDeleteServerMessage = false;
await ZIM
.getInstance()
!.deleteAllConversationMessages(config)
.then((value) => {})
.catchError((onError) {});
// Delete all messages in conversations
// Set whether to delete messages stored on the server
ZIMMessageDeleteConfig config = ZIMMessageDeleteConfig();
config.isAlsoDeleteServerMessage = false;
await ZIM
.getInstance()
!.deleteAllConversationMessages(config)
.then((value) => {})
.catchError((onError) {});
// Delete all messages in all conversations
// Set whether to delete messages stored on the server
const config: ZIMMessageDeleteConfig = {
isAlsoDeleteServerMessage: true
}
zim.deleteAllConversationMessages(config)
.then(function ({ conversationID, conversationType }) {
// Operation successful.
})
.catch(function (err) {
// Operation failed.
// Delete all messages in all conversations
// Set whether to delete messages stored on the server
const config: ZIMMessageDeleteConfig = {
isAlsoDeleteServerMessage: true
}
zim.deleteAllConversationMessages(config)
.then(function ({ conversationID, conversationType }) {
// Operation successful.
})
.catch(function (err) {
// Operation failed.