El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

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.

Value range:

0-2147483647

Default value:

0

limit

No

Integer

Number of items displayed on each page.

Value range:

1-100

Default value:

10

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

Details:

Number of interaction rules.

Value range:

0-1000

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

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:

  • true: enabled
  • false: disabled

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:
  • 1, 2, 3, 4: corresponds to event.type in LiveEventReport
  • 10: matches the preset script

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.

Table 8 HitCondition

Parameter

Type

Description

relation

String

Details:

Condition relationship, specifically, the logical operation relationship between multiple conditions.

Constraints:

N/A

Options:

  • AND: Multiple conditions are met.
  • OR: One of the conditions is met.
  • RESERVED: The general reply does not check other matching conditions.

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

Table 9 HitConditionTag

Parameter

Type

Description

tag

String

Details:

Key fields in the event content.

NOTE:
  • When event_type is set to 1, 2, 3, or 4, the value corresponds to the JSON field deserialized from event.content in LiveEventReport. The following is an on-screen comment event report.

    {

    "timestamp": 1694481224245,

    "type": 1,

    "content": "{"user":{"userId":"2027271526","name":"","level":17,"badge":"","badgeLevel":0},"content":""}"

    }

    To match the on-screen comment content, enter content. To match the user platform level, enter level.

  • 10: Set this field to content.

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:

  • SUM: accumulation
  • AVG: average
  • COUNT: count
  • NONE: no processing

Default value:

NONE

match

String

Details:

Match type. You are advised to use REGEX for keyword matching.

Constraints:

N/A

Options:

  • 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

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

Table 10 TriggerProcess

Parameter

Type

Description

time_window

Integer

Details:

Processing suppression duration, in second.

  • –1: triggered only once throughout the livestream
  • 0: no suppression. It is triggered each time.
  • n: triggered only once within n seconds

Constraints:

N/A

Default value:

N/A

Value range:

-1-7200

reply_mode

String

Details:

Reply type.

Constraints:

N/A

Options:

  • SYSTEM_REPLY: automatic reply based on the preset script
  • CALLBACK: callback to other services, with the preset script
  • SHOW_LAYER: display of only overlaid layers, which does not affect the script
  • INTELLIGENT_REPLY: use the configured large model to generate reply scripts

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:

  • RANDOM: randomly
  • ORDER: sequential loop

Default value:

N/A

reply_role

String

Details:

Reply role.

Constraints:

N/A

Options:

  • STREAMER: streamer
  • CO_STREAMER: co-streamer, audio-only

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.

  • APPEND: added to the end of the playback queue in the scene
  • INSERT: inserted to the end of two audio files or a text sentence
  • PLAY_NOW: inserted immediately. After the instruction is received, the media file is played immediately without waiting till the end of the sentence.

Default value:

PLAY_NOW

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

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

Table 13 LayerSizeConfig

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

Table 14 SmartImageLayerConfig

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

Table 15 SmartVideoLayerConfig

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

Table 16 SmartTextLayerConfig

Parameter

Type

Description

text_type

String

Details:

Text type.

  • DYNAMIC: dynamic text, which requires keyword replacement
  • STATIC: static text

Default value:

DYNAMIC

text_context

String

Text.

font_name

String

Details:

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

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

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.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback