Creates a task to verify an over-the-air (OTA) update package.

Usage notes

  • You must verify an update package before you push the package to devices for a batch update. Only verified update packages can be used to update devices in batches. You can call the QueryOTAFirmware operation to view the status of a verification task.
  • You cannot initiate a verification task for an update package that is under verification or passes the verification.
  • You can specify a maximum of 10 devices for a verification task.

QPS limits

You can call this API operation up to 10 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

ParameterTypeRequiredExampleDescription
ActionStringYesCreateOTAVerifyJob

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

FirmwareIdStringYesnx3xxVvFdwvn6dim50PY03****

The ID of the update package.

The FirmwareId parameter is returned when you call the CreateOTAFirmware operation to create an OTA update package.

You can also call the ListOTAFirmware operation to obtain the package ID.

ProductKeyStringYesa1VJwBw****

The ProductKey of the product to which the OTA update package belongs.

Tag.N.KeyStringYeskey1

The key of the update batch tag. The key must be 1 to 30 characters in length and can contain letters, digits, and periods (.). You can add up to 10 tags to an update batch.

The tags of an update batch are sent to devices when IoT Platform pushes update notifications to the devices.

Note Update batch tags are optional. If you want to specify a tag, you must configure the Tag.N.Value and Tag.N.Key parameters in pair.
Tag.N.ValueStringYesvalue1

The value of the update batch tag. The value must be 1 to 1,024 characters in length. You can add up to 10 tags for each update batch. The total length of the tag keys and tag values of all update batches cannot exceed 4,096 characters.

Note Update batch tags are optional. If you want to specify a tag, you must configure the Tag.N.Value and Tag.N.Key parameters in pair.
TargetDeviceName.NRepeatListYestestdevice

The device that you want to specify in the verification task.

Note
  • The devices must belong to the same product as the update package.
  • Each DeviceName must be unique.
  • You can specify up to 10 DeviceNames.
IotInstanceIdStringNoiot_instc_pu****_c*-v64********

The ID of the IoT instance. You can view the instance ID 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.

TimeoutInMinutesIntegerNo.1440

The timeout period for a device to update the firmware. Unit: minutes. Valid values: 1 to 1440.

NeedPushBooleanNotrue

Specifies whether to automatically push update tasks from IoT Platform to devices. Valid values:

  • true (default): After an update batch is created, IoT Platform automatically pushes update tasks to the specified online devices.

    In this case, a device can still initiate a request to obtain information about the OTA update task from IoT Platform.

  • false: A device must initiate a request to obtain information about the OTA update task from IoT Platform.
NeedConfirmBooleanNofalse

Specifies whether to confirm the update by using a mobile app. You must develop a mobile app based on your business requirements. Valid values:

  • false (default): A device obtains information about the OTA update task based on the value of the NeedPush parameter.
  • true: To perform an OTA update on a device, you must confirm the update by using your mobile app. Then, the device can obtain information about the OTA update task based on the value of the NeedPush parameter.
DownloadProtocolStringNoHTTPS

The download protocol of the update package. Valid values: HTTPS and MQTT. Default value: HTTPS. After the device receives the update package information pushed by IoT Platform, the protocol is used to download the update package.

Important
  • If you want to download the update package over HTTP, you can download a package file of up to 1,000 MB. The file format can be .bin, .dav, .tar, .gz, .zip, .gzip, .apk, .tar.gz, .tar.xz, or .pack. For more information about the limits, see OTA update overview.
  • If you want to download the update package over MQTT, take note of the following items:
    • The following regions are supported: China (Shanghai), China (Beijing), and China (Shenzhen).
    • The OTA update package can contain only one file and the size of the file cannot exceed 16 MB.
    • You must use the latest version of Link SDK for C to develop the device features to perform OTA updates and download files over MQTT. For more information, see Sample code of downloading an OTA update package that contains a single file over MQTT.

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

ParameterTypeExampleDescription
CodeStringiot.system.SystemException

The error code that is returned if the call fails. For more information, see Error codes.

DataStruct

The task information returned if the call is successful. For more information, see the following parameters.

JobIdStringwahVIzGkCMuAUE2gDERM02****

The ID of the verification task.

UtcCreateString2019-11-04T06:22:19.566Z

The time when the verification task was created. The time is displayed in UTC.

ErrorMessageStringA system exception occurred.

The error message that is returned if the call fails.

RequestIdString29EC7245-0FA4-4BB6-B4F5-5F04818FDFB1

The request ID.

SuccessBooleantrue

Indicates whether the request was successful. Valid values:

  • true
  • false

Examples

Sample requests

http(s)://iot.cn-shanghai.aliyuncs.com/?Action=CreateOTAVerifyJob
&FirmwareId=nx3xxVvFdwvn6dim50PY03****
&ProductKey=a1VJwBw****
&Tag.1.Key=key1
&Tag.1.Value=value1
&TargetDeviceName.1=testdevice
&TimeoutInMinutes=1440
&<Common request parameters>

Sample success response

XML format

<CreateOTAVerifyJobResponse>
   <Data>
       <JobId>wahVIzGkCMuAUE2gDERM02****</JobId>
       <UtcCreate>2019-11-04T06:22:19.566Z</UtcCreate>
   </Data>
   <RequestId>29EC7245-0FA4-4BB6-B4F5-5F04818FDFB1</RequestId>
   <Success>true</Success>
</CreateOTAVerifyJobResponse>

JSON format

{
  "Data": {
    "JobId": "wahVIzGkCMuAUE2gDERM02****",
    "UtcCreate": "2019-11-04T06:22:19.566Z"
  },
  "RequestId": "29EC7245-0FA4-4BB6-B4F5-5F04818FDFB1",
  "Success": true
}

Error codes

For a list of error codes, visit the API Error Center.