Receive commands
GET/devices/{deviceId}/command
Base URL: https://api.tinkermode.com
Establish a WebSocket connection and listen for commands. Only the corresponding device itself can make this call. Any non-WebSocket requests will be rejected. Once the connection is established, the client can expect incoming messages in the form of Device Command JSON objects as used in the PUT method. Since not all WebSocket client implementations allow you to set the Authorization HTTP header, you can pass the device API key as the authToken query parameter.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain an API key of the matching device.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
deviceId | integer | Yes | Device ID |
Query parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
authToken | string | No | API key assigned to device. Needed only if the Authorization header cannot be set. |
Responses
101 Successfully established a WebSocket connection.
401 Authorization is required to access this resource.
403 Request failed because of invalid data or 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 resource 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. |
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. |