All Products
Search
Document Center

ApsaraVideo Live:CreateLiveMessageApp

Last Updated:Jul 11, 2025

Creates an interactive messaging application.

Operation description

  • When you call other operations to manage the interactive messaging application, you must specify the same data center in which the application was created.

  • You can create up to 300 interactive messaging applications in an Alibaba Cloud account.

QPS limits

You can call this operation up to 50 times per second per account. Requests that exceed this limit are dropped and you may experience service interruptions. We recommend that you consider this limit when calling this operation.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that support authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

live:CreateLiveMessageApp

create

*All Resource

*

None

None

Request parameters

Parameter

Type

Required

Description

Example

AppName

string

No

The application name. It must be 2 to 16 characters in length.

testApp

AuditType

integer

No

The content moderation method. Valid values:

  • 0 (default): disables content moderation.

  • 1: Built-in content moderation.

  • 2: Custom content moderation.

2

AuditUrl

string

No

The URL for content moderation. This parameter is required if you set AuditType to 2. The URL must start with http:// or https:// and cannot contain a private IP address or a port number. For the format of custom content moderation, see the "Custom content moderation" section of this topic.

http://demo.aliyundoc.com/exampleaudit

EventCallbackUrl

string

No

The callback URL for events such as client logon, logoff, joining a group, and leaving a group. If you leave this parameter empty, callbacks are disabled. The callback URL must start with http:// or https:// and cannot contain a private IP address or a port number. For the callback message format and authentication logic, see the "Event callbacks" and "Callback authentication" sections of this topic.

http://demo.aliyundoc.com/examplecallback

DataCenter

string

No

The data center. Valid values:

  • cn-shanghai (default): the data center in the China (Shanghai) region.

  • ap-southeast-1: the data center in the Singapore region.

Note

When you call other operations to manage the interactive messaging application, you must specify the same data center in which the application is created.

cn-shanghai

MsgLifeCycle

integer

No

The retention period of group messages in the application. Valid values:

  • 0 (default): 30 days.

  • 1: 90 days.

  • 2: 180 days.

1

Custom content moderation

  • Request protocol: HTTP

  • Request method: POST

  • Sample request:

{
  "content": "testaudit"
}
  • Sample response:

{
  "pass": true,
  "reason":"****"    | If the value of pass is true, the content passes the moderation. Otherwise, the content fails the moderation. The reason field describes the reason for failure.
}
Note

HTTP status code 200 indicates success. If other HTTP status codes are returned, the service is considered unavailable and no content moderation is performed.

Event callbacks

The HTTP or HTTPS request method is POST. The request body is a JSON string encoded in UTF-8. Sample event callback:

{
  "appid":"demo",
  "eves":[{
  "uid":"uid1",
  "sid":"sessionid",
  "events":[{
     "e": 3, | The event. Valid values: 1 (logon), 2 (logoff), 3 (joining a group), 4 (leaving a group), and 5 (reconnection)
     "r": 1, | The reason for logoff. This field is returned for only the logoff event. Valid values: 1 (normal call), 3 (timeout), and 4 (logon from another device).
     "g": "testgroup", | The group ID. This field is available for joining and leaving a group, but not for logon and logoff events.
     "gs":["testgroupid"] | The list of group IDs, which indicates the information about the groups that the client joins upon reconnection. This field is not returned for other events.
  }]
  }]
}
Note

HTTP status code 200 indicates success. If other HTTP status codes are returned, the system tries to send the callback again.

Callback authentication

When the service initiates a request, it includes the Ali-Live-Timestamp and Ali-Live-Signature fields as HTTP or HTTPS request headers, which are used by the callback receiving server for signature verification. The value of Ali-Live-Signature is calculated based on the following formula: Ali-Live-Signature = sha256(CONTENT), in which CONTENT = Callback domain name|Ali-Live-Timestamp value|Authentication key. The callback domain name is the domain name for which the callback URL is configured, and the authentication key is the AppKey that is generated when you create the application.

Response parameters

Parameter

Type

Description

Example

object

The returned results.

RequestId

string

The request ID.

65EEDBEB-43FE-1E15-976F-3DDD753A****

AppId

string

The application ID. It can be used in subsequent operations, such as joining a group.

demo

AppKey

string

The AppKey. It is used to perform authentication for various operations related to the application ID.

**********************************

AppSign

string

The application signature. It is required by the interactive messaging SDK.

**************************************************************************

DataCenter

string

The data center.

cn-shanghai

Examples

Success response

JSON format

{
  "RequestId": "65EEDBEB-43FE-1E15-976F-3DDD753A****",
  "AppId": "demo",
  "AppKey": "**********************************",
  "AppSign": "**************************************************************************",
  "DataCenter": "cn-shanghai"
}

Error codes

HTTP status code

Error code

Error message

Description

400

InputInvalid

%s.

Illegal input parameters

400

ErrorInvalidAppName

%s.

The AppName is invalid, please check and try again.

400

ErrorTooManyApps

%s.

Under each account, up to 300 apps are allowed to be created at the same time.

400

ErrorInvalidEventCallbackUrl

%s.

The EventCallbackUrl is invalid, please check and try again.

400

ErrorInvalidAuditUrl

%s.

The AuditUrl is invalid, please check and try again.

500

ServerError

%s.

Unknown error, please try again later or submit a ticket for consultation.

403

NoAuth

%s.

No permission

404

ResourceNotExist

%s.

The requested resource does not exist, please check and try again

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.