Queries the version information of the Over-the-Air (OTA) modules that are reported by a device.

Limits

Each Alibaba Cloud account can run a maximum of 10 queries per second (QPS).

Note Resource Access Management (RAM) users share the quota of the Alibaba Cloud 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 Yes ListOTAModuleVersionsByDevice

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

CurrentPage Integer Yes 1

The number of the page to return. Default value: 1.

PageSize Integer Yes 10

The number of entries to return on each page. A maximum of 200 entries can be displayed on each page.

IotInstanceId String No iot_instc_pu****_c*-v64********

The instance ID. This parameter is not required for public instances. However, this parameter is required for Enterprise Edition instances.

ProductKey String No aluctKe****

The ProductKey of the product to which the device belongs.

Note If you specify this parameter, you must also specify the DeviceName parameter.
DeviceName String No newdevice

The name of the device to be queried.

Note If you specify this parameter, you must also specify the ProductKey parameter.
IotId String No Q7uOhVRdZRRlDnTLv****00100

The ID of the device. It is the unique identifier that IoT Platform generated for the device.

Note If you specify this parameter, you do not need to specify the ProductKey or DeviceName parameter. The IotId parameter specifies a unique identifier for the device, and corresponds to a combination of the ProductKey and DeviceName parameters. If you specify the IotId parameter and the combination of the ProductKey and DeviceName parameters at the same time, only the IotId parameter is used.

In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this API 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 Error codes.

CurrentPage Integer 1

The current page number.

Data Array of SimpleOTAModuleInfo

The module version information that is returned if the call is successful. The information was reported by the device. For more information, see the SimpleOTAModuleInfo parameter in this table.

SimpleOTAModuleInfo
DeviceName String newDevice

The name of each device.

IotId String QjIFT***000101

The ID of the device.

ModuleName String barcodeScanner

The name of the OTA module.

ModuleVersion String 1.0

The module version that was reported by the device.

ProductKey String aluctKe****

The ProductKey of the product to which the device belongs.

ErrorMessage String A system exception has occurred.

The error message that is returned if the call fails.

PageCount Integer 1

The total number of pages returned.

PageSize Integer 10

The number of module versions that is returned on each page.

RequestId String 291438BA-6E10-4C4C-B761-243B9A0D324F

The ID of the request.

Success Boolean true

Indicates whether the call succeeds.

  • true: The call succeeded.
  • false: The call failed.
Total Integer 10

The total number of module versions that was reported by the device.

Examples

Sample requests

http(s)://iot.cn-shanghai.aliyuncs.com/? Action=ListOTAModuleVersionsByDevice
&CurrentPage=1
&PageSize=10
&<Common request parameters>

Sample success responses

XML format

<ListOTAModuleVersionsByDeviceResponse>
  <requestId>67AF7881-704C-40CC-B296-72F91380A117</requestId>
  <success>true</success>
  <code></code>
  <errorMessage></errorMessage>
  <PageSize>10</PageSize>
  <PageCount>1</PageCount>
  <CurrentPage>1</CurrentPage>
  <Total>1</Total>
  <Data>
        <SimpleOTAModuleInfo>
              <IotId>QjIFT***000101</IotId>
              <ModuleVersion>1.6940.1</ModuleVersion>
              <ModuleName>default</ModuleName>
              <ProductKey>a14***S</ProductKey>
              <DeviceName>newDevice</DeviceName>
        </SimpleOTAModuleInfo>
  </Data>
</ListOTAModuleVersionsByDeviceResponse>

JSON format

{
    "requestId": "67AF7881-704C-40CC-B296-72F91380A117",
    "success": true,
    "code": "",
    "errorMessage": null,
    "PageSize": 10,
    "PageCount": 1,
    "CurrentPage": 1,
    "Total": 1,
    "Data": {
        "SimpleOTAModuleInfo": [
            {
                "IotId": "QjIFT***000101",
                "ModuleVersion": "1.6940.1",
                "ModuleName": "default",
                "ProductKey": "a14***S",
                "DeviceName": "newDevice"
            }
        ]
    }
}

Error codes

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