-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnc_msg.R
More file actions
29 lines (23 loc) · 865 Bytes
/
nc_msg.R
File metadata and controls
29 lines (23 loc) · 865 Bytes
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
26
27
28
29
require(httr)
# nextcloud_user ---------------------------------------------------------------
get_username <- function()
{
Sys.getenv("NC_USERNAME")
}
# nextcloud_password -----------------------------------------------------------
get_password <- function()
{
Sys.getenv("NC_PASSWORD")
}
# nextcloud_url ----------------------------------------------------------------
nextcloud_url <- function()
{
Sys.getenv("NEXTCLOUD_URL")
}
id = get_username() # Find username in user management view
password = get_password()
result <- POST("https://cloud.ecosysl.net/ocs/v2.php/apps/spreed/api/v1/chat/i6guskvx",
body = {'message':
"Today's report at https://www.google.com.au/"},
add_headers(.headers = c("Accept"="application/json","cache-control"="no-cache", "OCS-APIRequest"="true")))
# TODO: figure out a way to get username and password to pass as auth