Measurements

Read Last

GET https://interay.io/api/v1/measurements/read/last

Read last measurement(s)

type

object

properties

  • device

The device unique identifier. Device Unique ID / Device External key

type

string (UUID) / string

  • entity

The parent unique identifier. Product Unique ID / Location Unique ID / Device Unique ID

type

string (UUID)

Response

type

array

items

type

object

properties

  • metric

Product Unique ID and Metric External key

type

string

pattern

product_uid:external_key

  • value

Measurement value

type

boolean / number / object (Location) / object / string

  • aggregated

Measurement aggregation

enum

derivative.1s, derivative.1m, derivative.1h, last

  • entity

The device unique identifier. Device Unique ID

type

string (UUID)

  • timestamp

Measurement date/time

type

number (Unix time)

Notes

  1. Request device and entity are mutually exclusive.

  2. Response timestamp is in decimal seconds with millisecond precision.

Example request

GET https://interay.io/api/v1/measurements/read/last?device=00000000-0000-0000-0000-000000000000
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Example response

200 OK
Content-Type: application/json
[
        {
                "metric": "99999999-9999-9999-9999-999999999999:temperature",
                "value": 1.0,
                "aggregated": "last",
                "entity": "00000000-0000-0000-0000-000000000000",
                "timestamp": 1767222000.001
        },
        {
                "metric": "99999999-9999-9999-9999-999999999999:state",
                "value": "ok",
                "aggregated": "last",
                "entity": "00000000-0000-0000-0000-000000000000",
                "timestamp": 1767222000.001
        }
]

Read History

GET https://interay.io/api/v1/measurements/read

Read measurement(s)

type

object

properties

  • devices

type

array

items

The device unique identifier. Device Unique ID / Device External key

type

string (UUID) / string

  • entities

type

array

items

The parent unique identifier. Product Unique ID / Location Unique ID / Device Unique ID

type

string (UUID)

  • metrics

type

array

items

Metric External key

type

string

  • timeRangeStart

The beginning of the queried time range

type

number (Unix time) / string (Duration) / string (ISO 8601)

  • timeRangeStop

The end of the queried time range

type

number (Unix time) / string (Duration) / string (ISO 8601)

  • windowPeriod

The period of aggregated data

type

number (seconds) / string (Duration)

Response

type

array

items

type

object

properties

  • metric

Product Unique ID and Metric External key

type

string

pattern

product_uid:external_key

  • value

Measurement value

type

boolean / number / object (Location) / object / string

  • aggregated

Measurement aggregation

enum

derivative.1s, derivative.1m, derivative.1h, last, max, mean, min

  • entity

The device unique identifier. Device Unique ID

type

string (UUID)

  • timestamp

Measurement date/time

type

number (Unix time)

Notes

  1. Request devices and entities are mutually exclusive.

  2. Request timeRangeStart and timeRangeStop should have a negative Duration.

  3. Response timestamp is in decimal seconds with millisecond precision.

Example request

GET https://interay.io/api/v1/measurements/read?devices=00000000-0000-0000-0000-000000000000&timeRangeStart=-1d
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Example response

200 OK
Content-Type: application/json
[
        {
                "metric": "99999999-9999-9999-9999-999999999999:temperature",
                "value": 1.0,
                "aggregated": "last",
                "entity": "00000000-0000-0000-0000-000000000000",
                "timestamp": 1767222000.001
        },
        {
                "metric": "99999999-9999-9999-9999-999999999999:state",
                "value": "ok",
                "aggregated": "last",
                "entity": "00000000-0000-0000-0000-000000000000",
                "timestamp": 1767222000.001
        }
]

Write

POST https://interay.io/api/v1/measurements/write

Write measurement(s)

type

object

properties

  • device

The device unique identifier. Device Unique ID / Device External key

type

string (UUID) / string

  • measurements

The device measurement(s)

type

array

items

type

object

properties

  • metric

Metric External key

type

string

  • value

Measurement value

type

boolean / number / object (Location) / object / string

  • timestamp

Measurement date/time

type

number (Unix time) / string (ISO 8601)

default

Server’s current time

Example request

POST https://interay.io/api/v1/measurements/write
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type: application/json
{
        "device": "00000000-0000-0000-0000-000000000000",
        "measurements": [
                {
                        "metric": "temperature",
                        "value": 1.0,
                        "timestamp": "2019-09-26T07:58:30.996+0200",
                },
                {
                        "metric": "state",
                        "value": "ok",
                        "timestamp": "2019-09-26T07:58:30.996+0200",
                }
        ]
}

Example response

200 OK