Skip to main content

Notification Message Formats

Tip (Gray Bar) Notification Message

The IM Service defines a tip (gray bar) notification message with the ObjectName RC:InfoNtf. You can send or locally insert this type of message into a conversation when you need to notify or alert users.

When calling the server API to send a message, you must specify the ObjectName and serialize the corresponding message content JSON object into a JSON String, which is then placed in the content field of the API interface. The client SDK has built-in support for this message type, allowing you to directly call the relevant methods to send it.

The tip gray bar message contains a "message content" in the form of a JSON object, structured as follows:

{
"message":"Please be mindful of personal and property safety during chats",
"extra":""
}

Content Structure Parameters

The content structure parameters of the tip gray bar message are as follows:

NameTypeRequiredDescription
messageStringYesThe content of the tip message.
extraStringNoExtended information, which can hold any data content. This attribute can also be omitted.

Default Client Properties

  • Stored locally on the client
  • Not counted in the conversation's unread message count
  • Remote push notification not supported by default: The IM server does not preset push notification titles and content for this message type. If you need to trigger a remote push notification when the recipient is offline, please pass in custom push notification content when sending the message.

Recall Notification Message

The IM Service defines a recall notification message with the ObjectName RC:RcNtf, which is used to indicate that a message has been recalled.

The client SDK has built-in support for this message type. It is internally used by the SDK to display a recall notification after executing a message recall operation. It is not recommended for clients to directly send this message.

Content Structure Parameters

The content structure parameters of the recall notification message are as follows:

NameTypeRequiredDescription
operatorIdStringNoThe user ID of the user who initiated the message recall.
recallTimeLongYesThe send time (in milliseconds) of the original message that was recalled.
originalObjectNameStringYesThe message type name of the original message.
originalMessageContentObjectNoThe content of the original message.
recallContentStringNoThe content of the recalled text message.
recallActionTimeLongNoThe time (in milliseconds) when the recall command message (RC:RcCMD) was sent.
adminBooleanYesWhether the operation was performed by an administrator.
deleteBooleanYesSpecifies whether the mobile client should delete the original message record locally. If false, the mobile client will not delete the original message record and will replace the message content with a recall notification (gray bar). If true, the mobile client will delete the original message record and will not display the recall notification (gray bar). Web SDK supports this parameter starting from version 5.3.1.
userObjectNoThe user information of the message sender carried in the message. It is generally not recommended to carry user information in messages. It is recommended for use only in live streaming scenarios.
extraStringNoAdditional information.

Default Client Properties

  • Stored locally on the client
  • Not counted in the conversation's unread message count
  • Remote push notification not supported by default: The IM server does not preset push notification titles and content for this message type. If you need to trigger a remote push notification when the recipient is offline, please pass in custom push notification content when sending the message.

Profile Change Notification Message

The IM Service defines a profile change notification message with the ObjectName RC:ProfileNtf.

When calling the server API to send a message, you must specify the ObjectName and serialize the corresponding message content JSON object into a JSON String, which is then placed in the content field of the API interface. The client SDK has built-in support for this message type, allowing you to directly call the relevant methods to send it.

The profile change notification message contains a "message content" in the form of a JSON object, structured as follows:

{
"operation":"Update",
"data":"{\"nickname\":\"Han Meimei\", \"hometown\":\"beijing\"}",
"extra":""
}

Content Structure Parameters

The content structure parameters of the profile change notification message are as follows:

NameTypeRequiredDescription
operationStringYesThe profile notification operation, which can be user-defined.
dataStringYesThe data of the operation.
extraStringNoExtended information, which can hold any data content. This attribute can also be omitted.

Default Client Properties

  • Stored locally on the client
  • Not counted in the conversation's unread message count
  • Remote push notification not supported by default: The IM server does not preset push notification titles and content for this message type. If you need to trigger a remote push notification when the recipient is offline, please pass in custom push notification content when sending the message.

Contact (Friend) Notification Message

The IM Service defines a contact (friend) notification message with the ObjectName RC:ContactNtf.

When calling the server API to send a message, you must specify the ObjectName and serialize the corresponding message content JSON object into a JSON String, which is then placed in the content field of the API interface. The client SDK has built-in support for this message type, allowing you to directly call the relevant methods to send it.

The contact (friend) notification message contains a "message content" in the form of a JSON object, structured as follows:

{
"operation":"Request",
"sourceUserId":"123",
"targetUserId":"456",
"message":"I'm Xiao Ai, can we be friends?",
"extra":""
}

Content Structure Parameters

The content structure parameters of the contact (friend) notification message are as follows:

NameTypeRequiredDescription
operationStringYesThe contact operation command. The official defines constants for the operation attribute, such as "Request", "AcceptResponse", and "RejectResponse". Developers can also extend this.
sourceUserIdStringYesThe user ID of the user who issued the notification.
targetUserIdStringYesFor one-to-one chats, this is the user ID of the notification recipient. For group chats and chatrooms, this is the conversation ID.
messageStringYesRepresents the request or response message, such as the reason for adding or rejecting.
extraStringNoExtended information, which can hold any data content. This attribute can also be omitted.

Default Client Properties

  • Stored locally on the client
  • Not counted in the conversation's unread message count
  • Remote push notification not supported by default: The IM server does not preset push notification titles and content for this message type. If you need to trigger a remote push notification when the recipient is offline, please pass in custom push notification content when sending the message.

Group Notification Message

The IM Service defines a group notification message with the ObjectName RC:GrpNtf.

When calling the server API to send a message, you must specify the ObjectName and serialize the corresponding message content JSON object into a JSON String, which is then placed in the content field of the API interface. The client SDK has built-in support for this message type, allowing you to directly call the relevant methods to send it.

The group notification message contains a "message content" in the form of a JSON object, structured as follows:

