Skip to content

Streams Configuration

This resource allows you to get, create, update, and delete configured streams.

The configured streams contain processed telemetry and positions data. For both data types, you can set access to the configured streams, so that the data is processed by the back end.

Telemetry data model

Data with this structure will be sent to configured stream, whenever new telemetry is received by our cloud. All fields are optional, excluding companyId, userId, sourceId, sourceType, trackingId and rssi. All optional fields will be shown only on beacons with specific telemetry fields turned on.

{
    "companyId": "abcdef",
    "userId": "abcdef",
    "sourceId": "abcdef",
    "sourceType": "abcdef",
    "trackingId": "abcdef",
    "rssi": -77,
    "timestamp": "2020-06-26T13:37:00Z",
    "beaconTimestamp": 1600000000,
    "batteryLevel": 100,
    "accelerometerSensitivity": 16,
    "accelerometerX": 0,
    "accelerometerY": 64,
    "accelerometerZ": 10,
    "timeSinceTap": 65535,
    "timeSinceMovement": 30000,
    "movementCounter": 10,
    "lightIntensity": 100,
    "temperature": 15.75,
    "timeSinceClick": 65535,
    "clickCounter": 0,
    "humidity": 50
}
Field Type Description
companyId String The ID of the user’s company. You can only view positions with your company ID.
userId String The id of the user.
sourceId String Unique ID of scanning device that received telemetry packet.
sourceType String Type of scanning device that received telemetry packet.
trackingId String Tracking ID of device that advertised telemetry packet. In most cases it is equal to lowercase MAC address of the device.
rssi Number Received Signal Strength Indicator of received telemetry packet
timestamp String ISO 8601 timestamp of the moment, telemetry packet was received by the cloud
beaconTimestamp Number UNIX timestamp in seconds from beacon
batteryLevel Number Battery level in percent.
accelerometerSensitivity Number Sensitivity of accelerometer with unit of mg/unit
accelerometerX Number Last accelerometer reading on X-axis
accelerometerY Number Last accelerometer reading on Y-axis
accelerometerZ Number Last accelerometer reading on Z-axis
timeSinceTap Number Time in seconds from last "tap" event
timeSinceMovement Number Time in seconds from last detected device movement
movementCounter Number Counter that is increased once every movement is detected. Resets at 255 -> 0.
lightIntensity Number Intensity of light received by light sensor in percent.
temperature Number Temperature in Celsius Degrees
timeSinceClick Number Time in seconds from last button click.
clickCounter Number Counter that is increased on every button click. Resets at 255 -> 0.
humidity Number Detected humidity in % RH

Positions data model

Data with this structure will be sent to configured stream, whenever position of a device changes. All fields are optional, excluding companyId, userId, trackingId, floorId.

{
    "companyId": "abcdef",
    "userId": "abcdef",
    "trackingId": "abcdef",
    "locationId": 771,
    "floorId": 772,
    "zoneId": 773,
    "x": 12.25,
    "y": 12.25,
    "z": 12.25,
    "xe": 12.25,
    "ye": 12.25,
    "ze": 12.25,
    "q": 12.25,
    "origin": "locationEngine",
    "lost": false
}
Field Type Description
companyId String The ID of the user’s company. You can only view positions with your company ID.
userId String The id of the user.
trackingId String Tracking ID of device that advertised telemetry packet. In most cases it is equal to lowercase MAC address of the device.
locationId Number ID of location in which device was located.
floorId Number ID of floor in which device was located.
zoneId Number ID of zone in which device was located.
x Number The x-axis value of the device coordinates. Value in meters.
y Number The y-axis value of the device coordinates. Value in meters.
z Number The z-axis value of the device coordinates. Value in meters.
xe Number The error in the x-axis value. Calculated in meters.
ye Number The error in the y-axis value. Calculated in meters.
ze Number The error in the z-axis value. Calculated in meters.
q Number Quality of position found in range, value between 0 and 1.
origin String The origin of the position.
lost Boolean Flag showing, whether the device is currently out of range.

Get configurations

GET /v3/streams/{data type} - retrieve all configured streams for a specified data type.

Path parameters
Parameter Description
data type The type of configured data. Possible values are: positions, telemetry
Sample curl request
$ curl 'https://apps-api.prod.kontakt.io:443/v3/streams/telemetry' -i -X GET \
    -H 'Api-Key: <<Your Api Key>>'
Sample HTTP request
GET /v3/streams/telemetry HTTP/1.1
Host: apps-api.prod.kontakt.io:443
Api-Key: <<Your Api Key>>
Sample response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 558

[ {
  "enabled" : false,
  "type" : "telemetry",
  "kinesis" : {
    "endpoint" : "ZuWxuTwthnWILdq",
    "streamName" : "VjxreJADZD",
    "region" : "cVnIiWVrGFFKxol",
    "forcedPartitionKey" : "BpLeAXpXZT"
  },
  "eventHub" : {
    "endpoint" : "XaFbElhbyZKrRWP",
    "sharedAccessKeyName" : "sZbnOgvBylIjsYi",
    "eventHubName" : "fnAyclVmuCfnSVy"
  }
} ]
Parameter Type Description
[].enabled Boolean Allows to pause the stream.
[].type String The type of the stream.
The possible values are: position, telemetry.
[].kinesis Object The Kinesis destination for the stream.
[].kinesis.endpoint String The Kinesis endpoint.
[].kinesis.streamName String The name of the stream.
[].kinesis.region String The AWS region of chosen stream.
[].kinesis.forcedPartitionKey String The forced partition key. By default, trackingId is used as a partition key. It can be overriden to some constant value using this parameter.
[].eventHub Object The Azure Event Hubs destination for the stream.
[].eventHub.endpoint String The event hub endpoint.
The format of the endpoint: sb://.servicebus.windows.net/
[].eventHub.sharedAccessKeyName String The name of the shared access key.
[].eventHub.eventHubName String The name of the event hub.

