Hyper – Device Messages API v3

This document contains an overview of the Hyper Device Messages API that can be used to publish device messages.

Device Messages - Incoming

Authorization

All of the requests to the API must contain a valid authorization token. New API tokens can be generated in the dashboard.

Header Value

Authorization

Bearer $access_token

Publish device messages

The following endpoint can be used to publish device messages:

POST /sites/{site}/device_messages/v3/incoming

Payload schema

[
  {
    "message_uuid":  string,
    "created_time": string,
    "vendor_device_id": string,
    "device_class_id": int,
    "values": { "$attribute_slot": any }
  }
]

The values field contains an object with attribute values indexed by their attribute slot. The type of each value depends on the device schema.

Examples

The following example request publishes device attribute values using cURL. The payload is loaded from the messages.json` file.

$ cat messages.json
[
  {
    "message_uuid": "6b16340e-a43d-404e-b115-b236ca9273fe",
    "created_time": "2023-04-20T14:17:51Z",
    "vendor_device_id": "DE:AD:BE:EF:FF:00",
    "device_class_id": 12,
    "values": {
        "5": 1000
    }
  },
  {
    "message_uuid": "3d92282f-5fcf-465d-b617-0ccffe119d57",
    "created_time": "2023-04-20T15:42:32Z",
    "vendor_device_id": "00:11:22:33:44:55",
    "device_class_id": 451,
    "values": {
        "0": 42,
        "1": 3.14
    }
  },
]
$ curl -H "Authorization: Bearer ${access_token}" -X POST -d @messages.json "https://${organization_name}.hyper.systems/api/sites/1/device_messages/v3/incoming"