{
"operatorUserId":"4324",
"operation":"Rename",
"data":"Operation data for various notifications in the group",
"message":"Changed the group name to Local Life",
"extra":""
}

Content Structure Parameters

The content structure parameters of the group notification message are as follows:

NameTypeRequiredDescription
operatorUserIdStringYesThe user ID of the operator.
operationStringYesThe operation name for various notifications in the group. For details, see the Group Notification Message Structure Data Description below.
dataStringYesThe operation data. For details, see the Group Notification Message Structure Data Description below.
messageStringYesThe message content.
extraStringNoExtended information, which can hold any data content. This attribute can also be omitted.

Default Client Properties

  • Stored locally on the client
  • Not counted in the conversation's unread message count
  • Remote push notification not supported by default: The IM server does not preset push notification titles and content for this message type. If you need to trigger a remote push notification when the recipient is offline, please pass in custom push notification content when sending the message.

Group Notification Message Structure Data Description

The following lists the JSON format of the built-in group operation notification message structure:

  • Create Group (Operation: Create)

    {
    "operatorUserId":"4324",
    "operation":"Create",
    "data":"{\"operatorNickname\":\"Li Tian\",\"targetGroupName\":\"Group Name\"}",
    "message":"Created a group",
    "extra":""
    }

    Attribute Description:

    • operatorUserId: The user ID of the operator.
    • operation: The operation name, default is Create.
    • data: The data content, operatorNickname is the operator, targetGroupName is the group name.
  • Rename Group (Operation: Rename)

    {
    "operatorUserId":"4324",
    "operation":"Rename",
    "data":"{\"operatorNickname\":\"Li Tian\",\"targetGroupName\":\"Group Name\"}",
    "message":"Renamed the group",
    "extra":""
    }

    Attribute Description:

    • operatorUserId: The user ID of the operator.
    • operation: The operation name, default is Rename.
    • data: The data content, operatorNickname is the operator, targetGroupName is the group name.
  • Add Group Member (Operation: Add)

    {
    "operatorUserId":"4324",
    "operation":"Add",
    "data":"{\\"operatorNickname\\":\\"Li Tian\\",\\"targetUserIds\\":[\\"wGPkc0\\"],\\"targetUserDisplayNames\\":[\\"Teng Fei\\"]}",
    "message":"Added group members",
    "extra":""
    }

    Attribute Description:

    • operatorUserId: The user ID of the operator.
    • operation: The operation name, default is Add.
    • data: The data content, operatorNickname is the operator.
    • targetUserIds: The user IDs of the users added to the group.
    • targetUserDisplayNames: The display names of the users added to the group, corresponding to targetUserIds.
  • Remove Group Member

    {
    "operatorUserId":"4324",
    "operation":"Kicked",
    "data":"{\\"operatorNickname\\":\\"Li Tian\\",\\"targetUserIds\\":[\\"wGPkc0\\"],\\"targetUserDisplayNames\\":[\\"Teng Fei\\"]}",
    "message":"Removed group members",
    "extra":""
    }

    Attribute Description:

    • operatorUserId: The user ID of the operator.
    • operation: The operation name, default is Kicked.
    • data: The data content, operatorNickname is the operator.
    • targetUserIds: The user IDs of the users removed from the group.
    • targetUserDisplayNames: The display names of the users removed from the group, corresponding to targetUserIds.
  • Quit Group (Operation: Quit)

    {
    "operatorUserId":"4324",
    "operation":"Quit",
    "data":"{\\"operatorNickname\\":\\"Li Tian\\",\\"targetUserIds\\":[\\"wGPkc0VpO\\"],\\"targetUserDisplayNames\\":[\\"Teng Fei\\"],\\"newCreatorId\\":\\"newCreatorId\\"}",
    "message":"Quit the group",
    "extra":""
    }

    Attribute Description:

    • operatorUserId: The user ID of the operator.
    • operation: The operation name, default is Quit.
    • data: The data content, operatorNickname is the operator, targetUserIds are the user IDs of the users who quit the group, targetUserDisplayNames are the display names of the users who quit the group.
    • newCreatorId: If the user who quit the group was the group creator, newCreatorId is the ID of the new group creator; otherwise, it is null.
  • Dismiss Group (Operation: Dismiss)

    {
    "operatorUserId":"4324",
    "operation":"Dismiss",
    "data":"{\\"operatorNickname\\":\\"Li Tian\\"}",
    "message":"Dismissed the group",
    "extra":""
    }

    Attribute Description:

    • operatorUserId: The user ID of the operator.
    • operation: The operation name, default is Dismiss.
    • data: The data content, operatorNickname is the operator.

Command Reminder Message

The IM Service defines a command reminder message with the ObjectName RC:CmdNtf. The difference between this and the command message (RC:CmdMsg) is that this message will be stored and displayed in the interface.

When calling the server API to send a message, you must specify the ObjectName and serialize the corresponding message content JSON object into a JSON String, which is then placed in the content field of the API interface. The client SDK has built-in support for this message type, allowing you to directly call the relevant methods to send it.

The command reminder message contains a "message content" in the form of a JSON object, structured as follows:

{
"name":"AtPerson",
"data":"{\\"sourceId\\":\\"9527\\"}"
}

Content Structure Parameters

The content structure parameters of the command reminder message are as follows:

NameTypeRequiredDescription
nameStringYesThe command name.
dataStringNoThe command data, which can hold any format of data content, such as JSON. This attribute can also be omitted.

Default Client Properties

  • Stored locally on the client
  • Not counted in the conversation's unread message count
  • Remote push notification not supported by default: The IM server does not preset push notification titles and content for this message type. If you need to trigger a remote push notification when the recipient is offline, please pass in custom push notification content when sending the message.