get_sp_site()
is a wrapper for Microsoft365R::get_sharepoint_site()
and
returns a ms_site
object. cache_sp_site()
allows you to cache a default
SharePoint site for use by other functions.
Usage
get_sp_site(
site_url = NULL,
site_name = NULL,
site_id = NULL,
...,
cache = FALSE,
refresh = TRUE,
overwrite = FALSE,
cache_file = getOption("sharepointr.cache_file_site", "sp_site.rds"),
call = caller_env()
)
cache_sp_site(
...,
site = NULL,
cache_file = getOption("sharepointr.cache_file_site", "sp_site.rds"),
cache_dir = "sharepointr.cache_dir",
overwrite = FALSE,
call = caller_env()
)
Arguments
- site_url
A SharePoint site URL in the format "https://[tenant name].sharepoint.com/sites/[site name]". Any SharePoint item or document URL can also be parsed to build a site URL using the tenant and site name included in the URL.
- site_name, site_id
Site name or ID of the SharePoint site as an alternative to the SharePoint site URL. Exactly one of
site_url
,site_name
, andsite_id
must be supplied.- ...
Arguments passed on to
Microsoft365R::get_sharepoint_site
app
A custom app registration ID to use for authentication. See below.
scopes
The Microsoft Graph scopes (permissions) to obtain. It should never be necessary to change these.
token
An AAD OAuth token object, of class
AzureAuth::AzureToken
. If supplied, thetenant
,app
,scopes
and...
arguments will be ignored. See "Authenticating with a token" below.tenant
For
get_business_onedrive
,get_sharepoint_site
andget_team
, the name of your Azure Active Directory (AAD) tenant. If not supplied, use the value of theCLIMICROSOFT365_TENANT
environment variable, or "common" if that is unset.
- cache
If
TRUE
, cache site to a file usingcache_sp_site()
.- refresh
If
TRUE
, get a new site even if the existing site is cached as a local option. IfFALSE
, use the cachedms_site
object.- overwrite
If
TRUE
, replace the existing cached object named bycache_file
with the new object. IfFALSE
, error if a cached file with the samecache_file
name already exists.- cache_file
File name for cached file if
cache = TRUE
. Defaults to"sp_site.rds"
or option set withsharepointr.cache_file_site
.- call
The execution environment of a currently running function, e.g.
caller_env()
. The function will be mentioned in error messages as the source of the error. See thecall
argument ofabort()
for more information.- site
A
ms_site
object. Ifsite
is supplied,site_url
,site_name
, andsite_id
are ignored.- cache_dir
Cache directory. By default, uses an environmental variable named "sharepointr.cache_dir". If "sharepointr.cache_dir" is not set, the cache directory is set to
rappdirs::user_cache_dir("sharepointr")
.