Feature management
Operations for features management
You can activate and deactivate features on sites and webs using REST API. However, there are a few nuances to know knowing which makes it simple to manage the features.
You should know specific feature definition ID to add or remove it.
Unfortunately, there is no way of getting features list with names and descriptions programmatically. When getting features list on the web or site you receive a list of activated features definition IDs and nothing else.
Getting activated features
Luckily, nowadays one almost always deal only with OOTB features, if not probably something is terribly wrong on a project. 😝
Feature activating
The first argument stands for Feature Definition ID, the second one is force mode.
Feature deactivating
Arguments are identical.
When a feature was not activated before removing it an error message is expected ("Feature is not activated at this scope").
Site level actions are absolutely identical, the only difference is sp.Site()
entry point.
Last updated