List Device Current Firmware¶
List the firmware versions of all devices under the specified product.
Operation Permissions¶
Required Authorization |
Required Operation Permission |
---|---|
Device Management |
Read |
Request Format¶
GET https://{apigw-address}/connect-service/v2.1/ota-firmwares?action=listVersion
Request Parameters (URI)¶
Name |
Location(Path/Query) |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Mandatory |
String |
The organization ID which the asset belongs to. How to get orgId>> |
productKey |
Query |
Mandatory |
String |
The product key. |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
String Array |
The list of firmware versions. |
Error Codes¶
For the description of error codes, see Common Error Codes.
Samples¶
Request Sample¶
url: https://{apigw-address}/connect-service/v2.1/ota-firmwares?action=listVersion&orgId=yourOrgId&productKey=yourProductKey
method: GET
Return Sample¶
{
"code": 0,
"msg": "OK",
"requestId": "59b92d01-1b8b-44a4-8e6a-01f7d9d256f2",
"data": [
"7.7",
"2.0",
"7777",
"AOTA"
]
}
Java SDK Sample¶
package com.envisioniot.enos.connect_service.ota.firmware;
import com.envision.apim.poseidon.config.PConfig;
import com.envision.apim.poseidon.core.Poseidon;
import com.envisioniot.enos.connect_service.v2_1.ota.firmware.ListDeviceCurrentFirmwaresRequest;
import com.envisioniot.enos.connect_service.v2_1.ota.firmware.ListDeviceCurrentFirmwaresResponse;
public class ListDeviceCurrentFirmwares {
public static void main(String[] args) {
final String appKey = "yourAppKey";
final String appSecret = "yourAppSecret";
String serverUrl = "yourServerUrl";
String orgId = "yourOrgId";
String productKey = "yourProductKey";
ListDeviceCurrentFirmwaresRequest request = new ListDeviceCurrentFirmwaresRequest();
request.setOrgId(orgId);
request.setProductKey(productKey);
ListDeviceCurrentFirmwaresResponse response = Poseidon
.config(PConfig.init().appKey(appKey).appSecret(appSecret).debug())
.url(serverUrl)
.getResponse(request, ListDeviceCurrentFirmwaresResponse.class);
}
}