Years ago I wrote a little article on how to find SharePoint GUIDs for SharePoint 2007. Later I wrote one on how to find the same GUIDs using PowerShell.
Now, here's how to find GUIDs for just about anything using SharePoint 2013's REST web services! The following will work for both on premises and SharePoint Online / Office 365.
SharePoint 2013 includes a REST service to access sites, lists and items. In the data that's returned is an ID that is the GUID for the item.
Accessing REST is quite easy as you only need to type it into the address bar of your browser! REST does not work around security, so you will still need to authenticate to your site.
In the examples below "yourdomain" will of course be replaced with your domain name. If using Office 365 it might look like "http://companyname.sharepoint.com.
If you get a result that looks like this…
… you can either use the View Source feature of the browser to see the XML or change the way the browser displays XML. For Internet Explorer: Tools, Internet Options, Content tab, Feeds and Web Slices Settings and then uncheckmark "Turn on feed reading view",
Getting the GUID for your subsite (and a lot more…)
Visit your site, login and then edit your URL to look like this:
Scroll down to the content section and look for the ID element.
For other objects… sites, lists, items, fields, users…
See the references at the end of this article for even more examples.
The current site collection:
Web and Site Features and their GUIDs:
A single list (by name):
/_api/web/Lists(guid'c61dc1a2-4982-4dc8-9d78-603d83d81940') (of course using your list's GUID!)
All list items:
A single list item:
/_api/web/Lists/getbytitle('tasks')/items(12) (Item with the ID of 12)
List items by criteria:
/_api/web/Lists/getbytitle('tasks')/items?$filter=Status eq 'Not Started'
All list columns, including both display name and internal name!
Especially note these two elements:
The current user:
/_api/web/CurrentUser (No GUID here, but there are other goodies!)
There's a lot more that you can do with SharePoint 2013's REST services!
- Understanding and Using the SharePoint 2013 REST Interface
- REST API reference and samples
- or just to a search!