Get firmware bundles
GET/bundles
Base URL: https://api.tinkermode.com
Description
Get a list of device firmware bundles. This endpoint operates in two modes. Firstly, devices can use this to perform Over-the-air (OTA) updates of their firmware. Secondly, authorized clients can use this to fetch a list of bundles that are available to a specific device class. The identify of the caller determines which of these two modes is used, as explained below.
Request is made with a device API key
The caller is expecting to perform an OTA update. The bundles associated with the device's project and device class are returned. By default, bundles from the "stable" channel are returned, unless the device has a channel override. No query parameters are needed for this request, and any supplied parameters will be ignored.
Request is made with a user session or project API key
The caller is expecting to fetch a list of available bundles for a device class, and the request must come with the
projectId and deviceClass query parameters.
Request is made without any authorization header
The caller is expecting to perform an OTA update but has yet to be provisioned a device ID and API Key.
This request must come with the projectId and deviceClass query parameters. By default, bundles
from the "stable" channel are returned, unless the channel query parameter is used to override that.
Request will succeed only if the project has been configured to allow public OTA updates.
In the case of OTA update, each of the returned bundles contains a list of firmware components to be downloaded. A component
object contains a versionName field, a url field, and a checksum field. Based on the component version,
you should decide whether an upgrade is necessary. To download a component,
simply use the URL provided. The checksum is a SHA-1 digest of the component file.
You may use it to verify the integrity of the downloaded file.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain either a device API key, a user session API key, a service account token, or a project API key, unless the project allows public OTA firmware updates.
Query parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
channel | string | No | Return bundles of the specified channel. | |
deviceClass | string | No | Return bundles of the specified device class. | |
projectId | integer | No | Return bundles of the specified project. |
Responses
200 Successful retrieval of all firmware bundles.
Content type: application/json
Represents a firmware bundle which contains one ore more components to be downloaded to a device.
An array of objects with the following shape:
| Property | Type | Required | Constraints | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
components | array<object> | No | read-only (server-generated) | List of components in this bundle. | ||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
creationTime | string | No | read-only (server-generated); format: date-time | Timestamp of bundle creation. | ||||||||||||||||||||||||||||||||||||||||
description | string | No | Description of the bundle | |||||||||||||||||||||||||||||||||||||||||
deviceClass | string | Yes | read-only (server-generated) | device class that this bundle belongs to. | ||||||||||||||||||||||||||||||||||||||||
id | string | Yes | read-only (server-generated) | Unique ID assigned at time of creation. | ||||||||||||||||||||||||||||||||||||||||
name | string | Yes | read-only (server-generated) | Display name of bundle. | ||||||||||||||||||||||||||||||||||||||||
projectId | integer | Yes | read-only (server-generated) | Project that this bundle belongs to. | ||||||||||||||||||||||||||||||||||||||||
Response example
[
{
"components": [
{
"checksum": "72023f800b694zz02b223c9971fc9febcbef8324",
"componentId": "5dfc2035ff1bc0646141d1f9",
"componentName": "component_one",
"filename": "firmware_one.go",
"url": "https://download.tinkermode.com/download/v1.eyJzIjoic29mdHdhcEFiLCJrIjoiMTI2MC81ZTBlNDlkOWZmMWJjMDY0NjE0MWQyMjAvMSIsImYiOiJSRUFETUUubWQifQ==.1577994891.d3f79feaee1e229a3d5789eac6d1a089973dbe7c482a15f73ad38a5e",
"versionId": "5e0e49d8gg1bc0646141d220",
"versionName": "2.0.0"
},
{
"checksum": "72023f800b694ee02b223c9971fc9febcbef8324",
"componentId": "5e0e49b4f8379d390de54175",
"componentName": "component_two",
"filename": "firmware_two.go",
"url": "https://download.tinkermode.com/download/v1.eyJzIjoic29mdFeFcmUiLCJrIjoiMTI2MC81ZTBlNDljNWZmMWJjMDY0NjE0MWQyMWYvMSIsImYiOiJSRUFETUUubWQifQ==.1577994891.ca8fb42459cdf9df17b0780ad60c7ddfe917b745399c430d3ae7f30a",
"versionId": "5e0e49c5ff1bc0646141d21f",
"versionName": "1.0.8"
}
],
"creationTime": "2020-01-02T19:52:57.572Z",
"description": "This is the firmware for all light sensors",
"deviceClass": "smart_light",
"id": "5e0e4a19ff1bc0646141d221",
"name": "light_bundle",
"projectId": 1
}
]401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |