You can modify certain objects in the Conversations SDK (i.e. Conversation, Message, Participant) for connected Users with appropriate permissions.
You can update a Conversation object by calling one of the appropriate methods for your chosen language.
For the Conversation, Message, or Participant data object, you could update some specific properties. Please refer to Update a Conversation, Message or Participant code sample.
1/* Updating Conversations/Messages/Participants */23/* Conversations */45await conversation.updateAttributes({});6await conversation.updateFriendlyName("foo");7await conversation.updateLastReadMessageIndex(0);8await conversation.updateUniqueName("foo");910/* Messages */1112await message.updateAttributes([1, {foo: "bar"}]);13await message.updateBody("bar");1415/* Participants */1617await participant.updateAttributes({foo: 8});
You can delete a Conversation object by calling the appropriate method for your chosen language. When you remove a Conversation object, all its Messages, attached Media, and Participants will be deleted.
If you want to only delete a Message from a Conversation, call the specific method to remove it from the Conversation, and destroy any attached Media.
If you want to only delete a Participant from a Conversation, call the specific method to remove them from the Conversation.
1/* Deleting and updating Conversations/Messages/Participants */23/* Conversations */45// destroys the conversation, with all its messages and attached media and removes all participants6await conversation.delete();78/* Messages */910// remove a message from the conversation, destroying any attached media11await message.remove();1213/* Participants */1415// remove participant from the conversation16await participant.remove();
Please note that when you delete a parent object, you will also delete its child object. For example, if you remove a Conversation, then all Messages and Participants will be automatically deleted. Once deleted, these resources are unrecoverable.
Check out our auto-generated documentation for more information about Conversations SDK methods and properties: JavaScript, Android or iOS.
Congratulations! 🎉 You've finished the getting started guides. Now, let's explore more Conversations SDK guides: