V2.1 Get Firmware File


Get the file of the specified firmware.


This API is available in EnOS 2.2.0 and above.

If you need to invoke this API after performing bulk updates to relevant files using other APIs, it is recommended to wait for about 2 seconds to avoid obtaining unupdated data.

Operation Permissions


Before invoking this API, ensure that the service account has been authorized the policy that includes the following service(s) and action permission(s). For how to authorize the service account, see Managing Service Accounts.


Required Service Required Operation Permission
Firmware Read

Request Format

GET https://{apigw-address}/connect-service/v2.1/ota-firmwares?action=get

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>>
firmwareId Query Mandatory String The firmware ID.

Response Parameters

Note

For old firmware files, return product information. For new firmware files, do not return product information.

Name Data Type Description
data FirmwareInfo Struct The returned results of the firmware information. For details, see FirmwareInfo Struct.

Error Codes

Code Message Description
24404 Firmware not found The firmware cannot be found.

Samples

Request Sample

url: https://{apigw-address}/connect-service/v2.1/ota-firmwares?action=get&orgId=yourOrgId&firmwareId=yourFirmwareId
method: GET

Return Sample

{
    "code":0,
    "msg":"OK",
    "requestId":"28da9093-400f-4eb1-8cdc-83e4ec77070d",
    "data":{
        "orgId":"yourOrgId",
        "firmwareId":"yourFirmwareId",
        "productKey":"BXwU4kMk",
        "name":{
            "defaultValue":"HC_TEST",
            "i18nValue":{

            }
        },
        "version":"2.0",
        "desc":null,
        "signMethod":"md5",
        "sign":"fileSig",
        "fileUrl":"enos-connect://file.zip",
        "fileSize":1767,
        "isVerified":false,
        "enableVerification":false,
        "createTime":1590746442378,
        "firmwareTags": {
          "tagKey":"tagValue"
        },
        "maxAllowedForVerification":5,
        "minSuccessForVerified":2
    }
}

SDK Samples


You can access the SDK samples for Connection Service on GitHub: