Queries the number of historical online users for a live stream.

  • The overall latency lasts 2 to 5 minutes.
  • This operation can be called up to 30 times per second.

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 DescribeLiveStreamHistoryUserNum

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

AppName String Yes testApp

The application to which the domain name belongs.

DomainName String Yes www.yourdomain.com

The domain name.

EndTime String Yes 2017-12-22T08:00:00Z

The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note The duration specified by the StartTime and EndTime parameters cannot exceed one day. The time specified by the EndTime parameter must be earlier than the current time.
StartTime String Yes 2017-12-21T08:00:00Z

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note You can query data that is collected in the last 30 days.
StreamName String Yes testStream

The domain name.

Response parameters

Parameter Type Example Description
RequestId String 16A96B9A-F203-4EC5-8E43-CB92E68F5FF8

The ID of the request.

LiveStreamUserNumInfos Array of LiveStreamUserNumInfo

The number of historical online users for the live stream.

LiveStreamUserNumInfo
UserNum String 1

The number of users.

StreamTime String 2017-10-20T06:20:00Z

The time at which the live stream was played. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

Examples

Sample requests

http(s)://live.aliyuncs.com/? Action=DescribeLiveStreamHistoryUserNum
&AppName=testApp
&DomainName=www.yourdomain.com
&EndTime=2017-12-22T08:00:00Z
&StartTime=2017-12-21T08:00:00Z
&StreamName=testStream
&<Common request parameters>

Sample success responses

XML format

<DescribeLiveStreamHistoryUserNumResponse>
	  <LiveStreamUserNumInfos>
		    <LiveStreamUserNumInfo>
			      <StreamTime>2017-10-20T06:20:00Z</StreamTime>
			      <UserNum>0</UserNum>
		    </LiveStreamUserNumInfo>
		    <LiveStreamUserNumInfo>
			      <StreamTime>2017-10-20T06:19:00Z</StreamTime>
			      <UserNum>0</UserNum>
		    </LiveStreamUserNumInfo>
		    <LiveStreamUserNumInfo>
			      <StreamTime>2017-10-20T06:18:00Z</StreamTime>
			      <UserNum>15</UserNum>
		    </LiveStreamUserNumInfo>
		    <LiveStreamUserNumInfo>
			      <StreamTime>2017-10-20T06:17:00Z</StreamTime>
			      <UserNum>0</UserNum>
		    </LiveStreamUserNumInfo>
		    <LiveStreamUserNumInfo>
			      <StreamTime>2017-10-20T06:16:00Z</StreamTime>
			      <UserNum>0</UserNum>
		    </LiveStreamUserNumInfo>
		    <LiveStreamUserNumInfo>
			      <StreamTime>2017-10-20T06:15:00Z</StreamTime>
			      <UserNum>6</UserNum>
		    </LiveStreamUserNumInfo>
		    <LiveStreamUserNumInfo>
			      <StreamTime>2017-10-20T06:14:00Z</StreamTime>
			      <UserNum>0</UserNum>
		    </LiveStreamUserNumInfo>
	  </LiveStreamUserNumInfos>
	  <RequestId>16A96B9A-F203-4EC5-8E43-CB92E68F5FF8</RequestId>
</DescribeLiveStreamHistoryUserNumResponse>

JSON format

{
    "LiveStreamUserNumInfos":{
        "LiveStreamUserNumInfo":[
            {
                "StreamTime":"2017-10-20T06:20:00Z",
                "UserNum":0
            },
            {
                "StreamTime":"2017-10-20T06:19:00Z",
                "UserNum":0
            },
            {
                "StreamTime":"2017-10-20T06:18:00Z",
                "UserNum":15
            },
            {
                "StreamTime":"2017-10-20T06:17:00Z",
                "UserNum":0
            },
            {
                "StreamTime":"2017-10-20T06:16:00Z",
                "UserNum":0
            },
            {
                "StreamTime":"2017-10-20T06:15:00Z",
                "UserNum":6
            },
            {
                "StreamTime":"2017-10-20T06:14:00Z",
                "UserNum":0
            }
        ]
    },
    "RequestId":"16A96B9A-F203-4EC5-8E43-CB92E68F5FF8"
}

Error codes

HttpCode Error code Error message Description
400 InvalidStartTime.Malformed Specified StartTime is malformed. The error message returned because the format of the start time is invalid. Check whether the value of the StartTime parameter is correct.
400 InvalidEndTime.Malformed Specified EndTime is malformed. The error message returned because the format of the end time is invalid. Check whether the value of the EndTime parameter is correct.

For a list of error codes, visit the API Error Center.