update_device_type
To update the device (hardware) type and the unique ID of a unit, use the unit/update_device_type method.
Endpoint
svc=unit/update_device_type¶ms={
"itemId": <long>,
"deviceTypeId": <long>,
"uniqueId": <text>
}
Parameters
The request must contain the following parameters:
| Parameter | Description |
|---|---|
itemId |
Unit ID. |
deviceTypeId |
New device type. |
uniqueId |
New unique ID. |
You can get all available device types using the core/get_hw_types method.
Response
If the request is completed successfully, the response is returned in the following format:
{
"uid": <text>, /* Unique ID. */
"hw": <long>, /* Device type. */
"hwd": <long> /* Device model within the device type, 0 if not specified. */
}
If the request fails, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 4 | One of the following errors:
|
| 6 | Failed to update the device type. |
| 7 | The user has no Edit connectivity settings access right to the unit. |
| 1002 | Another unit with the same unique ID and device type already exists. |