List public devices for the community map
GET
/public/map/devices
const url = 'https://localhost:8080/api/v1/public/map/devices';const options = {method: 'GET'};
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/public/map/devicesReturns the latest complete sample for devices whose owners explicitly publish both readings and exact location.
Responses
Section titled “Responses”OK
Media typeapplication/json
object
data
Array<object>
object
aqi
integer
id
string
is_outdoor
boolean
lat
number
lon
number
measured_at
string
name
string
pm2_5
number
status
string
temperature
number
Examplegenerated
{ "data": [ { "aqi": 1, "id": "example", "is_outdoor": true, "lat": 1, "lon": 1, "measured_at": "example", "name": "example", "pm2_5": 1, "status": "example", "temperature": 1 } ]}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"}