spservice: REST API request from SharePoint

Description Usage Arguments Details Value Examples

View source: R/core_api.R

Description

Implement a REST API request. This function wraps up an API request into single uri and calls it

Usage

1
spservice(service, site, site_collection)

Arguments

service

an api request.

site

a SharePoint site name, e.g. '/ExpertGroups/WGNSSK'. The default is to take the value of getOption("icesSharePoint.site").

site_collection

a SharePoint site collection, will almost exclusively be 'https://community.ices.dk', so these functions should work for other SharePoint sites outside ICES. The default is to take the value of getOption("icesSharePoint.site_collection").

Details

The requests always ask for json data, but may on occasion (esp when the request fails) return xml.

Value

The result of the request.

Examples

1
2
3
4
5
6
## Not run: 
 x <- spservice("sitegroups/getbyname('ICES%20staff')/Users")
cbind(sapply(x$results, "[[", "Title"),
      sapply(x$results, "[[", "Email"))

## End(Not run)

ices-tools-prod/icesSharePoint documentation built on June 27, 2021, 5:16 p.m.