All Products
Search
Document Center

ApsaraVideo Live:ListEventSub

Last Updated:Sep 23, 2024

Queries the events generated in channels to which you subscribe.

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. For more information, see QPS limits.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action String Yes ListEventSub

The operation that you want to perform. Set the value to ListEventSub.

AppId String Yes 9qb1****

The application ID.

Response parameters

Parameter

Type

Example

Description

RequestId String AE050E24-BE9B-1E79-BB30-7EA0BBAE7F08

The request ID.

Subscribers Array of data

The events.

SubId String 09be0d2254cb5a89f4cbd86403ec****

The ID of the event.

ChannelId String testmodify

The ID of the channel to which you subscribe.

Events Array of String ChannelEvent

The type of the event. Valid values:

  • ChannelEvent: channel event. For example, the channel is opened or closed.
  • UserEvent: user event. For example, a user joins or leaves the channel.
CallbackUrl String http://****.com/callback

The callback URL.

CreateTime String 2023-08-18 10:14:49

The time when the subscription was created. The time is displayed in UTC+8. Format: yyyy-MM-dd hh:mm:ss.

ModifyTime String 2023-08-18 10:14:49

The time when the subscription was modified. The time is displayed in UTC+8. Format: yyyy-MM-dd hh:mm:ss.

Users Array of String testUser

The user whose events are returned. We recommend that you use either this parameter or Roles.

Roles Integer 1

The role of the user whose events are returned. Valid values:

  • 1: streamer
  • 2: viewer

An empty value or a value other than 1 and 2 indicates that events of all users in the channel are returned.

Note This parameter is deprecated. When you create a subscription, this parameter is no longer supported.

Examples

Sample requests

http(s)://live.aliyuncs.com?Action=ListEventSub
&AppId=9qb1****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListEventSubResponse>
    <RequestId>AE050E24-BE9B-1E79-BB30-7EA0BBAE7F08</RequestId>
    <Subscribers>
        <SubId>09be0d2254cb5a89f4cbd86403ec****</SubId>
        <ChannelId>testmodify</ChannelId>
        <Events>ChannelEvent</Events>
        <CallbackUrl>http://****.com/callback</CallbackUrl>
        <CreateTime>2023-08-18 10:14:49</CreateTime>
        <ModifyTime>2023-08-18 10:14:49</ModifyTime>
        <Users>testUser</Users>
        <Roles>1</Roles>
    </Subscribers>
</ListEventSubResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "AE050E24-BE9B-1E79-BB30-7EA0BBAE7F08",
  "Subscribers" : [ {
    "SubId" : "09be0d2254cb5a89f4cbd86403ec****",
    "ChannelId" : "testmodify",
    "Events" : [ "ChannelEvent" ],
    "CallbackUrl" : "http://****.com/callback",
    "CreateTime" : "2023-08-18 10:14:49",
    "ModifyTime" : "2023-08-18 10:14:49",
    "Users" : [ "testUser" ],
    "Roles" : 1
  } ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 InputInvalid %s. One or more parameters are invalid.
403 NoAuth %s. You do not have the required permissions.
404 ResourceNotExist %s. The requested resource does not exist. Check whether the resource exists and try again.
500 ServerError %s. An unknown error occurred. Try again later or submit a ticket.

For a list of error codes, see Service error codes.