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

ForbidRTCStreams

GET

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

Call this interface to batch-forbid RTC streams, which can batch-forbid specified stream IDs from being pushed to the RTC service. Forbidding stream operations will send notifications to clients that are currently publishing streams and clients that are playing streams. It is typically used when developers need to temporarily interrupt a terminal's stream publishing through the server.

Publishing clients receive notifications of stream publishing being forbidden by the server using ZEGOCLOUD Express SDK callback interfaces:

PlatformZegoExpress SDKLiveRoom SDK
InterfaceError CodeInterfaceError Code
iOS/macOSonPublisherStateUpdate1003025onPublishStateUpdate12301011
AndroidonPublisherStateUpdate1003025onPublishStateUpdate12301011
WindowsonPublisherStateUpdate1003025OnPublishStateUpdate12301011

Playing clients receive notifications of their played streams being forbidden by the server using ZEGOCLOUD Express SDK callback interfaces:

PlatformZegoExpress SDKLiveRoom SDK
InterfaceError CodeInterfaceError Code
iOS/macOSonPlayerStateUpdate1004025onPlayStateUpdate12301011
AndroidonPlayerStateUpdate1004025onPlayStateUpdate12301011
WindowsonPlayerStateUpdate1004025OnPlayStateUpdate12301011
Warning

After calling this interface, the audio and video streams that are currently being pushed will be forbidden from pushing, and the stream IDs will be recorded in the background database; non-existent streams will be directly recorded in the background database, and the interface will normally return successfully.

Call frequency limit
All rooms under the same AppID are limited to 20 times/second (Test environment: 5 times/second)
Note

In the test environment (see the IsTest common parameter description for details), the stream ID needs to 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: [ForbidRTCStreams]

    Interface prototype parameters

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

    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[] string[]required

    Stream ID list, supports up to 20 stream IDs.

    Sequence stringrequired

    Request sequence number.

    Note

    For the same StreamId, within 10 consecutive seconds, you must ensure that the request sequence numbers issued for this StreamId are strictly increasing; avoid operation errors caused by inconsistent timing of requests received by the server.

    If there are no concurrent scenarios, it is recommended to use timestamps (millisecond level).

Responses

Success
Schema
    Code number

    Return code. Only the return codes related to interface business logic are listed below. For complete return codes, please refer to Global Return Codes.

    Return CodeDescriptionHandling Suggestion
    30002API call rate too high.Please reduce the API request frequency.
    30003Internal error.Please contact ZEGOCLOUD Technical Support for handling.
    30004Parameter isTest error.Please check if the common request parameter isTest is correct.
    30005Invalid AppId.Please check if the AppId is correct.
    30006Invalid StreamId list.Please check if StreamId[] is correct.
    42003Batch disabling live stream failed.Please retry, if retry is invalid, please contact ZEGOCLOUD Technical Support.
    Message string

    Operation result description

    RequestId string

    Request ID

    Data object

    Response data

Previous

ResumeRTCStream

Next

ResumeRTCStreams

On this page

Back to top