Updated on 2024-07-04 GMT+08:00

Querying Interaction Rule Libraries for Live Rooms

Function

Queries interaction rule libraries for live rooms.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/smart-live-interaction-rule-groups

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Offset where the query starts.

limit

No

Integer

Number of items displayed on each page.

create_since

No

String

Filter the records whose creation time is not earlier than the entered time.

create_until

No

String

Filter the records whose creation time is not later than the entered time.

group_name

No

String

Rule library name.

Request Parameters

Table 3 Request header 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.

Response Parameters

Status code: 200

Table 4 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Request ID.

Table 5 Response body parameters

Parameter

Type

Description

count

Integer

Number of interaction rules.

interaction_rule_groups

Array of InteractionRuleGroupDetail objects

Interaction rule libraries.

Table 6 InteractionRuleGroupDetail

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.

Table 7 InteractionRuleDetailInfo

Parameter

Type

Description

rule_index

String

Rule index.

rule_name

String

Rule name.

enabled

Boolean

Whether to enable.

event_type

Integer

Event type. - 1: on-screen comment - 2: users joining a live room - 3: giving likes - 4: sending gifts - 10: preset wording

hit_condition

HitCondition object

Hit condition.

trigger

TriggerProcess object

Trigger

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.

Table 8 HitCondition

Parameter

Type

Description

relation

String

Condition relationship. The value And or Or RESERVED indicates that the general reply does not check other matching conditions.

priority

Integer

Priority. A smaller value indicates a higher priority. The value ranges from 0 to 999. The default value is 500. This parameter is optional.

tags

Array of HitConditionTag objects

Matching relationship configuration

Table 9 HitConditionTag

Parameter

Type

Description

tag

String

Key fields in the event content.

operation

String

Field processing.

  • SUM: accumulation

  • AVG: average

  • COUNT: count

  • NONE: no processing

match

String

Match type.

  • EQUAL: completely equal

  • REGEX: regular expression match

  • MATH_GT: greater than

  • MATH_GE: greater than or equal to

  • MATH_LT: less than

  • MATH_LE: less than or equal to

  • MATH_EQ: numerically equal

value

String

Match value

Table 10 TriggerProcess

Parameter

Type

Description

time_window

Integer

Processing suppression duration, in second.

–1 indicates the entire livestreaming.

0 indicates no suppression. It is triggered each time.

reply_mode

String

Reply type.

  • SYSTEM_REPLY: automatic reply based on the preset script

  • CALLBACK: callback to other services, with the preset script

  • SHOW_LAYER: overlaid layer display, which does not affect the script

  • INTELLIGENT_REPLY: script of an intelligent reply

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

Reply scripts.

reply_audios

Array of ReplyAudioInfo objects

Reply audio set. Set audio_url.

reply_order

String

Reply sequence.

  • RANDOM: random

  • ORDER: sequential loop

reply_role

String

Reply role. The default value is STREAMER.

  • STREAMER: streamer

  • CO_STREAMER: co-streamer

robot_id

String

Bot ID.

Table 11 SmartLayerConfig

Parameter

Type

Description

layer_type

String

Layer type.

  • IMAGE: image layer

  • VIDEO: video layer

  • TEXT: text layer

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.

Table 12 LayerPositionConfig

Parameter

Type

Description

dx

Integer

X axis position of the pixel in the upper left corner of the image. The coordinate of the upper left corner of the canvas is 0x0.

NOTE:
  • The canvas resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16).

dy

Integer

Y axis position of the pixel in the upper left corner of the image. The coordinate of the upper left corner of the canvas is 0x0.

NOTE:

The canvas resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16).

layer_index

Integer

Layer sequence of an image, video, or person image.

NOTE:
  • The layer sequence is an integer starting from 1. The sequence of the bottom layer is 1 and incremented by 1.

Table 13 LayerSizeConfig

Parameter

Type

Description

width

Integer

Width (in pixel) of the layer image (relative to the canvas size).

NOTE:

The canvas resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16).

height

Integer

Height (in pixel) of the layer image (relative to the canvas size).

NOTE:

The canvas resolution is 1920 x 1080 in landscape mode (16:9) and 1080 x 1920 in portrait mode (9:16).

Table 14 SmartImageLayerConfig

Parameter

Type

Description

image_url

String

Image file URL.

display_duration

Integer

Image display duration, in second.

  • 0 Display duration rule: If reply_texts and reply_audios are carried, the duration is the same as the voice playback duration.

    If reply_texts and reply_audios are not carried, the duration is the same as the voice playback duration of the matched keyword.

Table 15 SmartVideoLayerConfig

Parameter

Type

Description

video_url

String

Video file URL.

video_cover_url

String

Video thumbnail file URL.

display_duration

Integer

Video display duration, in second.

  • 0 Display duration rule: If reply_texts and reply_audios are carried, the duration is the same as the voice playback duration.

    If reply_texts and reply_audios are not carried, the duration is the same as the voice playback duration of the matched keyword.

Table 16 SmartTextLayerConfig

Parameter

Type

Description

text_type

String

Text type.

  • DYNAMIC: dynamic text, which requires keyword replacement

  • STATIC: static text

text_context

String

Text.

font_name

String

Font. The following fonts are supported:

  • HarmonyOS_Sans_SC_Black: HarmonyOS bold

  • HarmonyOS_Sans_SC_Regular: HarmonyOS normal

  • HarmonyOS_Sans_SC_Thin: HarmonyOS light

  • fzyouh: Square & lean

font_size

Integer

Font size (pixel).

The value ranges from 4 to 120.

font_color

String

Font color. RGB color value.

display_duration

Integer

Text display duration, in second.

  • 0 Display duration rule: If reply_texts and reply_audios are carried, the duration is the same as the voice playback duration.

    If reply_texts and reply_audios are not carried, the duration is the same as the voice playback duration of the matched keyword.

Table 17 ReplyAudioInfo

Parameter

Type

Description

audio_url

String

Audio URL.

audio_name

String

Audio name.

Table 18 ReviewConfig

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

Table 19 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 20 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 21 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

GET https://{endpoint}/v1/70b76xxxxxx34253880af501cdxxxxxx/smart-live-rooms

Example Responses

Status code: 200

Succeeded.

{
  "count" : 1,
  "interaction_rule_groups" : [ {
    "group_id" : "26f06524-4f75-4b3a-a853-b649a21aaf66",
    "group_name" : "Welcome to the live room.",
    "create_time" : "2022-11-30T06:59:55Z",
    "update_time" : "2022-12-05T12:30:37Z"
  } ]
}

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.