Skip to content

Stream

Description

The stream module allows you to enable livestream data from a given device and service that supports it. Call the API to create a stream and receive updates via the websockets. For further information regarding the event structure check out the event section of this page.

Events

Following events are transmitted via the websocket.

The event that indicates that a livestream has been created. Only the user that created the livestream will receive this event. This event requires read access to the resource stream.

NameDescription
type
stringconstant
Constant value: CREATE_LIVESTREAM
serviceIdentifier
string
The service identifier for a service of the device. Can be seen as the interface name where services with the same identifier contain the same properties.
property
string
The property identifier. Either as hex 0x0000.TYPE formatted string or as the name for the property given by the schema
propertyIdentifier
integer
The id as number of the property
deviceIdentifier
string
The unique device identifier. Albeit being case insensitive, the upper case representation is used throughout the API.
expiresAt
integer
The utc timestamp (in milliseconds) when the open property stream will expire
user
string
The user name.
uuid
string
The uuid identifying a running open property stream

API

Create Stream

This endpoint creates a stream. Whenever this stream transmits data the data will be sent via the websocket as an event. Please refer to the event section of this topic.

POST
/api/v1/streams

Access

This endpoint requires create permission for the resource stream.

Request Body

NameDescription
serviceIdentifier
string
The service identifier for a service of the device. Can be seen as the interface name where services with the same identifier contain the same properties.
deviceIdentifier
string
The unique device identifier. Albeit being case insensitive, the upper case representation is used throughout the API.
property
string
The property identifier. Either as hex 0x0000.TYPE formatted string or as the name for the property given by the schema
expiresIn
integeroptional
The amount of milliseconds the property will be kept open without a refresh.
Default: 60000

Response

NameDescription
uuid
string
The uuid identifying a running open property stream
serviceIdentifier
string
The service identifier for a service of the device. Can be seen as the interface name where services with the same identifier contain the same properties.
deviceIdentifier
string
The unique device identifier. Albeit being case insensitive, the upper case representation is used throughout the API.
property
string
The property identifier. Either as hex 0x0000.TYPE formatted string or as the name for the property given by the schema
expiresAt
integer
The utc timestamp (in milliseconds) when the open property stream will expire

List Streams

Calling this endpoint will return all actives streams.

GET
/api/v1/streams

Access

This endpoint requires read permission for the resource stream.

Response

NameDescription
uuid
string
The uuid identifying a running open property stream
serviceIdentifier
string
The service identifier for a service of the device. Can be seen as the interface name where services with the same identifier contain the same properties.
deviceIdentifier
string
The unique device identifier. Albeit being case insensitive, the upper case representation is used throughout the API.
property
string
The property identifier. Either as hex 0x0000.TYPE formatted string or as the name for the property given by the schema
expiresAt
integer
The utc timestamp (in milliseconds) when the open property stream will expire

Refresh Stream

Call this endpoint to refresh a stream. Should a stream reach the expiresAt timestamp, the stream will be closed.

POST
/api/v1/streams/:stream_uuid

Access

This endpoint requires update permission for the resource stream.

URL Parameter

NameDescription
stream_uuid
string
The uuid identifying a running open property stream

Request Body

NameDescription
expiresIn
integeroptional
The amount of milliseconds the property will be kept open without a refresh.
Default: 60000

Response

NameDescription
uuid
string
The uuid identifying a running open property stream
serviceIdentifier
string
The service identifier for a service of the device. Can be seen as the interface name where services with the same identifier contain the same properties.
deviceIdentifier
string
The unique device identifier. Albeit being case insensitive, the upper case representation is used throughout the API.
property
string
The property identifier. Either as hex 0x0000.TYPE formatted string or as the name for the property given by the schema
expiresAt
integer
The utc timestamp (in milliseconds) when the open property stream will expire

Delete Stream

Deletes a streams and stops data transmission

DELETE
/api/v1/streams/:stream_uuid

Access

This endpoint requires delete permission for the resource stream.

URL Parameter

NameDescription
stream_uuid
string
The uuid identifying a running open property stream

Response

This endpoint simply returns Status 204 to indicate a successful operation and to save bandwidth.