Skip to contents

Returns all organisations accessible to the authenticated user as a list of label/value pairs, suitable for use in Shiny selectInput() choices.

Usage

fetch_org_options(token = NULL, sandbox = is_sandbox_mode())

Arguments

token

Character. Authentication token. When not supplied, it is resolved for the current Shiny session (the token stored by server_wrapper()) and otherwise falls back to the CSIAPPS_ACCESS_TOKEN environment variable.

sandbox

Logical. When TRUE (the default in development), no network call is made and the local dummy registry is returned (the orgs registered with create_sport_org()). Set to FALSE to fetch real organisations from the API. Defaults to is_sandbox_mode().

Value

A list of named lists, each with label (organisation name) and value (organisation ID).

See also

fetch_profiles() to fetch profiles, set_institute() to configure the target institute.

Examples

if (FALSE) { # \dontrun{
set_institute("csiontario")
orgs <- fetch_org_options(sandbox = FALSE)
selectInput("org", "Organisation", choices = orgs)
} # }