Add multiple users to a channel in a single API call
add_users_to_channel.RdUses the Mattermost batch endpoint to add up to 1000 users to a channel with a single HTTP request. This is far more efficient than calling [add_user_to_channel()] in a loop.
Usage
add_users_to_channel(
channel_id,
user_ids,
resolve_names = FALSE,
verbose = FALSE,
auth = get_default_auth()
)Arguments
- channel_id
The ID of the channel to add users to.
- user_ids
A character vector of user IDs (max 1000).
- resolve_names
Logical. If `TRUE`, fetches readable usernames and the channel name for the success message (2 extra API calls, regardless of how many users). Defaults to `FALSE` for efficiency.
- verbose
Boolean. If `TRUE`, prints the request details.
- auth
The authentication object created by [authenticate_mattermost()].