Xentara WebSocket API Specification v2.0.4
User Manual
|
This section outlines the guidelines for packaging and formatting messages for the Xentara WebSocket interface. The messages must and will be adhere to the following guidelines:
The following example demonstrates how to include multiple request packets in a single message and the corresponding responses:
Below is a request comprises of a lookup, a get stage, and a meta data command.
[ # Outer Array [ # Request Packet 1 0, # Request Packet 65, # Message Id 3, # Lookup OpCode { # Lookup Object 0: "Group 1.Data Point 1" # Primary Key of the Xentara Element } ], [ # Request Packet 2 0, # Request Packet 66, # Message Id 8 # Get Stage OpCode ], [ 0, # Request Packet 3 67, # Message Id 2, # Meta Data OpCode { # Meta Data Object 0: 37('E3EE10714D884BA18E5D0F1E4CE25EE8'), # Xentara Element UUID 1: [0,83] # Array of Meta Data identifiers } ] ]
The response to the aforementioned multiple request packet will adhere to the previously outlined guidelines and is presented below for reference. This format similarly applies to events, where multiple events are also combined in the same manner.
[ # Outer Array [ # Response Packet 1 1, # Packet Type - Success Response 65, # Message Id 37(h'E3EE10714D884BA18E5D0F1E4CE25EE8') # Xentara Element UUID ], [ # Response Packet 2 1, # Packet Type - Ok Response 66, # Message Id 2 # Operational Stage Xentara ], [ # Response Packet 3 2, # Packet Type - Error Response 67, # Message Id { 0: -32602, # Error Code 1: "invalid meta data identifier" # Error Message } ] ]