series_batch {Rduinoiot}R Documentation

Batch queries API methods

Description

[Experimental]

Returns the batch of time-series data or last data point for a property of given thing (note: this API method is bugged and waiting to be fixed by Arduino team. Here for completeness and future developments but would not suggest using it)

Official documentation:

Usage

series_batch_query(
  from,
  to,
  interval = NULL,
  Q,
  SeriesLimit = NULL,
  store_token = "option",
  token = NULL,
  silent = FALSE
)

series_batch_query_raw(
  from,
  to,
  interval = NULL,
  Q,
  SeriesLimit = NULL,
  store_token = "option",
  token = NULL,
  silent = FALSE
)

series_batch_last_value(
  thing_id,
  property_id,
  store_token = "option",
  token = NULL,
  silent = FALSE
)

Arguments

from

A Posixct or Date object. Get data with a timestamp >= to this value

to

A Posixct or Date object. Get data with a timestamp < to this value

interval

(numeric) Resolutions in seconds (seems not to affect results)

Q

The query. (Not clear what this means but allows to chose among properties by filling in, for instance, ⁠property.fbf34284-91f0-42be-bbf6-dd46cfb3f1e0⁠)

SeriesLimit

Maximum number of values (seems not to affect results)

store_token

Where your token is stored. If option it will be retrieved from the .Rprofile (not cross-session and default), if envir it will be retrieved from environmental variables list (cross-session)

token

A valid token created with create_auth_token or manually. It not NULL it has higher priority then store_token

silent

Whether to hide or show API method success messages (default FALSE)

thing_id

The id of the thing

property_id

The id of the property

Value

A tibble showing of time and value for properties

Examples

## Not run: 
Sys.setenv(ARDUINO_API_CLIENT_ID = 'INSERT CLIENT_ID HERE')
Sys.setenv(ARDUINO_API_CLIENT_SECRET = 'INSERT CLIENT_SECRET HERE')

create_auth_token()

### series_batch_query ###
series_batch_query(from = "2022-08-15", to = "2022-08-22",
Q = "property.fbf34284-91f0-42be-bbf6-dd46cfb3f1e0")

### series_batch_query_raw ###
series_batch_query_raw(from = "2022-08-15", to = "2022-08-22",
Q = "property.fbf34284-91f0-42be-bbf6-dd46cfb3f1e0")

### series_batch_last_value ###
thing_id = "b6822400-2f35-4d93-b3e7-be919bdc5eba"
property_id = "fbf34284-91f0-42be-bbf6-dd46cfb3f1e0"

series_batch_last_value(thing_id = thing_id, property_id = property_id)

## End(Not run)

[Package Rduinoiot version 0.1.0 Index]