Skip to main content

Developer Guide

The Instant Messaging service supports content moderation for IM messages.

  • The IM service has a built-in sensitive word filtering mechanism. Note that this is only a basic protection feature limited to text content (default maximum of 50 sensitive words).
  • For self-implemented moderation or integration with third-party moderation services, you can use the Pre-messaging Callback service.

If a message is blocked due to policy violations, the sender will not receive notification by default. To notify senders when their messages are intercepted, enable Blocked Message Status Callback to Sender in the Feature Configuration section of RC Console (requires Android/iOS SDK version ≥ 5.1.4, Web ≥ 5.0.2) and set up client-side listeners. See Message Block Notification Callback for details.

tip

By default, one-to-one chat messages containing sensitive words or failing moderation will still be stored in the sender's server-side message history. These messages will also be compensated to the user when logging in from other devices. To prevent such messages from entering the sender's history or triggering message compensation, enable Do Not Save Sensitive One-to-One Messages to Sender's History under Chat > Chat settings > Security & Moderation in RC Console.

Sensitive Word Filtering Mechanism

Note

The Sensitive Word Filtering Mechanism is a basic protection feature that only identifies and filters sensitive words in text messages. For messages containing sensitive words, you can choose to either block the message (preventing delivery to recipients) or replace the sensitive words according to specified rules before delivery.

Currently supported languages for sensitive word filtering include: Chinese, English, Japanese, German, Russian, Korean, and Arabic.

You can manage sensitive words for your App Key in development or production environments through the following methods:

FunctionClient APIRC Server APIConsole
Add sensitive words (with replacement content)Not availableAdd Sensitive WordVia Embedded Console
Remove sensitive wordsNot availableRemove Sensitive WordVia Embedded Console
Batch remove sensitive wordsNot availableBatch Remove Sensitive WordVia Embedded Console
Get sensitive word list (with replacement content)Not availableGet Sensitive Word ListVia Embedded Console

Default Behavior

  • Maximum of 50 sensitive words by default.
  • Only applies to messages sent from client SDKs by default.
  • Only supports built-in text message type (RC:TxtMsg) by default. Works for one-to-one chats, group chats, chatrooms, and ultra groups. Modified text messages in ultra groups also undergo sensitive word filtering by default.

Configuration Adjustments

  • To enable sensitive word filtering for messages sent via Server API, toggle Filter server API messages under Chat > Chat settings > Security & Moderation in RC Console.
  • To enable sensitive word filtering for custom message types, use the Embedded Console to Configure Custom Messages. Provide the custom message's ObjectName and the corresponding key in the message content JSON structure to filter the value associated with that key.

Pre-messaging Callback Service

For integrating with your own moderation system or third-party content moderation services, use the Pre-messaging Callback service.

The Pre-messaging Callback service (formerly Template Routing) provides a message filtering mechanism. You can synchronize messages to your specified server based on sender ID, recipient ID, message type, conversation type, etc. Ultra group message edits and extensions also support synchronization via this callback.

After messages are synchronized to your server, you can use your own moderation system or integrate third-party services. RC's server will determine whether to deliver messages, replace content, or how to modify content based on your application server's response.

Manage the Pre-messaging Callback service status and routing rules for your App Key in development or production environments via the Pre-messaging Callback page in Console.

For creating routing rules and callback parameter details, see the Pre-messaging Callback documentation.