Updating an Interaction Rule Library for Live Rooms
Function
Updates an interaction rule library for live rooms.
Calling Method
For details, see Calling APIs.
URI
PUT /v1/{project_id}/smart-live-interaction-rule-groups/{group_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
group_id |
Yes |
String |
Interaction policy library ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
No |
String |
User token. This parameter is mandatory when token authentication is used. You can obtain the token by calling the IAM API used to obtain a user token. Value of X-Subject-Token in the response header. |
Authorization |
No |
String |
Authentication information. This parameter is mandatory for AK/SK authentication. |
X-Sdk-Date |
No |
String |
Time when the request is sent. This parameter is mandatory for AK/SK authentication. The format is YYYYMMDD'T'HHMMSS'Z'. |
X-Project-Id |
No |
String |
Project ID. This parameter is mandatory for AK/SK authentication. |
X-App-UserId |
No |
String |
Third-party user ID, which does not allow Chinese characters. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
group_name |
Yes |
String |
Interaction rule library name. |
interaction_rules |
No |
Array of InteractionRuleInfo objects |
Interaction rules. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
rule_index |
No |
String |
Details: Rule index. It is used to index a specific rule when the rule is triggered. Constraints: You do not need to specify it. Options: 0 to 64 characters Default value: N/A |
rule_name |
No |
String |
Details: Rule name. Constraints: N/A Options: 0 to 256 characters Default value: N/A |
enabled |
No |
Boolean |
Details: Whether to enable. Constraints: N/A Options:
Default value: true |
event_type |
No |
Integer |
Details: Livestreaming event type matched by the rule. The value range is 0 to 100. Options: 1: On-screen comments 2: User joining a room 3: Giving likes 4: Sending gifts 10: Preset script events Use the actual value.
NOTE:
Constraints: N/A Default value: N/A Value range: 0-100 |
hit_condition |
No |
HitCondition object |
Rule matching condition |
trigger |
No |
TriggerProcess object |
Processing after rule matching |
review_config |
No |
ReviewConfig object |
Content review configuration. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
relation |
No |
String |
Details: Condition relationship, specifically, the logical operation relationship between multiple conditions. Constraints: N/A Options:
Default value: N/A |
priority |
No |
Integer |
Details: Priority. A smaller value indicates a higher priority. The value ranges from 0 to 999. The default value is 500. This parameter is optional. Constraints: N/A Value range: 0-999 Default value: 500 |
tags |
No |
Array of HitConditionTag objects |
Matching relationship configuration |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
tag |
No |
String |
Details: Key fields in the event content.
NOTE:
Constraints: N/A Options: The value contains 0 to 256 characters. Default value: N/A |
operation |
No |
String |
Details: Field value processing Constraints: N/A Options:
Default value: NONE |
match |
No |
String |
Details: Match type. You are advised to use REGEX for keyword matching. Constraints: N/A Options:
Default value: N/A |
value |
No |
String |
Details: Matched value. Constraints: N/A Options: The value contains 0 to 1,024 characters. Default value: N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
time_window |
No |
Integer |
Details: Processing suppression duration, in second.
Constraints: N/A Default value: N/A Value range: -1-7200 |
reply_mode |
No |
String |
Details: Reply type. Constraints: N/A Options:
Default value: N/A |
layer_config |
No |
SmartLayerConfig object |
Intelligent layer configuration. |
extra_layer_config |
No |
SmartLayerConfig object |
Additional layer, which is used together with the second layer when dynamic text needs to be displayed for products. |
reply_texts |
No |
Array of strings |
Details: Reply scripts. Constraints: N/A Options: A maximum of five preset scripts are allowed. A single script contains 0 to 1,024 characters. Default value: N/A |
reply_audios |
No |
Array of ReplyAudioInfo objects |
Details: Reply audio set. Set audio_url. Constraints: N/A Options: A maximum of five preset audio files are allowed. Default value: N/A |
reply_order |
No |
String |
Details: Sequence of reading reply scripts. Constraints: N/A Options:
Default value: N/A |
reply_role |
No |
String |
Details: Reply role. Constraints: N/A Options:
Default value: STREAMER |
robot_id |
No |
String |
Details: Bot ID. Constraints: ID of the large model robot configured for intelligent interaction. This parameter is mandatory when reply_mode is set to INTELLIGENT_REPLY. For details about how to obtain the ID. Options: The value contains 0 to 64 characters. Default value: N/A |
play_type |
No |
String |
Reply playback type.
Default value: PLAY_NOW |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
layer_type |
Yes |
String |
Layer type.
|
asset_id |
No |
String |
ID of the asset overlaid on a video. You do not need to set this parameter for external assets. |
position |
No |
LayerPositionConfig object |
Layer position configuration. |
size |
No |
LayerSizeConfig object |
Layer size configuration. |
image_config |
No |
SmartImageLayerConfig object |
Image layer configuration. |
video_config |
No |
SmartVideoLayerConfig object |
Video layer configuration. |
text_config |
No |
SmartTextLayerConfig object |
Video layer configuration. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
dx |
Yes |
Integer |
Details: X axis position of the pixel in the upper left corner of the image. The coordinate of the upper left corner of the image layout is 0x0. The image layout resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16). Constraints: The value is the pixel value relative to the image layout. It indicates only the layout position relationship and is irrelevant to the resolution of the output image. Value range: -1920-3840 Default value: 0 |
dy |
Yes |
Integer |
Details: Y axis position of the pixel in the upper left corner of the image. The coordinate of the upper left corner of the image layout is 0x0. The image layout resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16). Constraints: The value is the pixel value relative to the image layout. It indicates only the layout position relationship and is irrelevant to the resolution of the output image. Value range: -1920-3840 Default value: 0 |
layer_index |
Yes |
Integer |
Details: Layer sequence of an image, video, or person image.
NOTE:
The layer sequence is an integer starting from 1 and incremented by 1. Constraints: If duplicate layers exist, the overlay relationship between the duplicate layers is random. Value range: 1-100 Default value: 100 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
width |
No |
Integer |
Details: Y axis position of the pixel in the upper left corner of the image. Width (in pixel) of the layer image (relative to the image layout size). The image layout resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16). Constraints: The value is the pixel value relative to the image layout. It indicates only the layout position relationship and is irrelevant to the resolution of the output image. Value range: 1-7680 |
height |
No |
Integer |
Details: Height (in pixel) of the layer image (relative to the image layout size). The image layout resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16). Constraints: The value is the pixel value relative to the image layout. It indicates only the layout position relationship and is irrelevant to the resolution of the output image. | Value range: 1-7680 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
image_url |
Yes |
String |
Image file URL. |
display_duration |
No |
Integer |
Details: Image display duration, in second. If reply_texts and reply_audios are carried, the duration is the same as the audio playback duration. If reply_texts and reply_audios are not carried, the duration is the same as the audio playback duration of the matched keyword. Value range: 0-3600 Default value: 0 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
video_url |
Yes |
String |
Video file URL. |
video_cover_url |
No |
String |
Video thumbnail file URL. |
display_duration |
No |
Integer |
Details: Image display duration, in second. If reply_texts and reply_audios are carried, the duration is the same as the audio playback duration. If reply_texts and reply_audios are not carried, the duration is the same as the audio playback duration of the matched keyword. Value range: 0-3600 Default value: 0 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
text_type |
No |
String |
Details: Text type.
Default value: DYNAMIC |
text_context |
No |
String |
Text. |
font_name |
No |
String |
Details: Font. The following fonts are supported:
Default value: HarmonyOS_Sans_SC_Black |
font_size |
No |
Integer |
Details: Font size (in pixel). Value range: [4, 120]. The value range is subject to the actual service. Value range: 0-120 Default value: 16 |
font_color |
No |
String |
Details: Font color. RGB color value. Default value: #FFFFFF |
display_duration |
No |
Integer |
Details: Text display duration, in second. If reply_texts and reply_audios are carried, the duration is the same as the audio playback duration. If reply_texts and reply_audios are not carried, the duration is the same as the audio playback duration of the matched keyword. Value range: 0-3600 Default value: 0 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
X-Request-Id |
String |
Request ID. |
Parameter |
Type |
Description |
---|---|---|
group_id |
String |
Interaction rule library ID. |
group_name |
String |
Interaction rule library name. |
interaction_rules |
Array of InteractionRuleDetailInfo objects |
Interaction rules. |
create_time |
String |
Creation time. The format complies with RFC 3339, for example, 2021-01-10T08:43:17Z. |
update_time |
String |
Update time. The format complies with RFC 3339, for example, 2021-01-10T08:43:17Z. |
Parameter |
Type |
Description |
---|---|---|
rule_index |
String |
Details: Rule index. It is used to index a specific rule when the rule is triggered. Constraints: You do not need to specify it. Options: 0 to 64 characters Default value: N/A |
rule_name |
String |
Details: Rule name. Constraints: N/A Options: 0 to 256 characters Default value: N/A |
enabled |
Boolean |
Details: Whether to enable. Constraints: N/A Options:
Default value: true |
event_type |
Integer |
Details: Livestreaming event type matched by the rule. The value range is 0 to 100. Options: 1: On-screen comments 2: User joining a room 3: Giving likes 4: Sending gifts 10: Preset script events Use the actual value.
NOTE:
Constraints: N/A Default value: N/A Value range: 0-100 |
hit_condition |
HitCondition object |
Rule matching condition |
trigger |
TriggerProcess object |
Processing after rule matching |
review_config |
ReviewConfig object |
Content review configuration. |
rule_id |
String |
Interaction rule ID. |
create_time |
String |
Creation time. The format complies with RFC 3339, for example, 2021-01-10T08:43:17Z. |
update_time |
String |
Update time. The format complies with RFC 3339, for example, 2021-01-10T08:43:17Z. |
Parameter |
Type |
Description |
---|---|---|
relation |
String |
Details: Condition relationship, specifically, the logical operation relationship between multiple conditions. Constraints: N/A Options:
Default value: N/A |
priority |
Integer |
Details: Priority. A smaller value indicates a higher priority. The value ranges from 0 to 999. The default value is 500. This parameter is optional. Constraints: N/A Value range: 0-999 Default value: 500 |
tags |
Array of HitConditionTag objects |
Matching relationship configuration |
Parameter |
Type |
Description |
---|---|---|
tag |
String |
Details: Key fields in the event content.
NOTE:
Constraints: N/A Options: The value contains 0 to 256 characters. Default value: N/A |
operation |
String |
Details: Field value processing Constraints: N/A Options:
Default value: NONE |
match |
String |
Details: Match type. You are advised to use REGEX for keyword matching. Constraints: N/A Options:
Default value: N/A |
value |
String |
Details: Matched value. Constraints: N/A Options: The value contains 0 to 1,024 characters. Default value: N/A |
Parameter |
Type |
Description |
---|---|---|
time_window |
Integer |
Details: Processing suppression duration, in second.
Constraints: N/A Default value: N/A Value range: -1-7200 |
reply_mode |
String |
Details: Reply type. Constraints: N/A Options:
Default value: N/A |
layer_config |
SmartLayerConfig object |
Intelligent layer configuration. |
extra_layer_config |
SmartLayerConfig object |
Additional layer, which is used together with the second layer when dynamic text needs to be displayed for products. |
reply_texts |
Array of strings |
Details: Reply scripts. Constraints: N/A Options: A maximum of five preset scripts are allowed. A single script contains 0 to 1,024 characters. Default value: N/A |
reply_audios |
Array of ReplyAudioInfo objects |
Details: Reply audio set. Set audio_url. Constraints: N/A Options: A maximum of five preset audio files are allowed. Default value: N/A |
reply_order |
String |
Details: Sequence of reading reply scripts. Constraints: N/A Options:
Default value: N/A |
reply_role |
String |
Details: Reply role. Constraints: N/A Options:
Default value: STREAMER |
robot_id |
String |
Details: Bot ID. Constraints: ID of the large model robot configured for intelligent interaction. This parameter is mandatory when reply_mode is set to INTELLIGENT_REPLY. For details about how to obtain the ID. Options: The value contains 0 to 64 characters. Default value: N/A |
play_type |
String |
Reply playback type.
Default value: PLAY_NOW |
Parameter |
Type |
Description |
---|---|---|
layer_type |
String |
Layer type.
|
asset_id |
String |
ID of the asset overlaid on a video. You do not need to set this parameter for external assets. |
position |
LayerPositionConfig object |
Layer position configuration. |
size |
LayerSizeConfig object |
Layer size configuration. |
image_config |
SmartImageLayerConfig object |
Image layer configuration. |
video_config |
SmartVideoLayerConfig object |
Video layer configuration. |
text_config |
SmartTextLayerConfig object |
Video layer configuration. |
Parameter |
Type |
Description |
---|---|---|
dx |
Integer |
Details: X axis position of the pixel in the upper left corner of the image. The coordinate of the upper left corner of the image layout is 0x0. The image layout resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16). Constraints: The value is the pixel value relative to the image layout. It indicates only the layout position relationship and is irrelevant to the resolution of the output image. Value range: -1920-3840 Default value: 0 |
dy |
Integer |
Details: Y axis position of the pixel in the upper left corner of the image. The coordinate of the upper left corner of the image layout is 0x0. The image layout resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16). Constraints: The value is the pixel value relative to the image layout. It indicates only the layout position relationship and is irrelevant to the resolution of the output image. Value range: -1920-3840 Default value: 0 |
layer_index |
Integer |
Details: Layer sequence of an image, video, or person image.
NOTE:
The layer sequence is an integer starting from 1 and incremented by 1. Constraints: If duplicate layers exist, the overlay relationship between the duplicate layers is random. Value range: 1-100 Default value: 100 |
Parameter |
Type |
Description |
---|---|---|
width |
Integer |
Details: Y axis position of the pixel in the upper left corner of the image. Width (in pixel) of the layer image (relative to the image layout size). The image layout resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16). Constraints: The value is the pixel value relative to the image layout. It indicates only the layout position relationship and is irrelevant to the resolution of the output image. Value range: 1-7680 |
height |
Integer |
Details: Height (in pixel) of the layer image (relative to the image layout size). The image layout resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16). Constraints: The value is the pixel value relative to the image layout. It indicates only the layout position relationship and is irrelevant to the resolution of the output image. | Value range: 1-7680 |
Parameter |
Type |
Description |
---|---|---|
image_url |
String |
Image file URL. |
display_duration |
Integer |
Details: Image display duration, in second. If reply_texts and reply_audios are carried, the duration is the same as the audio playback duration. If reply_texts and reply_audios are not carried, the duration is the same as the audio playback duration of the matched keyword. Value range: 0-3600 Default value: 0 |
Parameter |
Type |
Description |
---|---|---|
video_url |
String |
Video file URL. |
video_cover_url |
String |
Video thumbnail file URL. |
display_duration |
Integer |
Details: Image display duration, in second. If reply_texts and reply_audios are carried, the duration is the same as the audio playback duration. If reply_texts and reply_audios are not carried, the duration is the same as the audio playback duration of the matched keyword. Value range: 0-3600 Default value: 0 |
Parameter |
Type |
Description |
---|---|---|
text_type |
String |
Details: Text type.
Default value: DYNAMIC |
text_context |
String |
Text. |
font_name |
String |
Details: Font. The following fonts are supported:
Default value: HarmonyOS_Sans_SC_Black |
font_size |
Integer |
Details: Font size (in pixel). Value range: [4, 120]. The value range is subject to the actual service. Value range: 0-120 Default value: 16 |
font_color |
String |
Details: Font color. RGB color value. Default value: #FFFFFF |
display_duration |
Integer |
Details: Text display duration, in second. If reply_texts and reply_audios are carried, the duration is the same as the audio playback duration. If reply_texts and reply_audios are not carried, the duration is the same as the audio playback duration of the matched keyword. Value range: 0-3600 Default value: 0 |
Parameter |
Type |
Description |
---|---|---|
audio_url |
String |
Audio URL. |
audio_name |
String |
Audio name. |
Parameter |
Type |
Description |
---|---|---|
no_need_review |
Boolean |
Content review whitelist. This feature is available only for users in the whitelist. The auto review policies apply to other users. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error description. |
Example Requests
PUT https://{endpoint}/v1/70b76xxxxxx34253880af501cdxxxxxx/smart-live-interaction-rule-groups/26f06524-4f75-4b3a-a853-b649a21aaf66 { "group_name" : "Welcome Message" }
Example Responses
Status code: 200
Succeeded.
{ "group_id" : "26f06524-4f75-4b3a-a853-b649a21aaf66" }
Status code: 400
{ "error_code" : "MSS.00000003", "error_msg" : "Invalid parameter" }
Status code: 401
{ "error_code" : "MSS.00000001", "error_msg" : "Unauthorized" }
Status code: 500
{ "error_code" : "MSS.00000004", "error_msg" : "Internal Error" }
Status Codes
Status Code |
Description |
---|---|
200 |
Succeeded. |
400 |
Parameters error, including the error code and its description. |
401 |
Authentication is not performed or fails. |
500 |
Internal service error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot