logo
On this page

Set user permissions


Description

Sets user permissions on a whiteboard.

  • If a user exits a room or goes offline, the user permissions will be cleared. When the user enters the room again, the user permissions need to be set again.
  • If the room to which a user belongs is destructed, the user permissions will be cleared.

Request method and endpoint

  • Request method: GET
  • Request endpoint: https://whiteboard-api.zego.im/?Action=SetWhiteboardUserAuth
  • Protocol: HTTPS
  • Rate limit: 50 requests/second (test environment: 1 request/second)

Request parameters

Listed below are the parameters specific to this request. For the complete list of public request parameters,see Accessing Server APIs - Public parameters.

ParameterTypeRequiredDescription
RoomIdStringYesRoom ID.
UserIdStringYesUser ID.
ModuleAuth[]Array of NumberYesOperation permissions on whiteboards. The value cannot be an empty array.
  • 0: no permission
  • 1: zooming
  • 2: scrolling
Example: ModuleAuth[]=1&ModuleAuth[]=2
GraphicAuth[]Array of NumberYesOperation permissions on diagram elements. The value cannot be an empty array.
  • 0: no permission
  • 2: modifying diagram elements created by other users
  • 4: erasing diagram elements created by other users
  • 8: moving diagram elements created by other users
  • 16: deleting all diagram elements
  • 32: creating diagram elements
Example: GraphicAuth[]=32&GraphicAuth[]=2

Sample request

Set the following user permissions:

  1. Zoom in or out on, scroll, and turn pages on the whiteboard.
  2. Create diagram elements and modify diagram elements created by others.
https://whiteboard-api.zego.im/?Action=SetWhiteboardUserAuth
&RoomId=RoomName
&UserId=jack
&ModuleAuth[]=1&ModuleAuth[]=2
&GraphicAuth[]=32&GraphicAuth[]=2
&<Public request parameters>

Response parameters

ParameterTypeDescription
CodeNumberReturn code.
MessageStringMessage.
RequestIdStringUnique request ID generated by ZEGO.

Sample response

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

Return codes

Listed below are the return codes related to this API. For the complete list of return codes, see Return codes.

Return codeDescription
120000001Signature authentication failed.
120000002Incorrect input parameters.
120000101Failed to set user permissions.
120000105An empty array is entered for operation permissions.
120000106Invalid values are set for the operation permissions.
120000201The user does not exist.

Previous

Set room permissions

Next

Query room permissions

On this page

Back to top