Documentation
WhiteBoard Collaborative Whiteboard
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • Collaborative Whiteboard
  • Server APIs
  • Set Whiteboard Permissions of a User

Set Whiteboard Permissions of a User

Last updated:2021-04-25 20:24

1 Description

Call this interface to set the user's whiteboard authority.

  • If the user exits the room or is disconnected, the user authority will be cleared. The user will log in to the same room next time. If you want to use the user authority function, you need to set the user authority again.
  • The room where the user is located is destroyed, and the user's permissions will also be cleared.

Call frequency limit:

  • Formal environment: 50 times/sec
  • Test environment: 1 time/sec

2 Request Method and Endpoint

  • Request method: GET
  • Request endpoint: https://whiteboard-api.zego.im/?Action=SetWhiteboardUserAuth
  • Transmission protocol: HTTPS

3 Request Parameters

The following request parameter list only lists the interface request parameters. For the list of public parameters, please refer to API Call Method - Public Request Parameters.

Parameters Type Required Description
RoomId String Yes The room ID that needs to be set.
UserId String Yes The user ID that needs to be set.
ModuleAuth[] Array of Number Yes A set of whiteboard operation permissions, no empty array is allowed.
  • 0: No permission
  • 1: Allow zooming of the whiteboard
  • 2: Allow scrolling of the whiteboard
Example: ModuleAuth[]=1&ModuleAuth[ ]=2
GraphicAuth[] Array of Number Yes Graphic element operation permission collection, it is not allowed to pass empty array.
  • 0: No operation authority
  • 2: Allow to modify the primitives created by others
  • 4: Allow to erase the primitives created by others
  • 8: Allow to move the graphic elements created by others
  • 16: Allow to clear the graphic elements
  • 32: Allow to create the graphic elements
Example: GraphicAuth[]=32&GraphicAuth[]=2

4 Request Example

The following is an example of a request for the user authority interface. Only the interface request parameters are listed in the request example. For public request parameters, please refer to the request example in API Call Method - Public Request Parameters.

Set user permissions as:

  1. The whiteboard can be zoomed and scrolled.
  2. You can create graphic elements and modify other people’s graphic elements.
https://whiteboard-api.zego.im/?Action=SetWhiteboardUserAuth
&RoomId=RoomName
&UserId=jack
&ModuleAuth[]=1&ModuleAuth[]=2
&GraphicAuth[]=32&GraphicAuth[]=2
&<Public request parameters>

5 Response Parameters

Parameters Type Description
Code Number Return code.
Message String Details.
RequestId String Unique request ID generated by ZEGO.

6 Response Example

{
    "Code":0,
    "Message":"SUCCESS",
    "RequestId":"2237080460466033406"
}

7 Return Code

Return code Description
0 The request was successful.
120000001 Signature authentication failed.
120000002 The input parameter is incorrect.
120000101 Failed to set user permissions.
120000105 The permission set passed an empty array and failed.
120000106 An illegal permission number is set in the permission set.
120000201 The user does not exist.
Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code