Skip to main content

Reading Data

Most resources live under a Space: /v2/spaces/{space_id}/…. Every example needs an <api-key> (see Authentication) and a <space-id>.

List your spaces

curl -H 'X-API-KEY: <api-key>' \
'https://api.hardwario.cloud/v2/spaces'

List devices in a space

GET /v2/spaces/{space_id}/devices — supports limit, offset, name, serial_number, tag_ids, and sort_by/order_by query parameters.

curl -H 'X-API-KEY: <api-key>' \
-H 'Accept: application/json' \
'https://api.hardwario.cloud/v2/spaces/<space-id>/devices?limit=500'

Read a device's messages

GET /v2/spaces/{space_id}/messages — filter with these query parameters:

ParameterDescription
device_idOnly messages from this device
tag_idOnly messages from devices with this tag
type[]Message type(s): data, session, config, … (repeatable)
directionup (from device) or down (to device)
after / beforeTime range (ISO-8601)
limitMax messages to return
offsetUUID of the last message read — the pagination cursor
curl -H 'X-API-KEY: <api-key>' \
-H 'Accept: application/json' \
'https://api.hardwario.cloud/v2/spaces/<space-id>/messages?device_id=<device-id>&limit=100'
Defaults differ from the web interface

Over the API, after defaults to 24 hours ago and limit defaults to 20. If you see messages in the web but not over the API, widen after and raise limit.

Latest value only — ask for one message, newest first:

curl -H 'X-API-KEY: <api-key>' \
'https://api.hardwario.cloud/v2/spaces/<space-id>/messages?device_id=<device-id>&type[]=data&limit=1'

Pagination

Page through large result sets with limit plus offset (pass the id of the last item you received as the next request's offset). For messages you can also walk a time window with after/before.