SetForbidUserRule
https://rtc-api.zego.im/
Sets up user ban rules to ban specific users. After successful setup, you can query user ban rules or delete user ban rules.
Setting up user ban rules will not interrupt the user's ongoing Stream publishing, and will only take effect on the user's next Stream publishing request. To immediately ban the user's ongoing Stream publishing, you need to separately use set audio/video Stream ban rules, rather than user ban rules.
-
Assuming the user to be banned is user1, and not logged in to Room room1:
- When RuleType is 1 and DisabledPrivilege[] is 1, it indicates that the user corresponding to this IP address cannot log in to any Room.
- When RuleType is 2 and DisabledPrivilege[] is 1, it indicates that no user can log in to room1.
- When RuleType is 3 and DisabledPrivilege[] is 2, it indicates that user1 can log in to any Room normally, but cannot publish Streams in any Room.
- When RuleType is 4 and DisabledPrivilege[] is 2, it indicates that user1 can log in to room1 normally, but cannot publish Streams in room1.
-
Assuming the user to be banned is user1, and already logged in to Room room1, regardless of the RuleType value:
- When DisabledPrivilege[] is 1 or 1&2, user1 is still in room1 but cannot publish Streams normally, and you need to call the kick Room user out interface to kick the user out.
- When DisabledPrivilege[] is 2, user1 cannot publish Streams in room1.
Request
Query Parameters
- 1: Ban users by IP address, up to 100 rules can be set;
- 2: Ban users by RoomId, up to 200 rules can be set;
- 3: Ban users by UserId, up to 200 rules can be set;
- 4: Ban users by RoomId and UserId, up to 200 rules can be set.
Possible values: [SetForbidUserRule]
Interface prototype parameters
https://rtc-api.zego.im?Action=SetForbidUserRule
💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.
💡Common parameter. A 16-character hexadecimal random string (hex-encoded 8-byte random number). For the generation algorithm, refer to the signature example.
💡Common parameter. Current Unix timestamp in seconds. For the generation algorithm, refer to the signature example. A maximum deviation of 10 minutes is allowed.
💡Common parameter. Signature used to verify the legitimacy of the request. Please refer to the signature mechanism to generate it.
Possible values: [2.0]
Default value: 2.0
💡Public parameter. Signature version number.
Possible values: [1, 2, 3, 4]
Ban rule type:
The maximum number of rules that can be set refers to the number of rules that are valid at the same time, excluding expired rules.
If you do not need certain rules, please call the delete user ban rules interface in time to clean them up.
IP address. Required when RuleType is 1.
Room ID. Required when RuleType is 2 or 4.
User ID. Required when RuleType is 3 or 4.
Possible values: [1, 2], >= 1
Functions that banned users can use. 1: Login. 2: Publish Stream.
Possible values: >= 1 and <= 86400
Valid duration of the ban rule, unit: seconds, value range 1 ~ 86400 (1 day).
Responses
- 200
- application/json
