調用該接口清空設備已設置的期望屬性值。

使用說明

  • 調用本接口時,必須傳入要清空的屬性標識符(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

重要
  • 若有ID值,必須傳入該ID值,否則調用會失敗。
  • 若無實例概覽頁面或ID值,則無需傳入。

實例的更多信息,請參見實例概述

ProductKey String a1BwAGV****

要清空期望屬性值的設備所屬的產品ProductKey

說明 如果傳入該參數,需同時傳入 DeviceName
DeviceName String light

要清空期望屬性值的設備名稱。

說明 如果傳入該參數,需同時傳入 ProductKey
Identifies.N RepeatList temperature

要清空期望屬性值的屬性標識符列表。屬性標識符個數不能超過10個。

IotId String Q7uOhVRdZRRlDnTLv****00100

要清空期望屬性值的設備ID。物聯網平臺為該設備頒發的ID,設備的唯一標識符。

說明 IotId作為設備唯一標識符,和 ProductKeyDeviceName組合是一一對應的關系。如果傳入該參數,則無需傳入 ProductKeyDeviceName。如果您同時傳入 IotIdProductKeyDeviceName組合,則以 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

是否調用成功。

  • true:調用成功。
  • false:調用失敗。

示例

請求示例

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. 非法的請求參數。

訪問錯誤中心查看更多錯誤碼。