Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
documentation:api-http-websockets [2014-01-15 12:56] – [Command: unsubscribe] nkukard | documentation:api-http-websockets [2014-01-15 13:30] – [Command: subscribe] nkukard | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== HTTP WebSockets Interface ====== | ====== HTTP WebSockets Interface ====== | ||
+ | ===== JSON Encapsulation ===== | ||
+ | |||
+ | All JSON responses are encapsulated within a status structure. | ||
+ | |||
+ | Success: | ||
+ | < | ||
+ | { | ||
+ | status: ' | ||
+ | data: $data | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Errors: | ||
+ | < | ||
+ | { | ||
+ | status: ' | ||
+ | message: 'error string' | ||
+ | } | ||
+ | </ | ||
===== Command Interface ===== | ===== Command Interface ===== | ||
Line 20: | Line 39: | ||
==== Command: subscribe ==== | ==== Command: subscribe ==== | ||
- | The subscribe command subscribes a WebSocket to receive periodic statistical updates. The $tag value will be used while streaming statistics (see [[api-data-types# | + | The subscribe command subscribes a WebSocket to receive periodic statistical updates. The $tag value will be used while streaming statistics (see [[api-data-types# |
Command format: | Command format: |