SharePoint Online REST Webervice Site Collection Properties

%3CLINGO-SUB%20id%3D%22lingo-sub-104981%22%20slang%3D%22en-US%22%3ESharePoint%20Online%20REST%20Webervice%20Site%20Collection%20Properties%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-104981%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHello%20everybody%2C%20I've%20got%20a%20question%20regarding%20SharePoint%20Online%20and%20REST%20Webservices.%20Does%20anybody%20know%2C%20if%20it%20is%20possible%20to%20modify%20properties%20of%20a%20SharePoint%20Online%20Site%20Collection%20via%20REST%20Webservices%3F%20I'm%20trying%20to%20generate%20a%20POST%20request%20against%26nbsp%3B%3C%2FSPAN%3E%3CA%20title%3D%22https%3A%2F%2Furl.sharepoint.com%2Fsites%2Fsitecollection%2F_api%2Fsite%22%20href%3D%22https%3A%2F%2Furl.sharepoint.com%2Fsites%2Fsitecollection%2F_api%2Fsite%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noreferrer%20noopener%22%3Ehttps%3A%2F%2Furl.sharepoint.com%2Fsites%2Fsitecollection%2F_api%2Fsite%3C%2FA%3E%3CSPAN%3E.%20But%20I%20always%20get%20error%20messages%20or%20%22Access%20denied%22.%20And%20yes%2C%20I%20previously%20generated%20those%20authentication%20cookies%20and%20digest%20tokens%20to%20include%20them%20in%20the%20header%20of%20my%20request.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-114616%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20REST%20Webervice%20Site%20Collection%20Properties%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-114616%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Oliver%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%20for%20your%20answer.%20Do%20you%20know%20a%20page%20or%20a%20TechNet%20article%20or%20anything%20else%2C%20whre%20it%20is%20written%20down%2C%20that%20it%20is%20not%20possible%20to%20set%20it%20via%20REST%3F%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20do%20you%20or%20anybody%20else%20know%2C%20if%20it%20is%20possible%20to%20set%20site%20collection%20administrators%20via%20REST%20Webservice%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-114249%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20REST%20Webervice%20Site%20Collection%20Properties%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-114249%22%20slang%3D%22en-US%22%3EThis%20won't%20work.%20If%20you%20want%20to%20update%20the%20sharing%20capabilities%2C%20you%20need%20to%20set%20them%20via%20siteproperties%3A%20%3CA%20href%3D%22https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fmicrosoft.online.sharepoint.tenantadministration.siteproperties.sharingcapability.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fmicrosoft.online.sharepoint.tenantadministration.siteproperties.sharingcapability.aspx%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-113739%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20REST%20Webervice%20Site%20Collection%20Properties%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-113739%22%20slang%3D%22en-US%22%3E%3CP%3EOk%2C%20I'm%20one%20step%20closer%2C%20but%20did%20not%20find%20the%20final%20solution.%20I%20got%20the%20Access%20Denied%20message%2C%20because%20I%20was%20still%20missing%20one%20Access%20Token%20in%20my%20request%20header.%20So%2C%20no%20authentication%20problems%20anymore.%20Now%20I%20have%20error%20message%20%22400%20Bad%20Request%22.%20So%20I%20think%20my%20body%20message%20is%20wrong.%20I'm%20trying%20to%20set%20the%20shareing%20capabilities.%20My%20body%20looks%20like%20that%3A%26nbsp%3B%7B%20%22__metadata%22%3A%20%7B%20%22type%22%3A%20%22SP.Site%22%20%7D%2C%20%22ShareByEmailEnabled%22%3A%20%22true%22%7D%3C%2FP%3E%3CP%3EDoes%20anybody%20have%20an%20idea%2C%20whats%20wrong%3F%20Or%20is%20modifying%20those%20properties%20blocked%20by%20Microsoft%3F%3C%2FP%3E%3CP%3EThanks%20for%20your%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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.

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.siteproper...

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?