OTA File Downloads
This page outlines how devices can find and download Over-the-Air (OTA) files using the v2 API.
Workflow for Downloading OTA Files
-
Get Available OTA Files:
- Use the GET
/api/v2/ota-filesendpoint to retrieve a list of available OTA files for the device.
- Use the GET
-
Find the Required OTA File:
- Review the response, which is in JSON format including the
id,version,moduleand other corresponding metadata for each OTA file. - Identify the file you want to download based on the desired version.
- Your application can automatically determine which version to install, or prompt the user to select one.
- Review the response, which is in JSON format including the
-
Download the OTA File:
- Use the GET
/api/v2/ota-files/:id/fileendpoint, replacing:idwith theidof the desired OTA file. - The server will respond with the OTA file as a binary, ready for installation on the device.
- It is the responsibility of the device to handle installing the binary correctly.
- Use the GET
Example
1. Get All OTA Files
Request:
GET /api/v2/ota-filesHeaders: x-access-token: <your_device_token>Response:
[ { "id": "12345", "version": "1.2.3", "module": "sensors", ... }, { "id": "67890", "version": "1.3.0", "module": "sensors", ... }, ...]2. Download Specific OTA File
Request:
GET /api/v2/ota-files/12345/fileHeaders: x-access-token: <your_device_token>Response: Binary OTA file content.
Migrating From the v1 API
- Replace
/api/v1/deviceUser/read-only/models/firmwarewith/api/v2/ota-filesto retrieve the list of available OTA files.
- Please note that the fields have changed.
- For example,
idinstead offirmware_idandversioninstead ofversion_number.
- For example,
- Replace
/api/v1/deviceUser/read-only/models/firmware/:idwith/api/v2/ota-files/:id/fileto download a specific OTA file.