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

NameTypeRequiredConstraintsDescription
deviceIdintegerYesDevice ID

Query parameters

NameTypeRequiredConstraintsDescription
includeAdminInfobooleanNoInclude 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

PropertyTypeRequiredConstraintsDescription
apiKeystringNoread-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.
bundleInstallTimestringNoread-only (server-generated); format: date-timeIf present, the timestamp when the firmware bundle was installed.
bundleInstalledstringNoread-only (server-generated)If present, the name of firmware bundle installed on this device.
channelstringNoread-only (server-generated)The name of firmware channel the device should download from.
claimCodestringNoClaim code assigned to device. Hidden except to privileged clients.
claimExpirationTimestringNoread-only (server-generated); format: date-timeExpiration time of device's claimable state.
claimTimestringNoread-only (server-generated); format: date-timeTimestamp of device being claimed by a user.
creationTimestringNoread-only (server-generated); format: date-timeTimestamp of device record creation.
descriptionstringNoDescription of device.
deviceClassstringYesread-only (server-generated)Device Class ID as defined by the project.
homeIdintegerNoThis property is present if device belongs to a home.
idintegerYesread-only (server-generated)Unique device ID.
isConnectedbooleanNoread-only (server-generated)Device is currently connected to MODE Cloud via a websocket or MQTT connection.
lastConnectTimestringNoread-only (server-generated); format: date-timeThe last time the device connected to the cloud.
lastDisconnectTimestringNoread-only (server-generated); format: date-timeThe last time the device disconnected from the cloud.
namestringNoDisplay name of device.
projectIdintegerYesread-only (server-generated)Project that this device belongs to.
tagstringNoAn 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

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

403 Request failed because of denied permission.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

404 The requested device does not exist or is not accessible.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

429 Request failed because of rate limit.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.