request structure
The protocol uses a request-response structure. For every request, exactly one response is sent. Additionally, events may be generated by the server side, after the client has enabled them.
In general all the identifiers in the JSON blocks are self explaining.
RequestGeneral
- function - string - function to execute
- id - string or integer - identification assigned by client, used to route then answer
- data - object - functin-specific parameters, possibly empty
Response
- function - string - function executed
- id - string or integer - identification from request
- status - integer - execution status, see error values
Event
- event - string - event type
- data - object - event data
Example
in:
{
"function": "Some/Opcode",
"id": "some-text-or-number",
"data": {
"key1": "value1",
...
}
}
out:
{
"function": "Some/Opcode",
"id": "some-text-or-number",
"status": 0,
"data": {
"key1": "value1",
...
}
}
event:
{
"event": "SomeEvent",
"data": {
"key1": "value1",
...
}
}