Skip to content

Instantly share code, notes, and snippets.

@bjyurkovich
Created February 22, 2019 17:42
Show Gist options
  • Select an option

  • Save bjyurkovich/ac18b6b2c47e0f6f8c99076a5c30aee5 to your computer and use it in GitHub Desktop.

Select an option

Save bjyurkovich/ac18b6b2c47e0f6f8c99076a5c30aee5 to your computer and use it in GitHub Desktop.
Creating Data

Create a Data Record with Alert

Posts data and alerts to the cloud

Access Pattern

API domain: Device/Data Intended for Embedded Superuser privilege required: false

HTTP POST /v1/embedded/networks/5c700a69ab0abf929ce22c08/hubs/5c700a66ab0abf929ce22bfd/data
Content-Type: application/json
Authorization: Basic base64(HUB-0-key:hub-secret)
{
    "hubId": "5c700a66ab0abf929ce22bfd",
    "data": [
        {
            "puckId": "5c700a68ab0abf929ce22c03",
            "deviceTypeId": "5908bf9f12ca6430e2000001",
            "timestamp": 1550846583,
            "voltage": 1,
            "timeOn": 5
        }
    ],
    "alerts": [
        {
            "puckId": "5c700b24b8a615029b000019",
            "alertUuid": "01b2cc60-7890-4c2b-b498-dd3cda01370c",
            "timestamp": 1550846583
        }
    ]
}

Expected Response

HTTP 200
{
    "status": "success",
    "activeAlerts": [
        {
            "id": "5c700a77ab0abf929ce22c13",
            "uuid": "01b2cc60-7890-4c2b-b498-dd3cda01370c",
            "puckId": "5c700a68ab0abf929ce22c03",
            "hubId": "5c700a66ab0abf929ce22bfd",
            "networkId": "5c700a69ab0abf929ce22c08"
        }
    ],
    "commands": null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment