List all devices
GET
/devices
const url = 'https://localhost:8080/api/v1/devices';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 \ --header 'Authorization: <Authorization>'Returns all registered devices. Secret keys are never included.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”OK
Media typeapplication/json
object
data
Array<object>
object
created_at
string
device_id
string
firmware_version
FirmwareVersion is the version the device last reported; null until it reports one.
string
id
string
is_location_public
boolean
is_outdoor
boolean
is_public
boolean
name
string
ota
Ota summarizes the device’s firmware-update state in listings; null when unknown.
object
progress
integer
status
Status is one of: up_to_date, update_available, approved, downloading, installing, failed.
string
version
Version is the release the status refers to (the available or in-progress one).
string
updated_at
string
Example
{ "data": [ { "device_id": "dev_9f1c8a3b4d2e4f0a5b6c7d8e9f001122", "firmware_version": "0.1.0", "is_location_public": false, "is_outdoor": false, "is_public": false, "name": "Living Room Sensor", "ota": { "progress": 40, "status": "up_to_date", "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"}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"}