CreateOTAStaticUpgradeJob

Last Updated on : 2025-10-10 06:57:08Copy for LLMView as MarkdownDownload PDF

Create a static upgrade batch.

Request Parameters

Name type Required Sample Values Description
Action String Yes CreateOTAStaticUpgradeJob System defined parameters. Value: CreateOTAStaticUpgradeJob.
FirmwareID String Yes 178 The upgrade package ID, which is the unique identifier of the upgrade package.
ProductKey String Yes K1nhvyl * * * * Of the product to which the upgrade package belongs ProductKey .
TargetSelection String Yes All upgrade scope. ●All : Full upgrade. ●S****pecific : Directed upgrades. ●Gray : Grayscale upgrade. ●Group : Group upgrade.
SrcVersion.N RepeatList No V1.0.1 List of version numbers to be upgraded. Description
RetryInterval Integer No 60 The time interval for automatic retries after the device upgrade fails. The unit is minutes. Optional values: ●0 : Try again immediately. ●10 : Try again after 10 minutes. ●30 : Try again in 30 minutes. ●60 : Try again after 60 minutes (I. E. 1 hour). ●1440 : Try again after 1,440 minutes (I. E. 24 hours). If this parameter is not specified, no attempt is made.
RetryCount Integer No 1 Number of automatic retries. If the incoming RetryInterval parameter, you need to pass in the parameter. Optional values: ●1 : Time. ●2 : Twice. ●5 : Times.
TimeoutInMinutes Integer No 1440 The device upgrade timeout period. If the device does not complete the upgrade, the upgrade fails. The unit is minutes, and the value range is 1~1,440. If this parameter is not specified, there is no timeout limit for device upgrade.
GrayPercent String No 33 Sets the grayscale scale. The value is an integer in string format the upgrade range is specified as a grayscale upgrade ( TargetSelection=GRAY ), this parameter needs to be passed in.
TargetDeviceName.N RepeatList No DeviceName List of device names for the targeted upgrade.
NeedPush Boolean No True Whether the IoT platform actively pushes upgrade tasks to devices. ●True (Default): Yes. After the batch task is created, IoT Platform directly pushes the upgrade task to the online devices within the scope of the upgrade. In this case, the device can still initiate a request to IoT platform to obtain OTA upgrade task information. ●False : No. The device must request the IoT platform to obtain the OTA upgrade task information.
NeedConfirm Boolean No False If you need to autonomously control the device OTA upgrade, you can configure this parameter and use the mobile phone App to control whether the device can be upgraded OTA. Mobile App needs to be developed by yourself. ●False (Default): No. Directly in accordance NeedPush setting to obtain OTA upgrade task information. ●True : Yes. The device cannot obtain the OTA upgrade task. The App side must confirm the OTA upgrade before following NeedPush setting to obtain OTA upgrade task information.
GroupID String No CtjzCkNuOx *** The group ID. Only when initiating a group upgrade ( TargetSelection=GROUP ) task, this parameter must be passed in.
DownloadProtocol String No Https Upgrade package download protocol, currently only available:Https . After receiving the upgrade package download information pushed by the IoT platform, the device downloads the upgrade package through the protocol.

Note: When calling an API, in addition to the API-specific request parameters described in this topic, you must also pass in the common request parameters. For more information about common request parameters, see Common parameters.

Return data

Name Type Sample Values Description
Code String Iot.system.SystemException The error code returned when the call fails. For more information, see Error codes.
Data Struct The upgrade batch information returned when the call is successful. For more information, see Data parameter description.
JobID String 183634077921266 * * * * Upgrade batch ID, which is the unique identifier of the upgrade batch.
UtcCreate String 2024-11-11 T11:21:54.607Z The creation time of the upgrade batch, in UTC format.
ErrorMessage String System Exception Error information returned when the call fails.
RequestID String Kan The unique identifier that IoT Platform generates for the request.
Success Boolean True Whether the call was successful. ●True : The call is successful, indicating that the OTA upgrade package is successfully created. ●False : The call fails, indicating that the OTA upgrade package failed to be created.

Example

Request Example

curl 'https://si-d6e8d******8958054.tuyacloud.com:8686/?Action=CreateOTAStaticUpgradeJob&SignatureNonce=9e6189124f5a4716ad2de849467b****&AccessKeyId=xMr9wgwXQLhv5AUa65o0****&SignatureMethod=HMAC-SHA1&Timestamp=2024-11-19T09%3A47%3A43Z&FirmwareId=167&ProductKey=k1nhvyl****&TargetSelection=ALL&RetryCount=1&RetryInterval=60&TimeoutInMinutes=1440&SrcVersion.1=1.0&Signature=WJN0Ee8%2BX6pogcD3loLHIqQNEN0%3D'

Normal Return Example

{
    "code": "",
    "data": {
        "firmwareId": "183634077921266****",
        "utcCreate": "2024-11-20T08:50:00.239Z"
    },
    "requestId": "d2fce065-8238-4ee2-a793-0226f69b0542",
    "success": true
}