Forum Discussion
Arun C
Jun 30, 2017Copper Contributor
Activate Site Feature through REST API
I'm trying to activate site level feature by using REST API in SharePoint Hosted App. I've given full control at Site Collection & Site level with App only Calls. But I'm getting "Access Denied Error...
Arun C
Jul 11, 2017Copper Contributor
Hi Pieter Veenstra,
Thanks for your comment..
I've tried the same within SHA, But still facing issues.s
Code:
$pnp.sp.crossDomainWeb(addinweb, hostweb).get().then(function (success) {
success.web.features.add("a7a2793e-67cd-4dc1-9fd0-43f61581207a").then(r =>
{
console.log(r);
}).catch(function (err)
{
console.log(err);
});
}).catch(function (err) {
console.log(err);
});
I'm getting error
TypeError: Cannot read property 'features' of undefined
Jul 11, 2017
Does instead of
$pnp.sp.crossDomainWeb(addinweb, hostweb).get().....
maybe somethign like this work:
$pnp.sp.crossDomainWeb(addinweb, hostweb).features........