Forum Discussion

Sebastian Krück's avatar
Sebastian Krück
Copper Contributor
Sep 11, 2017

SharePoint Online REST Webervice Site Collection Properties

Hello everybody, I've got a question regarding SharePoint Online and REST Webservices. Does anybody know, if it is possible to modify properties of a SharePoint Online Site Collection via REST Webservices? I'm trying to generate a POST request against https://url.sharepoint.com/sites/sitecollection/_api/site. But I always get error messages or "Access denied". And yes, I previously generated those authentication cookies and digest tokens to include them in the header of my request. 

3 Replies

  • Ok, I'm one step closer, but did not find the final solution. I got the Access Denied message, because I was still missing one Access Token in my request header. So, no authentication problems anymore. Now I have error message "400 Bad Request". So I think my body message is wrong. I'm trying to set the shareing capabilities. My body looks like that: { "__metadata": { "type": "SP.Site" }, "ShareByEmailEnabled": "true"}

    Does anybody have an idea, whats wrong? Or is modifying those properties blocked by Microsoft?

    Thanks for your help.

    • Oliver Zeiser's avatar
      Oliver Zeiser
      Brass Contributor
      This won't work. If you want to update the sharing capabilities, you need to set them via siteproperties: https://msdn.microsoft.com/en-us/library/microsoft.online.sharepoint.tenantadministration.siteproperties.sharingcapability.aspx
      • Sebastian Krück's avatar
        Sebastian Krück
        Copper Contributor

        Hi Oliver, 

         

        thanks for your answer. Do you know a page or a TechNet article or anything else, whre it is written down, that it is not possible to set it via REST? 

        And do you or anybody else know, if it is possible to set site collection administrators via REST Webservice?

Resources