调用该接口清空设备已设置的期望属性值。
使用说明
- 调用本接口时,必须传入要清空的属性标识符(Identifies)。如果不传入Identifies,调用会失败。
 - 单次调用本接口,Identifies最多可传入10个属性标识符。
 - 调用本接口清空期望属性值成功后,调用QueryDeviceDesiredProperty接口查询期望属性值时,会返回对应参数Identifier(属性标识符),不会返回对应参数Value了。
 
QPS限制
单个阿里云账号调用该接口的每秒请求数(QPS)最大限制为50。
       说明 RAM用户共享阿里云账号配额。
      
     调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 | 
|---|---|---|---|---|
| Action | String | 是 | ClearDeviceDesiredProperty | 系统规定参数。取值:ClearDeviceDesiredProperty。  |  
       
| IotInstanceId | String | 否 | iot-2w**** | 实例ID。您可在物联网平台控制台的实例概览页面,查看当前实例的ID。 
           重要 
            
         
 实例的更多信息,请参见实例概述。  |  
       
| ProductKey | String | 否 | a1BwAGV**** | 要清空期望属性值的设备所属的产品ProductKey。 
           说明 如果传入该参数,需同时传入
           DeviceName。
           
          |  
       
| DeviceName | String | 否 | light | 要清空期望属性值的设备名称。 
           说明 如果传入该参数,需同时传入
           ProductKey。
           
          |  
       
| Identifies.N | RepeatList | 否 | temperature | 要清空期望属性值的属性标识符列表。属性标识符个数不能超过10个。  |  
       
| IotId | String | 否 | Q7uOhVRdZRRlDnTLv****00100 | 要清空期望属性值的设备ID。物联网平台为该设备颁发的ID,设备的唯一标识符。 
           说明 
           IotId作为设备唯一标识符,和
           ProductKey与
           DeviceName组合是一一对应的关系。如果传入该参数,则无需传入
           ProductKey和
           DeviceName。如果您同时传入
           IotId和
           ProductKey与
           DeviceName组合,则以
           IotId为准。
           
          |  
       
调用API时,除了本文介绍的该API的特有请求参数,还需传入公共请求参数。公共请求参数说明,请参见公共参数文档。
返回数据
| 名称 | 类型 | 示例值 | 描述 | 
|---|---|---|---|
| Code | String | iot.system.SystemException | 调用失败时,返回错误码。详细信息,请参见下文错误码。  |  
       
| Data | Struct | 调用成功时,返回的数据。  |  
       |
| Versions | String | {\"temperature\":0} | 本次清空期望属性值后,对应属性的期望属性值的最新版本号。  |  
       
| ErrorMessage | String | 系统异常 | 调用失败时,返回的出错信息。  |  
       
| RequestId | String | E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565 | 阿里云为该请求生成的唯一标识符。  |  
       
| Success | Boolean | true | 是否调用成功。 
  |  
       
示例
请求示例
https://iot.cn-shanghai.aliyuncs.com/?Action=ClearDeviceDesiredProperty
&ProductKey=a1BwAGV****
&DeviceName=device1
&Identifies.1=temperature
&<公共请求参数> 
     正常返回示例
XML格式
<ClearDeviceDesiredPropertyResponse>
  <RequestId>E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565</RequestId>
  <Data>
        <Versions>{"temperature":0}</Versions>
  </Data>
  <Code></Code>
  <Success>true</Success>
</ClearDeviceDesiredPropertyResponse> 
     JSON格式
{
    "RequestId": "E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565",
    "Data": {
        "Versions": "{\"temperature\":0}"
    },
    "Code": "",
    "Success": true
} 
    错误码
| HttpCode | 错误码 | 错误信息 | 描述 | 
|---|---|---|---|
| 400 | iot.device.InvalidFormattedDeviceName | The DeviceName format is invalid. | 设备名称格式错误。 | 
| 400 | iot.device.NotSupportExemptionValidateType | The feature does not support the specified verification type. | 该功能不支持物模型免校验类型。 | 
| 400 | iot.prod.NotExistedProduct | The specified product does not exist. | 指定的产品不存在。 | 
| 400 | iot.prod.QueryProductPropertyFailed | An error occurred while querying the product property. | 查询产品属性失败。 | 
| 400 | iot.check.InvalidFormattedParameter | The parameter format is invalid. | 参数格式错误。 | 
| 400 | Iot.digitaltwin.DTInstanceInvalidThingType | The digital twin operation is not supported. | 孪生数据类型不支持使用此接口访问。 | 
| 400 | iot.check.NullParameter | Specify parameter is null. | 参数{}不能为空。 | 
| 400 | iot.device.CanNotSetReadOnlyProperty | Cannot set read only property. | 无法设置只读属性。 | 
| 400 | iot.device.DeviceIsDisable | The specified device has been disabled. | 真实设备被禁用。 | 
| 400 | iot.device.InvalidIoTId | The specified device ID is invalid. | 设备ID错误。 | 
| 400 | iot.device.NullDeviceName | The DeviceName parameter cannot be empty. | 设备名称不能为空。 | 
| 400 | iot.prod.NullProductKey | The ProductKey parameter cannot be empty. | 入参产品ProductKey不能为空。 | 
| 400 | iot.prod.InvalidFormattedProductkey | The ProductKey format is invalid. | 入参产品ProductKey格式错误。 | 
| 400 | iot.common.InvalidTenant | The Invalid tenant. | 不合法的租户或者创建租户失败。 | 
| 400 | iot.prod.QueryPropertyNotFound | Query property not found. | 查询属性不存在。 | 
| 400 | iot.device.ClearPropertyDesiredFailed | Failed to clear desired value of property. | 清空属性期望值失败。 | 
| 400 | iot.prod.QueryProductAbilitiesNotFound | query product abilities not found. | 获取产品功能不存在。 | 
| 400 | iot.Device.NotExistedDevice | This device does not exist. | 设备不存在或未激活。 | 
| 400 | iot.prod.NullAbilityIdentifier | You must specify a feature identifier. | 功能标识符不能为空。 | 
| 400 | iot.system.IllegalRequest | The request parameter is invalid. | 非法的请求参数。 | 
访问错误中心查看更多错误码。