Learn R Programming

pushoverr (version 0.1.4)

validate_key: Determine whether or not a given user/group key is valid

Description

validate_key issues a query to Pushover to determine whether or not a given user (or group) key is valid. If a device is specified, the query will also see if the given device is registered to that user.

is.valid_key returns a boolean value indicating whether the user/device is valid (TRUE) or not (FALSE).

Usage

validate_key(user, device = NA_character_, ...)
is.valid_key(user, device = NA, ...)

Arguments

user
A user or group key (e.g., 'uQiRzpo4DXghDmr9QzzfQu27cmVRsG')
device
A device name (e.g., 'phone')
...
Any additional parameters, such as an application token set_pushover_app.

Value

validate_key returns a PushoverResponse object containing the response from the serveris.valid_key returns a boolean value indicating whether the user/device is valid (TRUE) or not (FALSE).

Examples

Run this code
## Not run: 
# response <- validate_key(token='KzGDORePK8gMaC0QOYAMyEEuzJnyU',
#                          user='uQiRzpo4DXghDmr9QzzfQu27cmVRsG')
# response_dev <- validate_key(token='KzGDORePK8gMaC0QOYAMyEEuzJnyU',
#                              user='uQiRzpo4DXghDmr9QzzfQu27cmVRsG',
#                              device='phone')
# 
# if(is.valid_key(token='KzGDORePK8gMaC0QOYAMyEEuzJnyU',
#                 user='uQiRzpo4DXghDmr9QzzfQu27cmVRsG',
#                 device='phone'))
# {
#      cat('I can send to this device!')
# }
# ## End(Not run)

Run the code above in your browser using DataLab