Get device info
GET/devices/{deviceId}
Base URL: https://api.tinkermode.com
Return the device with the specified ID.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain a project, user or service account who has read access to the device, or device API key.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
deviceId | integer | Yes | Device ID |
Query parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
includeAdminInfo | boolean | No | Include the device API key, claim code, and creation time in the result. To use this parameter, the request must be made using the API the key of a user with permission to read project devices, or a project API key with "Admin" privileges. |
Responses
200 Successful retrieval of device by specified ID.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
apiKey | string | No | read-only (server-generated) | API access key assigned to device. Usually hidden except to privileged clients, but is also present during the On-Demand Device Provisioning process. |
bundleInstallTime | string | No | read-only (server-generated); format: date-time | If present, the timestamp when the firmware bundle was installed. |
bundleInstalled | string | No | read-only (server-generated) | If present, the name of firmware bundle installed on this device. |
channel | string | No | read-only (server-generated) | The name of firmware channel the device should download from. |
claimCode | string | No | Claim code assigned to device. Hidden except to privileged clients. | |
claimExpirationTime | string | No | read-only (server-generated); format: date-time | Expiration time of device's claimable state. |
claimTime | string | No | read-only (server-generated); format: date-time | Timestamp of device being claimed by a user. |
creationTime | string | No | read-only (server-generated); format: date-time | Timestamp of device record creation. |
description | string | No | Description of device. | |
deviceClass | string | Yes | read-only (server-generated) | Device Class ID as defined by the project. |
homeId | integer | No | This property is present if device belongs to a home. | |
id | integer | Yes | read-only (server-generated) | Unique device ID. |
isConnected | boolean | No | read-only (server-generated) | Device is currently connected to MODE Cloud via a websocket or MQTT connection. |
lastConnectTime | string | No | read-only (server-generated); format: date-time | The last time the device connected to the cloud. |
lastDisconnectTime | string | No | read-only (server-generated); format: date-time | The last time the device disconnected from the cloud. |
name | string | No | Display name of device. | |
projectId | integer | Yes | read-only (server-generated) | Project that this device belongs to. |
tag | string | No | An optional/informational tag associated with device. Can be used to store the serial number, for example. |
Response example
{
"claimExpirationTime": "2019-12-17T22:54:39Z",
"claimTime": "2019-12-17T22:54:39Z",
"deviceClass": "smart_light",
"homeId": 1885,
"id": 34328,
"isConnected": true,
"lastConnectTime": "2019-12-17T22:54:03.321Z",
"name": "happy",
"projectId": 1260,
"tag": "0002"
}401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
404 The requested device does not exist or is not accessible.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |