Forum Discussion
Chip Cooper
Jul 12, 2020Copper Contributor
REST API turn on reporting site collection feature
We can turn this feature on via PowerShell PnP, but need to do it via PowerAutomate REST API call. I have the following...see attached image...for our FLOW REST API call. When I run the FLOW I get:...
Krishant Lodhia
Aug 31, 2020Brass Contributor
Chip Cooper I think you are missing /feature/add.
https://www.c-sharpcorner.com/article/working-with-sharepoint-web-scope-features-using-csom-powers/
Excerpt:
// Enables site collection feature (Site scoped feature)
function EnableSiteCollectionFeature(){
var featuresURI = sitecollectionURL + "/_api/site/features/add('151d22d9-95a8-4904-a0a3-22e4db85d1e0')"; // Cross-Site Collection Publishing Feature ID
$.ajax({
url: featuresURI,
method: 'POST',
headers: {
"Accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
success: function (data) {
console.log("Feature Activated");
},
error: function(data) {
console.log(data.responseJSON.error.message.value);
}
});
}