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. Users seeking to access a
SharePoint subsite must provide the site_id instead of a site_url or
site_name value. You can see available subsite ID values by using the
list_subsites() method for Microsoft365R::ms_site objects.
Usage
get_sp_site(
site_url = NULL,
site_name = NULL,
site_id = NULL,
...,
cache = getOption("sharepointr.cache", FALSE),
refresh = getOption("sharepointr.refresh", TRUE),
overwrite = FALSE,
cache_file = NULL,
call = caller_env()
)
cache_sp_site(
...,
site = NULL,
cache_file = NULL,
cache_dir = NULL,
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_idmust be supplied.- ...
Arguments passed on to
Microsoft365R::get_sharepoint_siteappA custom app registration ID to use for authentication. See below.
scopesThe Microsoft Graph scopes (permissions) to obtain. It should never be necessary to change these.
tokenAn AAD OAuth token object, of class
AzureAuth::AzureToken. If supplied, thetenant,app,scopesand...arguments will be ignored. See "Authenticating with a token" below.tenantFor
get_business_onedrive,get_sharepoint_siteandget_team, the name of your Azure Active Directory (AAD) tenant. If not supplied, use the value of theCLIMICROSOFT365_TENANTenvironment 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_siteobject.- overwrite
If
TRUE, replace the existing cached object named bycache_filewith the new object. IfFALSE, error if a cached file with the samecache_filename already exists.- cache_file
File name for cached drive or site. Default
NULL.- 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 thecallargument ofabort()for more information.- site
A
ms_siteobject. Ifsiteis supplied,site_url,site_name, andsite_idare ignored.- cache_dir
Cache directory. By default, uses an option named "sharepointr.cache_dir". If "sharepointr.cache_dir" is not set, the cache directory is set to
rappdirs::user_cache_dir("sharepointr").