Deletes the desired values of properties of a device.

Usage notes

  • Each time you call this operation, you must specify the identifiers of properties whose desired values you want to delete for the Identifies parameter. If you do not configure the Identifies parameter, the call fails.
  • You can specify up to 10 property identifiers for the Identifies parameter in a single call.
  • After you call this operation to deletes the desired values of properties of a device, you can call the QueryDeviceDesiredProperty operation to query the desired values of properties of the device. In this case, the QueryDeviceDesiredProperty operation returns the Identifier parameter instead of the Value parameter.

QPS limits

You can call this API operation up to 50 times per second per account.

Note The RAM users of an Alibaba Cloud account share the quota of the account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No ClearDeviceDesiredProperty

The operation that you want to perform. Set the value to ClearDeviceDesiredProperty.

IotInstanceId String No iot-2w****

The ID of the instance. You can view the ID of the instance on the Overview page in the IoT Platform console.

Important
  • If your instance has an ID, you must specify the ID for this parameter. Otherwise, the call fails.
  • If no Overview page or ID is generated for your instance, you do not need to configure this parameter.

For more information, see Overview.

ProductKey String No a1BwAGV****

The ProductKey of the product to which the device belongs.

Note If you specify a value for this parameter, you must configure the DeviceName parameter.
DeviceName String No light

The DeviceName of the device.

Note If you specify a value for this parameter, you must configure the ProductKey parameter.
Identifies.N RepeatList No temperature

The identifiers of properties whose desired values you want to delete. You can specify up to 10 property identifiers.

IotId String No Q7uOhVRdZRRlDnTLv****00100

The ID of the device. The ID is a unique identifier that is issued by IoT Platform to the device.

Note The IotId parameter specifies a globally unique identifier (GUID) for the device. The value of the IotId parameter is equivalent to a combination of the values of the ProductKey and DeviceName parameters. If you specify a value for the IotId parameter, you do not need to configure the ProductKey or DeviceName parameter. If you specify values for the IotId, ProductKey, and DeviceName parameters, the value of the IotId parameter takes precedence.

In addition to the preceding operation-specific request parameters, you must configure common request parameters when you call this operation. For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
Code String iot.system.SystemException

The error code returned if the call fails. For more information, see the "Error codes" section of this topic.

Data Struct

The data returned if the call is successful.

Versions String {\"temperature\":0}

The latest version of the desired values of the properties after you call this operation to delete the specified desired property values.

ErrorMessage String A system exception occurred.

The error message returned if the call fails.

RequestId String E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565

The ID of the request.

Success Boolean true

Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call failed.

Examples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=ClearDeviceDesiredProperty
&ProductKey=a1BwAGV****
&DeviceName=device1
&Identifies.1=temperature
&<Common request parameters>

Sample success responses

XML format

<ClearDeviceDesiredPropertyResponse>
  <RequestId>E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565</RequestId>
  <Data>
        <Versions>{"temperature":0}</Versions>
  </Data>
  <Code></Code>
  <Success>true</Success>
</ClearDeviceDesiredPropertyResponse>

JSON format

{
    "RequestId": "E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565",
    "Data": {
        "Versions": "{\"temperature\":0}"
    },
    "Code": "",
    "Success": true
}

Error codes

HttpCode Error code Error message Description
400 iot.device.InvalidFormattedDeviceName The DeviceName format is invalid. The error message returned because the format of the DeviceName is invalid.
400 iot.device.NotSupportExemptionValidateType The feature does not support the specified verification type. The error message returned because the feature does not support the TSL model of the no-verification type.
400 iot.prod.NotExistedProduct The specified product does not exist. The error message returned because the specified product does not exist.
400 iot.prod.QueryProductPropertyFailed An error occurred while querying the product property. The error message returned because the system failed to query the product property.
400 iot.check.InvalidFormattedParameter The parameter format is invalid. The error message returned because the format of the value of the parameter is invalid.
400 Iot.digitaltwin.DTInstanceInvalidThingType The digital twin operation is not supported. The error message returned because this operation does not support data of the twin type.
400 iot.check.NullParameter Specify parameter is null. The error message returned because no value is specified for the parameter.
400 iot.device.CanNotSetReadOnlyProperty Cannot set read only property. The error message returned because the desired values of read-only properties cannot be queried.
400 iot.device.DeviceIsDisable The specified device has been disabled. The error message returned because the device is disabled.
400 iot.device.InvalidIoTId The specified device ID is invalid. The error message returned because the device ID is invalid.
400 iot.device.NullDeviceName The DeviceName parameter cannot be empty. The error message returned because no DeviceName is specified for the device.
400 iot.prod.NullProductKey The ProductKey parameter cannot be empty. The error message returned because no value is specified for the ProductKey parameter.
400 iot.prod.InvalidFormattedProductkey The ProductKey format is invalid. The error message returned because the format of the value of the ProductKey parameter is invalid.
400 iot.common.InvalidTenant The Invalid tenant. The error message returned because the tenant is invalid or failed to be created.
400 iot.prod.QueryPropertyNotFound Query property not found. The error message returned because the properties that are queried do not exist.
400 iot.device.ClearPropertyDesiredFailed Failed to clear desired value of property. The error message returned because the system failed to delete the desired property values.
400 iot.prod.QueryProductAbilitiesNotFound query product abilities not found. The error message returned because the product feature that is queried does not exist.
400 iot.Device.NotExistedDevice This device does not exist. The error message returned because the device does not exist or is not activated.
400 iot.prod.NullAbilityIdentifier You must specify a feature identifier. The error message returned because no identifier is specified for the feature.
400 iot.system.IllegalRequest The request parameter is invalid. The error message returned because the value of the request parameter is invalid.

For a list of error codes, see Service error codes.