update_device_type

To update the device (hardware) type and the unique ID of a unit, use the unit/update_device_type method.

Endpoint

Copied!
svc=unit/update_device_type&params={
  "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:

Copied!
{
  "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:
  • wrong input parameters,
  • the device type isn’t found or isn’t available in the billing plan,
  • the unique ID starts or ends with a space (in Wialon Local, starting from version 2504).
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.

If you find a mistake in the text, please select it and press Ctrl+Enter.