How do I differentiate between getchanges REST API call for SPSite and SPWeb?
-
12-12-2020 - |
题
I'm trying to query SPSite for changes but I can't seem to figure out the difference between that and querying SPWeb.
I'm following this documentation
https://msdn.microsoft.com/en-us/library/office/dn499819.aspx#bk_WebGetChanges
Am I querying SPSite or SPWeb, I am confused.
If my site collection is
and I am using the following endpoint
https://abccompany.sharepoint.com/teams/f1/_api/web/getchanges
am I querying SPSite?
解决方案
If you want to query particular object with REST API, you need to use appropriate object in url.
For example consider following REST queries:
- Get changes for site collection:
https://sp.sharepoint.com/sites/dev/_api/site/getchanges(@qry)?@qry=%7b%22Update%22%3atrue%7d
- Get changes for web:
https://sp.sharepoint.com/sites/dev/_api/web/getchanges(@qry)?@qry=%7b%22Update%22%3atrue%7d
- Get changes for a list:
https://sp.sharepoint.com/sites/dev/_api/Lists/getbytitle('MyList')/getchanges(@qry)?@qry=%7b%22Update%22%3atrue%7d
In your case query https://sp.sharepoint.com/teams/f1/_api/web/getchanges
will get changes for SPWeb object.