Initiate on-demand device provisioning
POST/homes/{homeId}/deviceProvisioning
Base URL: https://api.tinkermode.com
If On-Demand Device Provisioning is enabled for your project, a home member can use this endpoint to initiate the process of adding a new device to the home. It returns a device provisioning token that should be passed to the device hardware (via local WiFi, Bluetooth, etc.). The device should then send this token to the Device endpoint to complete the process.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain a user API key, a service account token, or a project API key with "Admin" privileges.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
homeId | integer | Yes | The unique ID for a specified home. |
Request body
Content type: application/x-www-form-urlencoded
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
deviceClass | string | Yes | Device Class ID of the device to be added. | |
deviceTag | string | No | An optional tag assigned to the device to be added. |
Request example
deviceClass=smart_light&deviceTag=0001Responses
200 A device provisioning token is returned.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
expirationTime | string | No | read-only (server-generated); format: date-time | Expiration time of this token. |
token | string | No | read-only (server-generated) | The provisioning token itself. |
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 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. |
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. |