send_notifications: Send notifications

Description Usage Arguments Value Author(s) Examples

View source: R/notifications.R

Description

Sends a notification to a user or users. Core API call Send Notifications

Usage

1
send_notifications(server_name, profile_id, access_token, message, users)

Arguments

server_name

String of the iFormBuilder server name.

profile_id

Integer of the iFormBuilder profile ID.

access_token

Access token produced by get_iform_access_token

message

String containing the message to send.

users

Numerical vector containing one or more user IDs, ie c(1234, 3456)

Value

Vector of the user IDs that were successfully notified.

Author(s)

Bill DeVoe, William.DeVoe@maine.gov

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run: 
# Get access_token
access_token <- get_iform_access_token(
  server_name = "your_server_name",
  client_key_name = "your_client_key_name",
  client_secret_name = "your_client_secret_name")

# Get a list of all usernames and user IDs in a profile
all_users_info <- retrieve_all_users(
  server_name = "your_server_name",
  profile_id = 123456,
  access_token = access_token)

# Pull out first user_id in the list
user_ids = all_users_info$id

# Send a notification
notified_user_ids <- send_notifications(
  server_name = "your_server_name",
  profile_id = 123456,
  message = "Please sync your device",
  users = user_ids,
  access_token = access_token)

## End(Not run)

arestrom/iformr documentation built on Nov. 25, 2021, 11:21 p.m.