logo
Voice Call
Server API
Stream Mixing and Transcoding APIs
On this page

DescribeRTCStreamState

GET

https://rtc-api.zego.im/

This API supports querying the real-time status of a specified stream (whether it is active or exists). It only supports querying streams published to the ZEGOCLOUD media server (RTC service), and does not support querying streams published directly to the CDN or output from the stream mixing service.

It is recommended to prioritize using stream created callback and stream destroyed callback to asynchronously obtain current stream publishing information. This API is generally used as an auxiliary interface for stream created callback and stream destroyed callback, or when querying whether a specified single stream is active in the business backend.

Note

This API supports querying stream status information after starting stream publishing by default.

Rate Limit
For all rooms under the same AppID: 40 times/second (test environment: 10 times/second)
Note

In the test environment (see the IsTest common parameter description for details), the Stream ID must be prefixed with "zegotest-AppId-". For example, if the Stream ID is "test" and the AppId is "123456789" in the test environment, the Stream ID should be "zegotest-123456789-test".

Request

Query Parameters

    Action stringrequired

    Possible values: [DescribeRTCStreamState]

    API prototype parameters

    https://rtc-api.zego.im?Action=DescribeRTCStreamState

    AppId uint32required

    💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.

    SignatureNonce stringrequired

    💡Common parameter. A 16-character hexadecimal random string (hex-encoded 8-byte random number). For the generation algorithm, refer to the signature example.

    Timestamp int64required

    💡Common parameter. Current Unix timestamp in seconds. For the generation algorithm, refer to the signature example. A maximum deviation of 10 minutes is allowed.

    Signature stringrequired

    💡Common parameter. Signature used to verify the legitimacy of the request. Please refer to the signature mechanism to generate it.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Public parameter. Signature version number.

    StreamId stringrequired

    Stream ID.

    Sequence stringrequired

    Request sequence number, customized by the user.

    Note

    For the same StreamId, within 10 consecutive seconds, the request sequence number issued for this StreamId must be strictly increasing; this avoids inconsistent operation order caused by inconsistent request timing received by the server.

    If there is no concurrent scenario, using a timestamp (millisecond level) is recommended.

Responses

Success
Schema
    Code number

    Return code. The following only lists some return codes related to the API business logic. For the complete return codes, please refer to Global Return Codes.

    Return CodeDescriptionSuggested Action
    0Query succeeded, the queried stream exists and is in active state.-
    3000Invalid App.Please contact ZEGOCLOUD Technical Support.
    3001, 30003Internal error.Please contact ZEGOCLOUD Technical Support.
    3002Timestamp error.Please regenerate a new Timestamp.
    3003App not configured with Token.Please contact ZEGOCLOUD Technical Support.
    30002API call rate too high.Please reduce the API request frequency.
    30004Incorrect isTest parameter.Please check if the isTest common parameter is correct.
    30005Invalid AppId.Please check if the AppId is correct.
    30009Invalid StreamId, stream name does not conform to specifications.Please check if the StreamId conforms to the stream name encoding specifications.
    40005Authentication failed.Please check if the Signature is correct.
    41004Query failed, StreamId does not exist.Please check if the StreamId is correct or if the "query stream status history information permission" has expired.
    41006Query succeeded, the queried stream exists but is in closed state. This is only returned within the validity period of the "query stream status history information permission".-
    Message string

    Operation result description

    RequestId string

    Request ID

    Data object
    Response data
    create_time string

    Stream creation time, UTC time

    close_time string

    Stream close time, UTC time

Previous

RTMPDispatchV2

Next

StartCDNRecord

On this page

Back to top