Update Device¶
Update a device. The assetId (or productKey + deviceKey) parameter is to be specified in the request url, and other parameters are to be specified in the request body.
Operation Permissions¶
| Required Authorization | Required Operation Permission | 
|---|---|
| Device Management | Full Access | 
Request Format¶
POST https://{apigw-address}/connect-service/v2.1/devices?action=update
Request Parameters (URI)¶
Note
Use one of the following methods to specify the device to be updated:
- Include - assetIdin the request
- Include - productKey+- deviceKeyin the request
| Name | Location (Path/Query) | Mandatory/Optional | Data Type | Description | 
|---|---|---|---|---|
| orgId | Query | Mandatory | String | The organization ID which the asset belongs to. How to get orgId>> | 
| assetId | Query | Optional (See Note above) | String | The asset ID. How to get assetId>> | 
| productKey | Query | Optional (See Note above) | String | The product key. To be used with  | 
| deviceKey | Query | Optional (See Note above) | String | The device key. To be used with  | 
| isPatchUpdate | Query | Optional | Boolean | 
 | 
Request Parameters (Body)¶
| Name | Mandatory/Optional | Data Type | Description | 
|---|---|---|---|
| timezone | Optional | String | Timezone of the device’s location. | 
| deviceName | Optional | StringI18n | The device name. For more details on the structure and locales supported, see Internationalized name struct. | 
| deviceAttributes | Optional | Map | The device attributes. | 
| deviceTags | Optional | Map | The device tags. (The Key and Value are of String type.) For more details, see How to use tag. | 
| deviceDesc | Optional | String | The device description. | 
Samples¶
Request Sample¶
url: https://{apigw-address}/connect-service/v2.1/devices?action=update&orgId=yourOrgId&assetId=yourAssetId
method: POST
requestBody:
{
    "deviceTags": {
        "test": "test_value"
    },
    "deviceAttributes": {
        "int11": 617
    },
    "deviceName": {
        "defaultValue": "testforname",
        "i18nValue": {}
    },
    "deviceDesc": "test for updatedevice"
}
Return Sample¶
{
    "code": 0,
    "msg": "OK",
    "requestId": "0d61752e-0633-4846-abb1-b6fb39801a5f",
    "data": null
}