2 minute read

The SharePoint Representational State Transfer (REST) API allows developers to perform CRUD (Create, Read, Update & Delete) operations from client-side code. These operations are similar to the SSOM (Server-Side Object Model), which was how developers created solutions in SharePoint 2007 & 2010 environments. The REST API was initially introduced in SharePoint 2013, but has been expanded in SharePoint 2016/2019/Online.

2013 Documentation

Online Documentation

Global Variable

The gd-sprest library will add a $REST global variable to the DOM. The $REST variable contains the following properties and helper libraries, shown below.

Version Control

The $REST.__ver property will display the version number being used. If multiple versions are loaded, the latest version will automatically take precedence.

Available Endpoints

The SharePoint REST API can be accessed by https://[tenant].sharepoint.com/_api/[endpoint]. The table below displays a list of the supported REST API endpoints in this library.

Name Description Code Documentation Result Type
$REST.App The _api/apps endpoint. Documentation N/A
$REST.ContextInfo The page context information. Documentation Result Type
$REST.GroupService The _api/groupservice endpoint. Documentation N/A
$REST.GroupSiteManager The _api/groupsitemanager endpoint. Documentation N/A
$REST.HubSites The _api/hubsites endpoint. Documentation Result Type
$REST.HubSitesUtility The _api/hubsitesutility endpoint. Documentation N/A
$REST.List Get/Set data related to lists. Documentation Result Type
$REST.ListDataAsStream Gets list data which have complex fields. Documentation N/A
$REST.Navigation Gets information from the navigation nodes. Documentation N/A
$REST.PeopleManager The _api/SP.UserProfiles.PeopleManager endpoint. Documentation N/A
$REST.PeoplePicker The _api/SP.UI.ApplicationPages.ClientPeoplePickerWebServiceInterface endpoint. Documentation N/A
$REST.ProfileLoader The _api/sp.userprofiles.profileloader.getprofileloader endpoint. Documentation N/A
$REST.RemoteWeb The _api/SP.RemoteWeb endpoint. Documentation Result Type
$REST.Search The _api/search endpoint. Documentation Result Type
$REST.Site Get/Set the site data. Documentation Result Type
$REST.SiteExists Determines if a site exists by url. Documentation N/A
$REST.SiteUrl Gets the site url by id. Documentation N/A
$REST.SocialFeed The _api/social.feed endpoint. Documentation Result Type
$REST.ThemeManager The _api/thememanager endpoint. Documentation N/A
$REST.UserProfile The _api/sp.userprofiles.profileloader.getprofileloader/getUserProfile endpoint. Documentation N/A
$REST.Utility The _api/SP.Utilities.Utility endpoint. Documentation N/A
$REST.Web Gets the web data from within the web application. Documentation Result Type
$REST.WorkflowInstanceService The _api/SP.WorkflowServices.WorkflowInstanceService.Current endpoint. Documentation N/A
$REST.WorkflowSubscriptionService The _api/SP.WorkflowServices.WorkflowSubscriptionService.Current endpoint. Documentation N/A