Create stream configuration

PUT /v3/streams/{data type} - Create configured stream for a specified data type.

Path parameters
Parameter Description
data type The type of configured data. Possible values are: positions, telemetry
Request body fields
Field Type Description
enabled Boolean Allows to pause the stream.
kinesis Object The Kinesis destination for the stream.
kinesis.endpoint String The Kinesis endpoint.
kinesis.accessKey String The Kinesis access key.
kinesis.secretKey String The Kinesis secret key.
kinesis.streamName String The name of the stream.
kinesis.region String The region.
kinesis.forcedPartitionKey String The forced partition key. By default, trackingId is used as a partition key. It can be overriden to some constant value using this parameter.
eventHub Object The Azure Event Hubs destination for the stream.
eventHub.endpoint String The event hub endpoint.
The format of the endpoint: sb://.servicebus.windows.net/
eventHub.sharedAccessKeyName String The name of the shared access key.
eventHub.sharedAccessKey String The shared access key.
eventHub.eventHubName String The name of the event hub.
Sample curl request
$ curl 'https://apps-api.prod.kontakt.io:443/v3/streams/telemetry' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Api-Key: <<Your Api Key>>' \
    -d '{
  "enabled" : false,
  "kinesis" : {
    "endpoint" : "cXalDLXfPSAROWf",
    "streamName" : "TuEdWliggx",
    "accessKey" : "iEvZBTnkfOmJbhwzoljj",
    "secretKey" : "rsXatFOIQhJYSdscIEhn",
    "region" : "pINaFoNTaIktcap",
    "forcedPartitionKey" : "qsXervqACM"
  },
  "eventHub" : {
    "endpoint" : "VIveoYFslWvqoQx",
    "sharedAccessKeyName" : "YXvRAynvyHFldLK",
    "sharedAccessKey" : "vyHYKMlukgjDirFImZihOOoCSiaYhD",
    "eventHubName" : "KCbjyIsBxcKepmN"
  }
}'
Sample HTTP request
PUT /v3/streams/telemetry HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 696
Host: apps-api.prod.kontakt.io:443
Api-Key: <<Your Api Key>>

{
  "enabled" : false,
  "kinesis" : {
    "endpoint" : "cXalDLXfPSAROWf",
    "streamName" : "TuEdWliggx",
    "accessKey" : "iEvZBTnkfOmJbhwzoljj",
    "secretKey" : "rsXatFOIQhJYSdscIEhn",
    "region" : "pINaFoNTaIktcap",
    "forcedPartitionKey" : "qsXervqACM"
  },
  "eventHub" : {
    "endpoint" : "VIveoYFslWvqoQx",
    "sharedAccessKeyName" : "YXvRAynvyHFldLK",
    "sharedAccessKey" : "vyHYKMlukgjDirFImZihOOoCSiaYhD",
    "eventHubName" : "KCbjyIsBxcKepmN"
  }
}
HTTP Response
HTTP/1.1 204 No Content

Update stream configuration

PATCH /v3/streams/{data type} - Partially update a configured stream for a specified data type.

Path parameters
Parameter Description
data type The type of configured data. Possible values are: positions, telemetry
Request body fields
Field Type Description
enabled Boolean Allows to pause the stream.
kinesis Object The Kinesis destination for the stream.
kinesis.endpoint String The Kinesis endpoint.
kinesis.accessKey String The Kinesis access key.
kinesis.secretKey String The Kinesis secret key.
kinesis.streamName String The name of the stream.
kinesis.region String The region.
kinesis.forcedPartitionKey String The forced partition key. By default, trackingId is used as a partition key. It can be overriden to some constant value using this parameter.
eventHub Object The Azure Event Hubs destination for the stream.
eventHub.endpoint String The event hub endpoint.
The format of the endpoint: sb://.servicebus.windows.net/
eventHub.sharedAccessKeyName String The name of the shared access key.
eventHub.sharedAccessKey String The shared access key.
eventHub.eventHubName String The name of the event hub.
Sample curl request
$ curl 'https://apps-api.prod.kontakt.io:443/v3/streams/telemetry' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Api-Key: <<Your Api Key>>' \
    -d '{
  "enabled" : false
}'
Sample HTTP request
PATCH /v3/streams/telemetry HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 696
Host: apps-api.prod.kontakt.io:443
Api-Key: <<Your Api Key>>

{
  "enabled" : false
}
HTTP Response
HTTP/1.1 204 No Content

Delete stream configuration

DELETE /v3/streams/{data type} - Remove a configured stream for a specified data type.

Path parameters
Parameter Description
data type The type of configured data. Possible values are: positions, telemetry
Sample curl request
$ curl 'https://apps-api.prod.kontakt.io:443/v3/streams/telemetry' -i -X DELETE \
    -H 'Api-Key: <<Your Api Key>>'
Sample HTTP request
DELETE /v3/streams/telemetry HTTP/1.1
Host: apps-api.prod.kontakt.io:443
Api-Key: <<Your Api Key>>
HTTP Response
HTTP/1.1 204 No Content