Skip to main content

Manage Tag Information Data

The SDK supports creating a tagging system for managing conversations. Tags created by the SDK will be synchronized to the server.

This document describes the SDK's tag management interfaces, including how to create, edit, retrieve, and remove tags.

tip

For details on how to use tags to manage conversations, refer to Using Tags to Manage Conversations.

Create a Tag

Call addTag to create a tag. Each user can create up to 20 tags.

RongIMLib.addTag({
tagId: '<TagId>',
tagName: '<TagName>'
}).then(({ code }) => {
console.log(code);
});
ParameterTypeRequiredDescription
tagITagParamYesThe tag to be created
tag.tagIdstringYesTag ID, with a maximum length of 10
tag.tagNamestringYesTag name, with a maximum length of 15

Remove a Tag

Call removeTag to delete a tag.

RongIMLib.removeTag('<TagId>').then(({code}) => {
console.log(code)
});
ParameterTypeRequiredDescription
tagIdstringYesThe ID of the tag to be removed

Edit a Tag

Call updateTag to update a tag.

RongIMLib.updateTag({
tagId: '<TagId>',
tagName: '<NewTagName>'
}).then(({code}) => {
console.log(code)
});
ParameterTypeRequiredDescription
tagITagParamYesThe tag to be edited
tag.tagIdstringYesTag ID, with a maximum length of 10
tag.tagNamestringYesTag name, with a maximum length of 15

Get Tag List

Call getTags to retrieve the list of tags.

RongIMLib.getTags().then(({code, data}) => {
console.log(code, data)
});