Learn R Programming

discgolf (version 0.2.0)

users: Work with users

Description

Work with users

Usage

user(username, url = NULL, key = NULL, user = NULL, ...)

users_list(type, url = NULL, key = NULL, user = NULL, ...)

user_create(name, email, username, password, url = NULL, key = NULL, user = NULL, ...)

user_activate(user_id, url = NULL, key = NULL, user = NULL, ...)

user_delete(user_id, url = NULL, key = NULL, user = NULL, ...)

user_update_email(username, email, url = NULL, key = NULL, user = NULL, ...)

user_update_username(username, new_username, url = NULL, key = NULL, user = NULL, ...)

Arguments

username

A user name

url

Base url for a Discourse installation. See disc_setup

key

Your api key on the Discourse installation. See disc_setup

user

Your user name on the Discourse installation. See disc_setup

...

Named parameters passed on to HttpClient

type

A type of user, one of active, staff, new, suspended, blocked, or suspect

name

a name

email

an email address

password

a password

user_id

a user id

new_username

a username

users_list

note that there is no paging, so if you have more than 100 users, you only get the first 100. :sad panda:

Examples

Run this code
# NOT RUN {
# list a user
user('sckott')
user('cboettig')

# list users
users_list('staff')
users_list('new')

# create a user
(x <- user_create("jane doe", "janie@doe.com", "jane_doe",
  "fTh6bmoPaaWrlI5fLDM6wy"))

# activate a user
user_activate(x$user_id)

# upate email address
user_update_email(username = 'jane_doe', email = 'jane2@doe.com')

# upate user name
user_update_username('jane_doe', 'jane_doe5')

# delete a user
user_delete(x$user_id)
# }

Run the code above in your browser using DataLab