1

I was trying to follow this post for setting the owner of a SharePoint group using client side code. Evidently the REST /_api/web/sitegroups(id)/owners endpoint isn't functional.

The XML formatting requires the SPSite and the SPWeb id/guid. I was able to get the SPWeb id using the /_api/web/id REST endpoint -- easy-peasy!

But I couldn't find any way to get the SPSiteId without using Central Admin or powershell. for example this thread or this one.

I am a site collection admin, but don't have access to Central admin. Using the same web/id endpoint on the site at the site collection would return the web id, but that is different than the site id.

I was poking everywhere in the site settings hoping to find the siteid as a parameter in a url or something, but was unsuccessful until I did Search Configuration Export. I was able to find the SPSiteId in the exported XML.

Is there really no way to get the SPSiteId using REST or some other "in the UI or client side javascript" method?

  • Never mind...I just found out there is a /_api/site/id endpoint. – Rothrock Sep 20 '18 at 19:03
1

Use the /_api/site/id REST Endpoint to locate the desired ID.

Edit:

/_api/site/id 
  • 1
    Thank you. Amazing that during the 30 to 40 minutes I was working on this that never came up in my search results. The difference between googling "SharePoint 2013 SPWeb Id javascript rest" and "SharePoint 2013 site id rest javascript"! – Rothrock Sep 20 '18 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.