클라우드 심사 결과 콜백
Overview
Once Content Understanding is enabled, moderation results can be sent to your app backend using webhook configuration.
Notes
To activate webhooks, set the webhook URL and enable the corresponding switch. For configuration steps, refer to Third-Party Callback Introduction.
Webhook requests are sent from the Chat backend to your app backend via HTTP POST.
When your app backend receives a webhook request, it must verify that the SDKAppID parameter in the request URL matches your own SDKAppID.
By default, only moderation results for violations are sent via webhook. If needed, you can configure the webhook to forward all moderation results to your app backend.
API Description
Request URL Example
In this example, the webhook URL configured by the app is
https://www.example.com:https://www.example.com?SdkAppid=$SDKAppID&CallbackCommand=$CallbackCommand&contenttype=json
Request parameters
Field | Description |
https | The request protocol is HTTPS, and the request method is POST. |
www.example.com | Webhook URL. |
SdkAppid | SDKAppID assigned in the Chat console when creating the application. |
CallbackCommand | Fixed value: ContentCallback.ResultNotify. |
contenttype | Request body type is always json. |
Request Example
{"Scene":"C2C","SdkAppId":1400187352,"From_Account":"jared","ContactItem":{"ContactType":1,"To_Account":"Jonh"},"ContentType":"Text","TextContent":["aaabbbccc","1234567"],"MsgID":"1434460578_4137340972_1661154487","CtxcbResult":1,"CtxcbRequestId":"241ed925-4c56-4357-95dd-1e6e7798f214","CtxcbKeywords":["aaabbbccc","1234567"],"CtxcbSuggestion":"Review","CtxcbLabel":"Sexy","CtxcbSubLabel":"InsinuationPorn","CtxcbSubLabelDesc":"XXXX","CtxcbLibName":"test","CloudCustomData":"aaabbbccc"}
Request Fields
Field | Type | Description |
Scene | String | Moderation scenario: C2C Chat = C2CC2C Custom Message = C2CCustomGroup Chat = GroupGroup Custom Message = GroupCustomGroup Profile = GroupInfoGroup Member Profile = GroupMemberInfoRelationship Chain = RelationChainUser Profile = UserInfo |
From_Account | String | UserID of the sender of the content submitted for moderation. |
ContactItem | Object | Indicates the recipient of the message during moderation. |
ContactType | Integer | Distinguishes whether the recipient is a group or C2C Chat: ContactType = 1 indicates C2C Chat. ContactType = 2 indicates Group Chat. |
To_Account | String | When ContactType = 1, recipient UserID. |
ToGroupId | String | When ContactType = 2, recipient GroupID. |
ContentType | String | Type of content submitted for moderation: Text = Text Image = Image Audio = Audio Video = Video |
TextContent | Array | When ContentType is Text, contains the text content submitted for moderation. Custom text messages may return multiple array elements; other message types return only one array element. |
FileURL | String | When ContentType is Image/Audio/Video, the file URL submitted for moderation. |
MsgID | String | For C2C moderation, MsgID is the C2C message MsgKey. For Group moderation, MsgID is the group message MsgSeq. If a group message has no MsgID, it indicates the message was blocked due to violation or not delivered for other reasons. |
CtxcbResult | Integer | Chat handling strategy: 1: Blocked. 0: Allowed. |
CtxcbRequestId | String | Identifier for third-party content moderation service. |
CtxcbKeywords | Array | Sensitive keywords detected in the text. |
CtxcbSuggestion | String | Moderation suggestion from third-party content moderation service: Block/Review/Normal. |
CtxcbLabel | String | Primary violation category detected during moderation: Normal/Illegal/Abuse/Polity/Ad/Porn/Sexy/Terror/Composite. |
CtxcbSubLabel | String | Secondary violation category detected during moderation. This field is present only when triggered by the model. |
CtxcbSubLabelDesc | String | Chinese description corresponding to the secondary violation category detected during moderation. |
CtxcbLibName | String | Name of the custom keyword library triggered by keyword detection. This field is present only when keywords are matched. |
CloudCustomData | String | For C2C or group message moderation, the CloudCustomData custom field in the message body is returned as-is. For other moderation scenarios, this field is empty. |
Response Example
{"ActionStatus": "OK","ErrorInfo": "","ErrorCode": 0}
Response Fields
Field | Type | Description |
ActionStatus | String | Processing result: OK indicates success. FAIL indicates failure. |
ErrorCode | Integer | Error code: 0: App backend processed successfully. 1: App backend processing failed. |
ErrorInfo | String | Error message. |