Get a device's firmware update state
GET
/devices/{id}/ota
const url = 'https://localhost:8080/api/v1/devices/example/ota';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://localhost:8080/api/v1/devices/example/ota \ --header 'Authorization: <Authorization>'Returns the running firmware version, the newest newer release (if any) and the latest update job.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Device id (UUID)
Responses
Section titled “Responses”OK
Media typeapplication/json
object
data
object
available
Available is the newest release newer than CurrentVersion, if any.
object
created_at
string
id
string
notes
string
sha256
string
size
integer
url
string
version
string
current_version
CurrentVersion is the firmware the device last reported; null if it never did (firmware that predates OTA support).
string
job
Job is the most recent update job of the device, if any.
object
approved_at
string
error
string
id
string
progress
integer
release_id
string
status
string
updated_at
string
version
string
Example
{ "data": { "available": { "size": 1600800, "version": "0.2.0" }, "current_version": "0.1.0", "job": { "progress": 40, "status": "approved", "version": "0.2.0" } }}Unauthorized
Media typeapplication/json
object
detail
string
errors
Array<object>
object
code
string
detail
string
in
string
name
string
instance
string
status
integer
title
string
type
string
Example
{ "detail": "One or more request values are invalid.", "errors": [ { "code": "required", "detail": "name is required", "in": "body", "name": "name" } ], "instance": "/api/v1/devices", "status": 422, "title": "Request validation failed", "type": "https://docs.air-iq.net/reference/errors/#validation-error"}Not Found
Media typeapplication/json
object
detail
string
errors
Array<object>
object
code
string
detail
string
in
string
name
string
instance
string
status
integer
title
string
type
string
Example
{ "detail": "One or more request values are invalid.", "errors": [ { "code": "required", "detail": "name is required", "in": "body", "name": "name" } ], "instance": "/api/v1/devices", "status": 422, "title": "Request validation failed", "type": "https://docs.air-iq.net/reference/errors/#validation-error"}Unprocessable Entity
Media typeapplication/json
object
detail
string
errors
Array<object>
object
code
string
detail
string
in
string
name
string
instance
string
status
integer
title
string
type
string
Example
{ "detail": "One or more request values are invalid.", "errors": [ { "code": "required", "detail": "name is required", "in": "body", "name": "name" } ], "instance": "/api/v1/devices", "status": 422, "title": "Request validation failed", "type": "https://docs.air-iq.net/reference/errors/#validation-error"}Internal Server Error
Media typeapplication/json
object
detail
string
errors
Array<object>
object
code
string
detail
string
in
string
name
string
instance
string
status
integer
title
string
type
string
Example
{ "detail": "One or more request values are invalid.", "errors": [ { "code": "required", "detail": "name is required", "in": "body", "name": "name" } ], "instance": "/api/v1/devices", "status": 422, "title": "Request validation failed", "type": "https://docs.air-iq.net/reference/errors/#validation-error"}