Xentara WebSocket API Specification v2.0.4
User Manual
Read Command

Command

OpCodeNameDescription
4readReads the value of attributes of a Xentara Element.

Parameters

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

IDNameOptionalDescription
0element_uuidnoA UUID specifying the UUID of the Xentara element.
1attribute_idsnoAn array consisting of integers, UUIDs, or a combination of both, containing values from the attribute identifier or the attribute UUID.

Response

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

Name Type Description
Read Object Object A UUID specifying the UUID of the Xentara element in format of UUIDs.

The read object contains the requested attribute identifiers or attribute UUIDs as keys, paired with their respective values. In case of an error, there won't be a specific error response. Instead, the error is indicated using an alternative data tag. In the response, successful values are enclosed with Tag 121 (alternative 0), while error values are enclosed with Tag 122 (alternative 1) for clarity.

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 -32000 Missing Client Hello Request
6 -32100 Unknown Element
7 -32101 Missing Attribute
8 -32102 Access Denied
9 -32103 Write Only
10 -32106 Type Mismatch
11 -32109 Read Error

Examples

Request

Below is an example of a request to read the values of attributes, represented as attribute identifiers, for the element with the UUID "e3ee1071-4d88-4ba1-8e5d-0f1e4ce25ee8". The message id 65 is an arbitrary number assigned for this particular request.

[
  0,                                                     # Request Packet
  65,                                                    # Message Id
  4,                                                     # Read OpCode
  {                                                      # Read Object
    0: 37('E3EE10714D884BA18E5D0F1E4CE25EE8'),           # Xentara Element UUID
    1: [1,11,37('88130CE8B9E74A2A8F26D32A931129AA')]     # Array of Attribute Identifiers
  }
]

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 includes an object containing the attribute identifiers or attribute UUIDs of the requested Xentara element, and their respective values. In this response, it is observed that the attribute identifier with UUID "88130CE8-B9E7-4A2A-8F26-D32A931129AA" does not exist for the Xentara element mentioned in the request, resulting in an error for the attribute. The result is wrapped in an alternative enumeration tag value of 122. For another attribute identifiers, the attributes exists, so it's value is encapsulated with an alternative enumeration tag value of 121.

[
  1,                                                          # Packet Type - Success Response
  65,                                                         # Message Id
  {                                                           # Read Response Object
    1: 121("register"),                                       # Xentara Element Type
    11: 121(true),                                            # Xentara Element Value
    37('88130CE8B9E74A2A8F26D32A931129AA'):                   
       122({0: -32101, 1: "missing attribute"})               # Missing Attribute Error
  }
]