Open kmasiello opened 3 years ago
+1
I came across a use case today where I needed to get the details of a specific user (e.g. this endpoint: /v1/users/{guid}).
The only working solution I found was to call the API directly:
library(connectapi)
library(glue)
library(httr)
client <- connect()
user_guid <- user_guid_from_username(client, "sam.edwardes")
api_key <- Sys.getenv("CONNECT_API_KEY")
response <- GET(
glue("{client$server}/__api__/v1/users/{user_guid}"),
add_headers(Authorization = glue("Key {api_key}"))
)
user_data <- content(response)
user_data$email
Many Connect API endpoints have optional filters for queries. Simplify
connectapi
queries by implementing these filters.get_groups
prefix
: Filters groups by prefix (group name).non-existent
get_instrumentation
(akaget_shiny
andget_content
)content_guid
: Filter results by content GUID.get_users
prefix
: Filters users by prefix (username, first name, or last name).user_role
: Filters by user role.account_status
: Filter by account status.