Skip to main content

Telemetry stream HTTP API

Answered

Comments

2 comments

  • Official comment
    Marcin Kacik

    Hello Bernard Shakey,

    Instead of MQTT, we introduced AppsAPI that can be used with our new PortalLights.

    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
    }

     

    SAMPLE CURL REQUEST(streams, similar to MQTT)
    $ curl 'https://apps-api.prod.kontakt.io:443/v3/streams/telemetry' -i -X GET \
    -H 'Api-Key: <<Your Api Key>>'
    SAMPLE HTTP REQUEST(streams, similar to MQTT)
    GET /v3/streams/telemetry HTTP/1.1 Host: apps-api.prod.kontakt.io:443 Api-Key: <<Your Api Key>>
    SAMPLE CURL REQUEST(REST_API)
    $ curl 'https://apps-api.prod.kontakt.io/v2/positions?page=0&size=20&sort=floorId,desc&floorId=515162&locationId=3121350&lost=true' -i -X GET \     -H 'Api-Key: <<Your Api Key>>'

    Streams are much better but need to be configured with Kinesis or similar real-time data streaming service.
    Simple request-response API is useful when you only need to refresh data with significant latency.

    * There are other requests like Create Stream Configuration, Get Configurations, etc. I am not sure if we need to use those to set the configuration first?


    Yes, you need them at first to set up configuration. But like I mentioned, you need to look for real-time data streaming services like AWS Kinesis or Azure EventHub.

    Is there a fee or a subscription for access to the new “AppsAPI” as well?

    Your current account allows you to use our new AppsAPI. But using AWS Kinesis or Azure EventHub is paid.

    Basic documentation for Apps-API is now a part of our developer portal here: https://developer.kontakt.io/backend/locationservices/introduction/.

     

  • Chun Jye Beh

    Hello, I am trying to get the stream telemetrry data using the command 

    $ curl 'https://apps-api.prod.kontakt.io:443/v3/streams/telemetry' -i -X GET \
    -H 'Api-Key: <<Your Api Key>>'
    However, I only get header information but no telemetry data.
    HTTP/2 200 
    date: Tue, 02 Feb 2021 01:26:55 GMT
    content-type: application/json
    set-cookie: AWSALB=vTlRDT2o/gYKmlKLmWODrowedSKd3dAAUFRjFJ+FA74I6nhDW31CU0qiUv0wJRPCGBQMi+9ysi4NJ1nSC1hSll7jOhhu4HLVwRdGavIelERPHiQNcuAf2oB0PzWY; Expires=Tue, 09 Feb 2021 01:26:55 GMT; Path=/
    set-cookie: AWSALBCORS=vTlRDT2o/gYKmlKLmWODrowedSKd3dAAUFRjFJ+FA74I6nhDW31CU0qiUv0wJRPCGBQMi+9ysi4NJ1nSC1hSll7jOhhu4HLVwRdGavIelERPHiQNcuAf2oB0PzWY; Expires=Tue, 09 Feb 2021 01:26:55 GMT; Path=/; SameSite=None; Secure
    vary: Origin
    vary: Access-Control-Request-Method
    vary: Access-Control-Request-Headers
    strict-transport-security: max-age=15768000 ; includeSubDomains
    set-cookie: JSESSIONID=C02C368AF1FCC29622A22BEFAF3B194C; Path=/; Secure; HttpOnly
    set-cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Mon, 01-Feb-2021 01:26:55 GMT

    []

    I have set the tag to broadcast telemetry data in the Wedpanel. May I know how to solve it?

    0

Please sign in to leave a comment.