Query User Push and Pull Stream Basic Information
Description
This interface can be used to query the basic information related to the specified room ID and stream ID of the user within the specified time period.
Request method and endpoint
- Request method: GET
- Request URL:
https://analytics-api.zego.im/?Action=GetStreamBaseInfo - Transfer protocol: HTTPS
- QPS limit (same AppID): 3 times/second, 10000 times/day
Request parameters
The following request parameter list only lists the interface request parameters and some common parameters. Please refer to Accessing Server APIs - Public Request Parameters for the complete common parameter list.
| Parameter | Type | Required | Description |
|---|---|---|---|
| RoomId | String | Yes | Room ID. |
| UserId | String | Yes | User ID. |
| StreamId | String | Yes | Stream ID. |
| StreamType | String | Yes | The type of the stream:
|
| StartTs | Number | Yes | Start time, UTC timestamp in milliseconds. |
| EndTs | Number | Yes | End time, UTC timestamp in milliseconds. If the push stream is not ended, it can be represented as 0 or the current timestamp to indicate in progress. |
Request Example
https://analytics-api.zego.im/?Action=GetStreamBaseInfo
&RoomId=room
&UserId=userA
&StreamId=streamA
&StreamType=publish
&StartTs=1672565276000
&EndTs=1672565456000
&<Public Request Parameters>Response Parameters
| Parameter | Type | Description |
|---|---|---|
| Code | Number | Return code. |
| Message | String | Operation result description. |
| RequestId | String | Request ID. |
| Data | Object | Response data. |
| └Metrics | Array of Object | Metric list. |
| └Metric | String | Metric name, possible values:
|
| └Values | Array of Object | Metric value list. |
| └Value | String | Metric value. When Metric is net_type, this field is fixed as follows:
Metric is other values, this field is not fixed. |
| └Timestamp | Number | UTC timestamp in milliseconds. |
Response Example
{
"Code": 0,
"Message": "success",
"Data": {
"Metrics": [
{
"Metric": "net_type",
"Values": [
{
"Timestamp": 1660634097767,
"Value": "WIFI"
}
]
}
]
},
"RequestId": 1660645050860325000
}Return Code
| Return Code | Description | Action |
|---|---|---|
| 0 | Success. | - |
| 500 | Interface error. | Contact ZEGOCLOUD Technical Support. |
| 10001 | Parameter format error. | Check parameters. |
| 10002 | Parameter error or parameter invalid. | Check parameters. |
| 30002 | Interface request frequency exceeds the limit. | Please confirm the QPS limit of the corresponding interface and reduce the request frequency. |
