All Products
Search
Document Center

Marketplace:Generate OTA Upload URL

Last Updated:Apr 07, 2025
Important

DISCLAIMERg

Please note that all content presented on this page is provided by Tuya (HK) Limited. Alibaba Cloud makes no representations and warranties, explicit or implied, as to the authenticity or accuracy of any such content, nor makes any guarantee to the condition, quality, durability, performance, reliability, merchantability or fitness for a particular purpose, or non-infringement of any products and/or services made available by Tuya (HK) Limited. 

The URL and details of the upgrade package file generated and uploaded to OSS.

Request Parameters

Name

Type

Required

Sample Values

Description

Action

String

Yes

GenerateOTAUploadURL

System defined parameters. Value: GenerateOTAUploadURL.

FileSuffix

String

No

Bin

The upgrade package file name extension. Optional extensions:

  • Bin (Default)

  • Dav

  • Apk

  • Tar

  • Gz

  • Tar.gz

  • Zip

  • Gzip

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 file upload information returned when the call is successful. See the following parameter information for details.

FirmwareUrl

String

Https://oss-612ba0f1-2e08-4adb-9606-78390169****.oss-cn-hangzhou.aliyuncs.com/ota/firmware/bd65da39-cf24-4d9c-b306-6ac14ff5****.bin

The URL of the file, that is, the storage address of the file on the object storage (OSS). After the upgrade package file is uploaded successfully, use this parameter to call Create OTA Firmware interface to create an upgrade package.

Host

String

Https://oss-612ba0f1-2e08-4adb-9606-78390169****.oss-cn-hangzhou.aliyuncs.com

The access domain name of OSS.

Key

String

Ota/firmware/bd65da39-cf24-4d9c-b306-6ac14ff5****.bin

The name of the object (that is, the file) to be uploaded by calling the OSS API PostObject, including the full path of the OSS object.

OSSAccessKeyID

String

CS8uRRy5**** * * * *

The owner of the OSS Bucket AccessKey ID . The OSS Bucket stores files.

ObjectStorage

String

OSS

Object storage type. The default value is OSS.

Policy

String

Quest * * * *

OSS uses this parameter to verify the validity of the request form field.

Signature

String

Quest * * * *

According AccessKeySecret and Policy the calculated signature information. When the OSS API is called, OSS verifies the signature information to confirm the validity of the Post request.

UtcCreate

String

2024-11-11 T11:11:11.247Z

The time when the file upload URL is generated, 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 succeeded.

  • False : The call failed.

Example

Request Example

curl 'https://si-d6e8d812acb848958054.tuyacloud.com:8686/?Action=GenerateOTAUploadURL&SignatureNonce=9e6189124f5a4716ad2de849467be7c0&AccessKeyId=xMr9wgwXQLhv5AUa65o03mcD&SignatureMethod=HMAC-SHA1&Timestamp=2024-11-19T09%3A47%3A43Z&FileSuffix=bin&Signature=WJN0Ee8%2BX6pogcD3loLHIqQNEN0%3D'

Normal Return Example

{
  "code": "",
  "data": {
    "firmwareUrl": "https://oss-612ba0f1-2e08-4adb-9606-78390169****.oss-cn-hangzhou.aliyuncs.com/ota/firmware/bd65da39-cf24-4d9c-b306-6ac14ff5****.bin",
    "host": "https://oss-612ba0f1-2e08-4adb-9606-78390169****.oss-cn-hangzhou.aliyuncs.com",
    "key": "ota/firmware/bd65da39-cf24-4d9c-b306-6ac14ff5****.bin",
    "OSSAccessKeyId": "LTAI5tHeD8bfRz5MbhUY****",
    "objectStorage": "OSS",
    "policy": "eyJleHBpcmF0aW9uIjoiMjAyNC0xMS0yMFQwMDoxMToxOC41NjBaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCJvdGEvZmlybXdhcmUvIl1d****",
    "signature": "BYKJX8ktrZ2mrTrFvI7mhPmP****",
    "utcCreate": "2024-11-20T00:11:17.560Z"
  },
  "requestId": "7da09949-babb-4f0f-a288-d6af2f3bfad7",
  "success": true
}