Introduction

In this article, you will learn how to retrieve, enable or disable the site features (Web Scoped features) programmatically using REST API on SharePoint 2013 / SharePoint online. Here, we will see in detail about the usage of REST API to complete these operations. The web scoped features are present on this page.

Steps Involved

Get Active Site Features and Properties (Web scope)
The operation will fetch all the active site features (web scoped) present on the site or sub site.

Get/Check Site Feature Properties/Status (Web scope)

Here, we will see how we can get the particular feature and check whether the site feature (Web Scoped) is active or not. You can identify whether the feature is activated at Web Scope or not.

Activate the site feature (Web scope)

In the above section, we saw how we can check the status of the site feature (Web Scoped). Here, we will see how we can activate the feature which is already installed on the site.

Deactivate the site feature (Web scope)

In the above section, we have seen how we can activate the site feature (Web Scoped). Here, we will see how we can deactivate the feature.

Note - The above set of operations needs to be called in order to execute it.

  1. $(document).ready(function(){
  2. GetSiteFeatures(); // Retrieves all the site features enabled (web scoped features)
  3. GetSiteFeatureByID(); // Retrieves all the site features enabled (web scoped features)
  4. EnableSiteFeature(); // Enables site feature (web scoped feature)
  5. DisableSiteFeature(); // Disables site feature (web scoped feature)
  6. });
Summary

You learned how to retrieve, activate, or de-activate the site features (Web Scoped) using REST API on SharePoint 2013 / SharePoint online sites.