post
https://entry.xyte.io/v1/devices-1
Register multiple devices in a single API call.
For an overview of this process, please first go over the Registration page in the Quickstart guide, and the Authentication Overview section.
Currently a maximum of 25 devices can be registered on each call.
Request
The multiple registration request is sent as an array in the request body, below the detailed fields to be sent for each device:
Data for each registered device in the array
| Name | Type | Required | Description |
|---|---|---|---|
| mac | string | See description | MAC address (optional unless authentication method is MAC&SN). Required for mac&sn authentication method |
| sn | string | Yes | Serial number - Has to be unique for devices from the same model |
| cloud_id | String | See description | GUID for the device prepended with a short code assigned to each manufacturer. More details here. Required for cloud_id authentication method |
| firmware_version | string | Yes | The current version of the firmware on the device. served as the base version for the device. |
| hardware_key | string | Yes | Unique key for each batch of manufactured devices.for each model. |
| name | string | Default friendly name for the device (can be changed later in the UI of the organization) | |
| details | object | Object containing any custom internal device details. | |
| sub_model | string | Sub-model name for differentiating similar devices. More details here. | |
| parent_id | uuid | UUID of a registered parent device for Application Devices. | |
| custom_partner_name | string | For cloud-to-cloud implementations, allow overriding the Partner name. | |
| custom_model_name | string | For cloud-to-cloud implementations, allow overriding the Model name. |
Request Sample
[
{
"hardware_key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
"cloud_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
"mac": "11:22:33:44:55:66",
"sn": "100",
"firmware_version": "1.0.1",
"name": "test device"
},
{
"hardware_key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
"cloud_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
"mac": "11:22:33:44:55:77",
"sn": "101",
"firmware_version": "1.0.1",
"name": "sample device"
}
]Response
An array matching the original request array, with each cell containing either the details of the newly created device or an error.
Data on successful registration
| Name | Type | Description |
|---|---|---|
| id | string | Unique ID for this device. Must be saved and used for all future API access |
| access_key | string | Unique access key for this device. Must be saved and used for all future API access |
| hub_url | string | URL of the hub server assigned to this device. |
| hub_url_static_cert | string | URL of the hub server assigned to this device that supports custom SSL certificates |
| mqtt_hub_url | string | For MQTT based devices. |
Data on error
| Name | Type | Description |
|---|---|---|
| error | string | The error that prevented this device from being registered. |
Response sample
[
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
"access_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"hub_url": "https://us-1.endpoints.xyte.io",
"hub_url_static_cert": "https://us-1.cssl.endpoints.xyte.io",
"mqtt_hub_url": "mqtt://mqtt-us-1.endpoints.xyte.io:15582"
},
{
"error": "Hardware key is invalid"
}
]