-
Notifications
You must be signed in to change notification settings - Fork 140
How to use
The DeviceHive Server is the central part of the framework which allows different components to interact with each other. The API provides access to information about registered components in the system, and allows them to exchange messages in real time.
- Metadata
- Operational Data
DeviceHive Metadata is the information about users, networks of devices, and the specific devices within these networks. This data can be accessed and modified via the REST api.
Represents a user with credentials and API access rights (client or administrator). Administrators automatically have all possible API access rights.
Method | Authorization | Uri |
---|---|---|
list | ManageUser | GET /user |
get | GetCurrentUser | GET /user/{id} |
insert | ManageUser | POST /user |
update | UpdateCurrentUser | PUT /user/{id} |
delete | ManageUser | DELETE /user/{id} |
getCurrent | GetCurrentUser | GET /user/current |
updateCurrentUser | UpdateCurrentUser | PUT /user/current |
getNetwork | ManageUser | GET /user/{id}/network/{networkId} |
assignNetwork | ManageUser | PUT /user/{id}/network/{networkId} |
unassignNetwork | ManageUser | DELETE /user/{id}/network/{networkId} |
Name | Description | Schema |
---|---|---|
admin optional |
Default : false
|
boolean |
data optional |
JsonStringWrapper | |
id optional |
integer (int64) | |
lastLogin optional |
string (date-time) | |
login required |
Length : 1 - 128
|
string |
loginAttempts optional |
integer (int32) | |
passwordHash optional |
string | |
passwordSalt optional |
string | |
role optional |
enum (ADMIN, CLIENT) | |
status optional |
enum (ACTIVE, LOCKED_OUT, DISABLED, DELETED) |
POST /user
Creates new user.
Type | Name | Description | Schema |
---|---|---|---|
Body |
body required |
User body | User |
HTTP Code | Description | Schema |
---|---|---|
201 | If successful, this method returns a User resource in the response body. | User |
400 | If request is malformed | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
application/json
application/json
GET /user
Gets list of users.
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Query |
login optional |
Filter by user login. | string | |
Query |
loginPattern optional |
Filter by user login pattern. | string | |
Query |
role optional |
Filter by user role. 0 is Administrator, 1 is Client. | integer (int32) | |
Query |
skip optional |
Number of records to skip from the result list. | integer (int32) | 0 |
Query |
sortField optional |
Result list sort field. | enum (ID, Login) | |
Query |
sortOrder optional |
Result list sort order. Available values are ASC and DESC. | enum (ASC, DESC) | |
Query |
status optional |
Filter by user status. 0 is Active, 1 is Locked Out, 2 is Disabled. | integer (int32) | |
Query |
take optional |
Number of records to take from the result list. | integer (int32) | 20 |
HTTP Code | Description | Schema |
---|---|---|
200 | If successful, this method returns array of User resources in the response body. | < User > array |
400 | If request parameters invalid | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
application/json
application/json
GET /user/current
Get information about the current user.
HTTP Code | Description | Schema |
---|---|---|
200 | If successful, this method returns a User resource in the response body. | User |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
409 | If user is not signed in | No Content |
application/json
application/json
PUT /user/current
Updates an existing user. Only administrators are allowed to update any property of any user. User-level accounts can only change their own password in case:
- They already have a password.
- They provide a valid current password in the 'oldPassword' property.
Type | Name | Description | Schema |
---|---|---|---|
Body |
body required |
User body | User |
HTTP Code | Description | Schema |
---|---|---|
204 | If successful, this method returns an empty response body. | No Content |
400 | If request is malformed | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
application/json
application/json
GET /user/{id}
Gets information about user and its assigned networks. Only administrators are allowed to get information about any user. User-level accounts can only retrieve information about themselves.
Type | Name | Description | Schema |
---|---|---|---|
Path |
id required |
User identifier. | integer (int64) |
HTTP Code | Description | Schema |
---|---|---|
200 | If successful, this method returns a User resource in the response body. | User |
400 | If request is malformed | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
404 | If user is not found | No Content |
application/json
application/json
PUT /user/{id}
Type | Name | Description | Schema |
---|---|---|---|
Path |
id required |
User identifier. | integer (int64) |
Body |
body required |
User body | User |
HTTP Code | Description | Schema |
---|---|---|
404 | If user not found | No Content |
application/json
application/json
DELETE /user/{id}
Deletes an existing user.
Type | Name | Description | Schema |
---|---|---|---|
Path |
id required |
User identifier. | integer (int64) |
HTTP Code | Description | Schema |
---|---|---|
204 | If successful, this method returns an empty response body. | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
404 | If access key is not found | No Content |
application/json
application/json
GET /user/{id}/network/{networkId}
Gets information about user/network association.
Type | Name | Description | Schema |
---|---|---|---|
Path |
id required |
User identifier. | integer (int64) |
Path |
networkId required |
Network identifier. | integer (int64) |
HTTP Code | Description | Schema |
---|---|---|
200 | If successful, this method returns a Network resource in the response body. | Network |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
404 | If user or network not found | No Content |
application/json
application/json
PUT /user/{id}/network/{networkId}
Associates network with the user.
Type | Name | Description | Schema |
---|---|---|---|
Path |
id required |
User identifier. | integer (int64) |
Path |
networkId required |
Network identifier. | integer (int64) |
HTTP Code | Description | Schema |
---|---|---|
204 | If successful, this method returns an empty response body. | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
404 | If user or network not found | No Content |
application/json
application/json
DELETE /user/{id}/network/{networkId}
Removes association between network and user.
Type | Name | Description | Schema |
---|---|---|---|
Path |
id required |
User identifier. | integer (int64) |
Path |
networkId required |
Network identifier. | integer (int64) |
HTTP Code | Description | Schema |
---|---|---|
204 | If successful, this method returns an empty response body. | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
404 | If user or network not found. | No Content |
application/json
application/json
Represents an isolation entity that encapsulates multiple devices with controlled access.
Method | Authorization | Uri |
---|---|---|
list | GetNetwork | GET /network |
get | GetNetwork | GET /network/{id} |
insert | ManageNetwork | POST /network |
update | ManageNetwork | PUT /network/{id} |
delete | ManageNetwork | DELETE /network/{id} |
name | value |
---|---|
id | (integer, optional) |
key | (string, optional) |
name | (string) |
description | (string, optional) |
entityVersion | (integer, optional) |
POST /network
Creates new device network.
Type | Name | Description | Schema |
---|---|---|---|
Body |
body required |
Network body | Network |
HTTP Code | Description | Schema |
---|---|---|
201 | If successful, this method returns a Network resource in the response body. | Network |
400 | If request is malformed | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
application/json
GET /network
Gets list of device networks the client has access to.
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Query |
name optional |
Filter by network name. | string | |
Query |
namePattern optional |
Filter by network name pattern. | string | |
Query |
skip optional |
Number of records to skip from the result list. | integer (int32) | 0 |
Query |
sortField optional |
Result list sort field. | enum (ID, Name) | |
Query |
sortOrder optional |
Result list sort order. | enum (ASC, DESC) | |
Query |
take optional |
Number of records to take from the result list. | integer (int32) | 20 |
HTTP Code | Description | Schema |
---|---|---|
200 | If successful, this method returns array of Network resources in the response body. | < Network > array |
400 | If request parameters invalid | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
application/json
GET /network/{id}
Gets information about device network and its devices.
Type | Name | Description | Schema |
---|---|---|---|
Path |
id required |
Network identifier. | integer (int64) |
HTTP Code | Description | Schema |
---|---|---|
200 | If successful, this method returns a Network resource in the response body. | Network |
400 | If request is malformed | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
404 | If network not found | No Content |
application/json
PUT /network/{id}
Updates an existing device network.
Type | Name | Description | Schema |
---|---|---|---|
Path |
id required |
Network identifier. | integer (int64) |
Body |
body required |
Network body | Network |
HTTP Code | Description | Schema |
---|---|---|
204 | If successful, this method returns an empty response body. | No Content |
400 | If request is malformed | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
application/json
DELETE /network/{id}
Deletes an existing device network.
Type | Name | Description | Schema |
---|---|---|---|
Path |
id required |
Network identifier. | integer (int64) |
HTTP Code | Description | Schema |
---|---|---|
204 | If successful, this method returns an empty response body. | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
404 | If network not found | No Content |
application/json
Represents a device, a unit that runs microcode and communicates to this API.
Name | Description | Schema |
---|---|---|
data optional |
JsonStringWrapper | |
deviceId optional |
string | |
id optional |
integer (int64) | |
isBlocked optional |
Default : false
|
boolean |
name required |
Length : 1 - 128
|
string |
networkId optional |
integer (int64) |
GET /device
Gets list of devices.
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Header |
Authorization required |
Authorization token | string | |
Query |
name optional |
Filter by device name. | string | |
Query |
namePattern optional |
Filter by device name pattern. | string | |
Query |
networkId optional |
Filter by associated network identifier. | integer (int64) | |
Query |
networkName optional |
Filter by associated network name. | string | |
Query |
skip optional |
Number of records to skip from the result list. | integer (int32) | 0 |
Query |
sortField optional |
Result list sort field. | enum (Name, Status, Network) | |
Query |
sortOrder optional |
Result list sort order. | enum (ASC, DESC) | |
Query |
take optional |
Number of records to take from the result list. | integer (int32) | 20 |
HTTP Code | Description | Schema |
---|---|---|
200 | If successful, this method returns array of Device resources in the response body. | < DeviceVO > array |
400 | If request parameters invalid | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
application/json
application/json
GET /device/{id}
Gets information about device.
Type | Name | Description | Schema |
---|---|---|---|
Header |
Authorization required |
Authorization token | string |
Path |
id required |
Device unique identifier. | string |
HTTP Code | Description | Schema |
---|---|---|
200 | If successful, this method returns a Device resource in the response body. | No Content |
400 | If request is malformed | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
404 | If device is not found | No Content |
application/json
application/json
PUT /device/{id}
Registers or updates a device. For initial device registration, only 'name' property is required.
Type | Name | Description | Schema |
---|---|---|---|
Header |
Authorization required |
Authorization token | string |
Path |
id required |
Device unique identifier. | string |
Body |
body required |
Device body | DeviceUpdate |
HTTP Code | Description | Schema |
---|---|---|
204 | If successful, this method returns an empty response body. | No Content |
400 | If request is malformed | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
application/json
application/json
DELETE /device/{id}
Deletes an existing device.
Type | Name | Description | Schema |
---|---|---|---|
Header |
Authorization required |
Authorization token | string |
Path |
id required |
Device unique identifier. | string |
HTTP Code | Description | Schema |
---|---|---|
204 | If successful, this method returns an empty response body. | No Content |
400 | If request is malformed | No Content |
401 | If request is not authorized | No Content |
403 | If principal doesn't have permissions | No Content |
404 | If device is not found | No Content |
application/json
application/json
Operational data is created in real time and translated between devices and servers. It is required for the proper functioning of the IoT network. Operational data consists of Notifications and Commands.
Notifications are units of information dispatched from devices.
Commands are sent to devices and typically mean some command that is to be executed by the device.
GET /device/command/poll
This method returns all device commands that were created after specified timestamp. In the case when no commands were found, the method blocks until new command is received. If no commands are received within the waitTimeout period, the server returns an empty response. In this case, to continue polling, the client should repeat the call with the same timestamp value.
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Query |
deviceGuids optional |
List of device GUIDs | string | |
Query |
limit optional |
Limit number of commands | integer (int32) | 100 |
Query |
names optional |
Command names | string | |
Query |
timestamp optional |
Timestamp to start from | string | |
Query |
waitTimeout optional |
Wait timeout in seconds | integer (int64) | 30 |
HTTP Code | Description | Schema |
---|---|---|
200 | successful operation | < DeviceCommand > array |
application/json
POST /device/{deviceGuid}/command
Creates new device command, stores and returns command with generated id.
Type | Name | Description | Schema |
---|---|---|---|
Path |
deviceGuid required |
Device GUID | string |
Body |
body required |
Command body | DeviceCommand |
HTTP Code | Description | Schema |
---|---|---|
200 | successful operation | DeviceCommand |
404 | If device not found | No Content |
application/json
GET /device/{deviceGuid}/command
Gets list of commands that has been received in specified time range.
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Path |
deviceGuid required |
Device GUID | string | |
Query |
command optional |
Command name | string | |
Query |
end optional |
End timestamp | string | |
Query |
skip optional |
Skip param | integer (int32) | 0 |
Query |
sortField optional |
Sort field | string | "timestamp" |
Query |
sortOrder optional |
Sort order | string | |
Query |
start optional |
Start timestamp | string | |
Query |
status optional |
Command status | string | |
Query |
take optional |
Limit param | integer (int32) | 100 |
HTTP Code | Description | Schema |
---|---|---|
200 | successful operation | < DeviceCommand > array |
application/json
GET /device/{deviceGuid}/command/poll
This method returns all device commands that were created after specified timestamp. In the case when no commands were found, the method blocks until new command is received. If no commands are received within the waitTimeout period, the server returns an empty response. In this case, to continue polling, the client should repeat the call with the same timestamp value.
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Path |
deviceGuid required |
Device GUID | string | |
Query |
limit optional |
Limit number of commands | integer (int32) | 100 |
Query |
names optional |
Command names | string | |
Query |
timestamp optional |
Timestamp to start from | string | |
Query |
waitTimeout optional |
Wait timeout in seconds | integer (int64) | 30 |
HTTP Code | Description | Schema |
---|---|---|
200 | successful operation | < DeviceCommand > array |
application/json
GET /device/{deviceGuid}/command/{commandId}
Gets command by device GUID and command id
Type | Name | Description | Schema |
---|---|---|---|
Path |
commandId required |
Command Id | string |
Path |
deviceGuid required |
Device GUID | string |
HTTP Code | Description | Schema |
---|---|---|
200 | successful operation | DeviceCommand |
404 | If device or command not found | No Content |
application/json
PUT /device/{deviceGuid}/command/{commandId}
Updates an existing device command.
Type | Name | Description | Schema |
---|---|---|---|
Path |
commandId required |
Command Id | integer (int64) |
Path |
deviceGuid required |
Device GUID | string |
Body |
body required |
Command body | DeviceCommand |
HTTP Code | Description | Schema |
---|---|---|
200 | successful operation | DeviceCommand |
404 | If device or command not found | No Content |
application/json
GET /device/{deviceGuid}/command/{commandId}/poll
Waits for a command to be processed.
This method returns a command only if it has been processed by a device.
In the case when command is not processed, the method blocks until device acknowledges command execution. If the command is not processed within the waitTimeout period, the server returns an empty response. In this case, to continue polling, the client should repeat the call.
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Path |
commandId required |
Command Id | string | |
Path |
deviceGuid required |
Device GUID | string | |
Query |
waitTimeout optional |
Wait timeout in seconds (default: 30 seconds, maximum: 60 seconds). Specify 0 to disable waiting. | integer (int64) | 30 |
HTTP Code | Description | Schema |
---|---|---|
200 | successful operation | DeviceCommand |
204 | Command was not processed during waitTimeout. | No Content |
400 | Command with commandId was not sent for device with deviceGuid or wrong input parameters. | No Content |
404 | Device or command was not found. | No Content |
application/json
GET /device/notification/poll
Polls new device notifications.
This method returns all device notifications that were created after specified timestamp.
In the case when no notifications were found, the method blocks until new notification is received. If no notifications are received within the waitTimeout period, the server returns an empty response. In this case, to continue polling, the client should repeat the call with the same timestamp value.
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Query |
deviceGuids optional |
Device guids | string | |
Query |
names optional |
Notification names | string | |
Query |
timestamp optional |
Timestamp to start from | string | |
Query |
waitTimeout optional |
Wait timeout | integer (int64) | 30 |
HTTP Code | Description | Schema |
---|---|---|
200 | OK | < DeviceNotification > array |
POST /device/{deviceGuid}/notification
Creates notification
Type | Name | Description | Schema |
---|---|---|---|
Path |
deviceGuid required |
Device GUID | string |
Body |
body required |
Notification body | DeviceNotification |
HTTP Code | Description | Schema |
---|---|---|
201 | notification sent | DeviceNotification |
400 | If request is malformed | No Content |
403 | If device is not connected to network | No Content |
404 | If device not found | No Content |
application/json
GET /device/{deviceGuid}/notification
Returns notifications by provided parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Path |
deviceGuid required |
Device GUID | string | |
Query |
end optional |
End timestamp | string | |
Query |
notification optional |
Notification name | string | |
Query |
skip optional |
Skip param | integer (int32) | 0 |
Query |
sortField optional |
Sort field | string | "timestamp" |
Query |
sortOrder optional |
Sort order | string | |
Query |
start optional |
Start timestamp | string | |
Query |
take optional |
Limit param | integer (int32) | 100 |
HTTP Code | Description | Schema |
---|---|---|
200 | successful operation | DeviceNotification |
GET /device/{deviceGuid}/notification/poll
Polls new device notifications for specified device Guid.
This method returns all device notifications that were created after specified timestamp.
In the case when no notifications were found, the method blocks until new notification is received. If no notifications are received within the waitTimeout period, the server returns an empty response. In this case, to continue polling, the client should repeat the call with the same timestamp value.
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Path |
deviceGuid required |
Device GUID | string | |
Query |
names optional |
Notification names | string | |
Query |
timestamp optional |
Timestamp to start from | string | |
Query |
waitTimeout optional |
Wait timeout | integer (int64) | 30 |
HTTP Code | Description | Schema |
---|---|---|
200 | OK | < DeviceNotification > array |
GET /device/{deviceGuid}/notification/{id}
Returns notification by device guid and notification id
Type | Name | Description | Schema |
---|---|---|---|
Path |
deviceGuid required |
Device GUID | string |
Path |
id required |
Notification id | integer (int64) |
HTTP Code | Description | Schema |
---|---|---|
200 | Returned notification by device guid and notification id | DeviceNotification |
404 | If device or notification not found | No Content |
The service allows devices to exchange messages with the DeviceHive server using a single persistent connection.
After connection is established, devices need to register using the device/save message, perform authentication and then start sending notifications using the notification/insert message.
Devices may also subscribe to commands using the command/subscribe message and then start receiving server-originated messages about new commands.
Message | Originator | Authorization | Description |
---|---|---|---|
authenticate | Device | None | Authenticates a device. After successful authentication, all subsequent messages may exclude deviceId and deviceKey parameters. |
command/subscribe | Device | Device | Subscribes the device to commands. After subscription is completed, the server will start to send command/insert messages to the connected device. |
command/unsubscribe | Device | Device | Unsubscribes the device from commands. |
command/update | Device | Device | Updates an existing device command. |
device/get | Device | Device | Gets information about the current device. |
device/save | Device | Device | Registers or updates a device. |
notification/insert | Device | Device | Creates new device notification. |
server/info | Device | None | Gets meta-information of the current API. |
srv: command/insert | Server | n/a | Notifies the device about new command. |
Authenticates a device. After successful authentication, all subsequent messages may exclude JSON Web Token parameter.
None
{
"action": {string},
"requestId": {object},
"token": {string}
}
Property Name | Required | Type | Description |
---|---|---|---|
action | Yes | string | Action name: authenticate |
requestId | No | object | Request unique identifier, will be passed back in the response message. |
token | Yes | string | Access JSON Web Token. |
{
"action": {string},
"status": {string},
"requestId": {object}
}
Property Name | Type | Description |
---|---|---|
action | string | Action name: authenticate |
status | string | Operation execution status (success or error). |
requestId | object | Request unique identifier as specified in the request message. |
Subscribes the device to commands. After subscription is completed, the server will start to send command/insert messages to the connected device.
Device
{
"action": {string},
"requestId": {object},
"token": {string},
"timestamp": {datetime}
}
Property Name | Required | Type | Description |
---|---|---|---|
action | Yes | string | Action name: command/subscribe |
requestId | No | object | Request unique identifier, will be passed back in the response message. |
token | No | string | Access JSON Web Token (specify if not authenticated). |
timestamp | No | datetime | Timestamp of the last received command (UTC). If not specified, the server’s timestamp is taken instead. |
{
"action": {string},
"status": {string},
"requestId": {object}
}
Property Name | Type | Description |
---|---|---|
action | string | Action name: command/subscribe |
status | string | Operation execution status (success or error). |
requestId | object | Request unique identifier as specified in the request message. |
Unsubscribes the device from commands.
Device
{
"action": {string},
"requestId": {object},
"token": {string},
}
Property Name | Required | Type | Description |
---|---|---|---|
action | Yes | string | Action name: command/unsubscribe |
requestId | No | object | Request unique identifier, will be passed back in the response message. |
token | No | string | Access JSON Web Token (specify if not authenticated). |
{
"action": {string},
"status": {string},
"requestId": {object}
}
Property Name | Type | Description |
---|---|---|
action | string | Action name: command/unsubscribe |
status | string | Operation execution status (success or error). |
requestId | object | Request unique identifier as specified in the request message. |
Updates an existing device command.
Device
{
"action": {string},
"requestId": {object},
"token": {string},
"commandId": {integer},
"command": {
"command": {string},
"parameters": {object},
"lifetime": {integer},
"status": {string},
"result": {object}
}
}
Property Name | Required | Type | Description |
---|---|---|---|
action | Yes | string | Action name: command/update |
requestId | No | object | Request unique identifier, will be passed back in the response message. |
token | No | string | Access JSON Web Token (specify if not authenticated). |
commandId | Yes | integer | Device command identifier. |
command | Yes | object | A [DeviceCommand][] resource to update. |
command.command | No | string | Command name. |
command.parameters | No | object | Command parameters, a JSON object with an arbitrary structure. |
command.lifetime | No | integer | Command lifetime, a number of seconds until this command expires. |
command.status | No | string | Command status, as reported by device or related infrastructure. |
command.result | No | object | Command execution result, an optional value that could be provided by device. |
{
"action": {string},
"status": {string},
"requestId": {object}
}
Property Name | Type | Description |
---|---|---|
action | string | Action name: command/update |
status | string | Operation execution status (success or error). |
requestId | object | Request unique identifier as specified in the request message. |
Gets information about the current device.
Device
{
"action": {string},
"requestId": {object},
"token": {string},
}
Property Name | Required | Type | Description |
---|---|---|---|
action | Yes | string | Action name: device/get |
requestId | No | object | Request unique identifier, will be passed back in the response message. |
token | No | string | Access JSON Web Token (specify if not authenticated). |
{
"action": {string},
"status": {string},
"requestId": {object},
"device": {
"id": {string},
"name": {string},
"status": {string},
"data": {object},
"network": {
"id": {integer},
"name": {string},
"description": {string}
}
}
}
Property Name | Type | Description |
---|---|---|
action | string | Action name: device/get |
status | string | Operation execution status (success or error). |
requestId | object | Request unique identifier as specified in the request message. |
device | object | The [Device][] resource representing the current device. |
device.id | string | Device unique identifier. |
device.name | string | Device display name. |
device.status | string | Device operation status. The status is optional and it can be set to an arbitrary value, if applicable. |
device.data | object | Device data, a JSON object with an arbitrary structure. |
device.network | object | Associated network object. |
device.network.id | integer | Network identifier. |
device.network.name | string | Network display name. |
device.network.description | string | Network description. |
Gets the list of devices.
Device
{
"action": {string},
"requestId": {object},
"token": {string}
}
Property Name | Required | Type | Description |
---|---|---|---|
action | Yes | string | Action name: device/list |
requestId | No | object | Request unique identifier, will be passed back in the response message. |
token | No | string | Access JSON Web Token (specify if not authenticated). |
{
"action": {string},
"requestId": {object},
"status": {string},
"devices": [{
"id": {string},
"name": {string},
"status": {string},
"data": {object},
"networkId": {integer},
"isBlocked": {boolean}
}]
}
Property Name | Type | Description |
---|---|---|
action | string | Action name: device/get |
requestId | object | Request unique identifier as specified in the request message. |
status | string | Operation execution status (success or error). |
devices | array | The array of Devices. |
device | object | The [Device][] resource representing the user device. |
device.id | string | Device unique identifier. |
device.name | string | Device display name. |
device.status | string | Device operation status. The status is optional and it can be set to an arbitrary value, if applicable. |
device.data | object | Device data, a JSON object with an arbitrary structure. |
device.networkId | integer | Network identifier. |
device.isBlocked | boolean | Device isBlocked identifier. |
Registers or updates a device.
Device
{
"action": {string},
"requestId": {object},
"token": {string},
"deviceId": {string},
"device": {
"id": {string},
"name": {string},
"data": {object},
"networkId": {integer},
"isBlocked": {boolean}
}
}
Property Name | Required | Type | Description |
---|---|---|---|
action | Yes | string | Action name: device/save |
requestId | No | object | Request unique identifier, will be passed back in the response message. |
token | Yes | string | Access JSON Web Token (specify if not authenticated). |
deviceId | No | string | Device unique identifier (specify if not authenticated). |
device | Yes | object | A [Device][] resource to register or update. |
device.id | No | string | Device unique identifier. |
device.name | No | string | Device display name. |
device.data | No | object | Device data, a JSON object with an arbitrary structure. |
device.networkId | No | integer | Associated network id. |
device.isBlocked | No | boolean | Indicates whether device is blocked. |
{
"action": {string},
"status": {string},
"requestId": {object}
}
Property Name | Type | Description |
---|---|---|
action | string | Action name: device/save |
status | string | Operation execution status (success or error). |
requestId | object | Request unique identifier as specified in the request message. |
Creates new device notification.
Device
{
"action": {string},
"requestId": {object},
"token": {string},
"notification": {
"notification": {string},
"parameters": {object}
}
}
Property Name | Required | Type | Description |
---|---|---|---|
action | Yes | string | Action name: notification/insert |
requestId | No | object | Request unique identifier, will be passed back in the response message. |
token | No | string | Access JSON Web Token (specify if not authenticated). |
notification | Yes | object | A [DeviceNotification][] resource to create. |
notification.notification | Yes | string | Notification name. |
notification.parameters | No | object | Notification parameters, a JSON object with an arbitrary structure. |
{
"action": {string},
"status": {string},
"requestId": {object},
"notification": {
"id": {integer},
"timestamp": {datetime}
}
}
Property Name | Type | Description |
---|---|---|
action | string | Action name: notification/insert |
status | string | Operation execution status (success or error). |
requestId | object | Request unique identifier as specified in the request message. |
notification | object | An inserted [DeviceNotification][] resource. |
notification.id | integer | Notification identifier. |
notification.timestamp | datetime | Notification timestamp (UTC). |