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 is created.
- You can create up to 300 interactive messaging applications in an Alibaba Cloud account.
QPS limit
You can call this operation up to 50 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
live:CreateLiveMessageApp | create | *All Resources * |
| none |
Request parameters
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.}
Event callbacks
The HTTP or HTTPS request method is POST. The request body is a JSON string encoded in UTF-8. Sample event callback:
{
"transactionid":"A8C7B033-B339-1A58-B0E0-7B9197BA****",
"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 returned for the event of joining a group or leaving a group, but not returned for the logon or logoff event.
"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.
}]
}]
}
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 received 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 MD5CONTENT = 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
Examples
Sample success responses
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. |
403 | NoAuth | %s. | No permission |
404 | ResourceNotExist | %s. | The requested resource does not exist, please check and try again |
500 | ServerError | %s. | Unknown error, please try again later or submit a ticket for consultation. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-03-13 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-01-31 | The Error code has changed. The response structure of the API has changed | View Change Details |