Xentara WebSocket API Specification v2.0.3
User Manual
Check Access Command

Command

OpCodeNameDescription
15check_accessChecks access for the specified light-weight sub-session.

Parameters

The parameter object outlined in request packet for this command includes:

IDNameOptionalDescription
0sub_session_idnoA UUID representing the existing opened session, created using create sub session command. The UUID cannot be null.

Response

The response item outlined in response packet for this command includes:

Name Type Description
Access Object An object containing the read and write access details (see below).

The definition of access object is mentioned below:

IDNameDescription
0read_accessA boolean indicating the read access status of the given sub-session.
1write_accessA boolean indicating the write access status of the given sub-session.

If an error occurs, the response will include an error packet with detailed error information.

Errors

Below is the list of the potential errors that may be encountered with this command. Further details regarding errors in the Xentara WebSocket interface can be accessed here.

Sr. No. Error Code Error Description
1 -32700 Parse Error
2 -32603 Internal Error
3 -32602 Invalid Parameter
4 -32600 Invalid Request
5 -32001 Duplicate Client Hello Request

Examples

Request

Below is an example of a check access request, indicating the session ID of an already opened session created using the create session command. The message id 65 is an arbitrary number assigned for this particular request.

[
  0,                                            # Request Packet
  65,                                           # Message Id
  15,                                           # Check Access OpCode
  {                                             # Check Access Object
    0: 37('E3EE10714D884BA18E5D0F1E4CE25EE8')   # Opened Sub-Session Id
  }
]

Response

Below is an example of the successful response to the aforementioned request. It indicates a package type of 1, signifying a successful response. The provided Message ID is intended for matching with the corresponding request. The response consists of an object containing the read and write access status for the requested sub-session.

[
  1,                                        # Packet Type - Success Response
  65,                                       # Message Id
  {
    0: true,                                # Read access status for the sub-session.
    1: false,                               # Write access status for the sub-session.
  }
]