Skip to contents

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

Official documentation:

Usage

things_tags_upsert(
  thing_id,
  key,
  value,
  store_token = "option",
  token = NULL,
  silent = FALSE
)

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

things_tags_delete(
  thing_id,
  key,
  store_token = "option",
  token = NULL,
  silent = FALSE
)

Arguments

thing_id

The id of the thing

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 thing

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()

thing_id = "b6822400-2f35-4d93-b3e7-be919bdc5eba"

### create/modify tag ###
things_tags_upsert(thing_id = thing_id, key = "1", value = "test")

### check tags list ###
things_tags_list(thing_id = thing_id)

### delete tag ###
things_tags_delete(thing_id = thing_id, key = "1")
}