Creates an interactive messaging application by calling CreateLiveMessageApp.
Operation description
When calling other interactive messaging API operations, the data center must be the same as the one specified when creating the interactive messaging application.
A maximum of 300 interactive messaging applications can be created under a single Alibaba Cloud account.
QPS limit
The single-user QPS limit for this API operation is 50 calls per second. If this limit is exceeded, the API call is throttled, which may affect your business. Call this operation appropriately.
Try it now
Test
RAM authorization
|
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. The name must be 2 to 16 characters in length. |
testApp |
| AuditType |
integer |
No |
The security audit mode. Valid values:
Valid values:
|
2 |
| AuditUrl |
string |
No |
The URL for custom security audit. This parameter is required when custom security audit is selected (AuditType=2). The URL must start with http:// or https://, must not contain private IP addresses, and must not include port numbers. For the format of custom security audit content, see the following section. |
http://demo.aliyundoc.com/exampleaudit |
| EventCallbackUrl |
string |
No |
The event callback URL for client logon, logout, join group, and leave group events. If this parameter is empty, event callbacks are disabled. For the callback API operations that are triggered, see Client access. The event callback URL must start with http:// or https://, must not contain private IP addresses, and must not include port numbers. For the event callback format and callback authentication logic, see the following section. |
http://demo.aliyundoc.com/examplecallback |
| DataCenter |
string |
No |
The data center. Valid values:
Note
When calling other interactive messaging API operations, the data center must be the same as the one specified when creating the interactive messaging application. |
cn-shanghai |
| MsgLifeCycle |
integer |
No |
The storage duration tier for group messages within the application. Valid values:
|
1 |
Custom security audit content description:
Request protocol: HTTP
Request method: POST
Request example:
{
"content": "testaudit"
}
Response example:
{
"pass": true,
"reason":"****" |pass set to true indicates the content passes the audit. Otherwise, the content does not pass. reason indicates the reason for rejection.
}
An HTTP status code of 200 indicates success. A non-200 status code indicates that the service is unavailable, and the system degrades by skipping the audit for the message.
Event callback
HTTP/HTTPS POST. The body is a JSON UTF-8 string in the following format. Event callback example:
{
"appid":"demo",
"eves":[{
"uid":"uid1",
"sid":"sessionid",
"events":[{
"e": 3, |Event type. Enumeration. 1: logon, 2: logout, 3: joingroup, 4: leavegroup, 5: client reconnection after network disconnection
"r": 1, |Logout reason. This attribute is not present for other events. Enumeration. 1: normal call, 3: timeout, 4: logged on from another device
"g": "testgroup", |Group ID. This value is present for join and leave group events. This attribute is not present for logon and logout events.
"gs":["testgroupid"] |Group ID list. When the client reconnects after network disconnection, this contains the groups the client has joined. This attribute is not present for other events.
}]
}]
}
An HTTP status code of 200 indicates success. Other status codes indicate failure, and the system retries the delivery.
Callback authentication description
When the service initiates a request, the HTTP(S) request header includes the Ali-Live-Timestamp and Ali-Live-Signature fields for the callback message receiving server to perform signature authentication. The Ali-Live-Signature value is calculated as follows: Ali-Live-Signature=sha256(CONTENT). CONTENT = callback domain name + Ali-Live-Timestamp value + authentication key. The callback domain name is the domain name configured in the callback URL. The authentication key is the AppKey generated when the AppId was created.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
65EEDBEB-43FE-1E15-976F-3DDD753A**** |
| AppId |
string |
The application ID, which is used for subsequent operations such as joining groups. |
demo |
| AppKey |
string |
The AppKey, which is used to generate authentication for various operations related to the AppId. |
********************************** |
| AppSign |
string |
The application signature. The interactive messaging service SDK requires this information. |
************************************************************************** |
| 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.