Overview
Every API request made by devices to the server (except the Register Device and Register Child Device APIs) must authenticate with an unique private authentication key the device must store in its internal persistent storage.
The following Headers must be set:
Header | Value |
---|---|
Authorization | The access_key that is returned by the provisioning server https://entry.xyte.io/v1/devices as a response to Register Device or Register Child Device. |
Example
Given the following parameters returned during a Register Device API:
Field | Value |
---|---|
id | d8083a34-22c8-4cd8-9acb-1912... |
access_key | 2300742898f3ddc0e62e087ddc4a368c |
hub_url | https://eu-1.endpoints.xyte.io |
In this example all API calls should:
- Use https://eu-1.endpoints.xyte.io as the base URL
- Use the
id
as the "Device's ID" - Add the following header to all requests:
Authorization: 2300742898f3ddc0e62e087ddc4a368c
Sample Send Telemetry call:
curl https://eu-1.endpoints.xyte.io/v1/devices/d8083a34-22c8-4cd8-9acb-1912.../telemetry \
-H "Content-Type: application/json" \
-H "Authorization: 2300742898f3ddc0e62e087ddc4a368c" \
-X POST \
--data '{"status":"online","telemetries":{"fan_speed":5.5,"temp":30,"input":"hdmi"}}'