Sends a request to the PurpleAirAPI API endpoint described at: https://api.purpleair.com/#api-groups-create-group

pa_createGroup(
  api_key = NULL,
  name = NULL,
  baseUrl = "https://api.purpleair.com/v1/groups"
)

Arguments

api_key

PurpleAir API WRITE key.

name

Human readable name associated with the new group.

baseUrl

URL endpoint for the "Create Group" API.

Value

List containing all members of the specified group.

Examples

# \donttest{
# Fail gracefully if any resources are not available
try({

library(AirSensor)

  pa_createGroup(
    api_key = PURPLE_AIR_API_WRITE_KEY,
    name = "My new group"
  )

}, silent = FALSE)
#> Error in MazamaCoreUtils::stopIfNull(api_key) : 
#>   object 'PURPLE_AIR_API_WRITE_KEY' not found
# }