Streaming API request parameters

<< Click to Display Table of Contents >>

Navigation:  The API > JSON API > Real Time Communication > From Gateway to Client: Streaming API >

Streaming API request parameters

GET /devices/stream

The streaming API has several parameter that influence which information and how the information is transported to the client.

direction:

 

from

to

both (default parameter)

 

from

This parameter lets the gateway send you all messages over the stream that are coming from the devices. Messages that have been sent to the devices will not show up.

to

This parameter lets the gateway send you all messages over the stream that are being sent to the devices. Messages that are coming from the devices will not show up. Normally, these messages are the ones that have been issued by yourself if only one client is connected. When more than one client is connected to the gateway, then this stream shows the messages that have been sent to the devices from all controllers - including the ones which are coming from your client.

both

This parameter lets the gateway send you all messages over the stream that are coming from or going to the devices. These are all events.

 

delimited:

 

length

lengthBytes

lenghtCharacters

newLine (default parameter)

emptyLine

 

length

Every JSON Object is announced by its length in bytes followed by a CR/LF. (identical to "lengthBytes" because of conformity to popular APIs)

lengthBytes

Every JSON Object is announced by its length in bytes followed by a CR/LF.

lenghtCharacters

Every JSON Object is announced by its length in Characters followed by a CR/LF. (The codepage of stream is in UTF-8. Characters and bytes can differ)

newLine

Every JSON Object is separated from the next Object by a CR/LF. (Output can not be formatted)

emptyLine

Every JSON Object is separated from the next Object by a CR/LF/CR/LF.

 

output:

 

formatted

singleLine

 

formatted

The JSON Object is formatted nicely, so that it can be read by humans easily. Has no effect if combined with newLine

singleLine

The JSON Object is given out on a single line.

 

Examples

GET /devices/stream?direction=both&delimited=emptyLine&output=formatted (default)

GET /devices/stream?direction=both&delimited=emptyLine&output=singleLine

GET /devices/stream?direction=both&delimited=lengthCharacters&output=formatted

GET /devices/stream?direction=to&delimited=lengthBytes&output=singleLine