Skip to contents

Upsert (create/update), List and Delete tags associated to a given device

Official documentation:

Usage

devices_tags_upsert(
  device_id,
  key,
  value,
  store_token = "option",
  token = NULL,
  silent = FALSE
)

devices_tags_list(
  device_id,
  store_token = "option",
  token = NULL,
  silent = FALSE
)

devices_tags_delete(
  device_id,
  key,
  store_token = "option",
  token = NULL,
  silent = FALSE
)

Arguments

device_id

The id of the device

key

The key of the tag (no spaces allowed)

value

The value of the tag (no spaces allowed)

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)

Value

A tibble showing information about chosen tag or list of tags for given device

Examples

if (FALSE) {
# Sys.setenv(ARDUINO_API_CLIENT_ID = 'INSERT CLIENT_ID HERE')
# Sys.setenv(ARDUINO_API_CLIENT_SECRET = 'INSERT CLIENT_SECRET HERE')

create_auth_token()

device_id = "fa7ee291-8dc8-4713-92c7-9027969e4aa1"
### create/modify tag ###
devices_tags_upsert(device_id = device_id, key = "1", value = "test")

### check tags list ###
devices_tags_list(device_id = device_id)

### delete tag ###
devices_tags_delete(device_id = device_id, key = "1")
}