Contents
I have a SharePoint site wich I named ”Portal” and under Portal I have several communities (subsites). For each subsite I disabled permission inheritance and I setted up the groups and roles manually. On the portal main page, I list every community the user can access with this code :
How can I get a list of all subsites?
Check the below screenshot which shows the deep subsite. ✅ If you just want to get a list of site & subsite URLs, you can cheat slightly. Instead of looking for the sites or subsites, look for a /path/to/newsfeed.aspx entry instead. This appears to be present for all sites and subsites.
How to get deep subsites in JavaScript?
In a site structured like so, only the checked (✅) sites and subsites are being returned in the response: You need to use STS_Site and STS_Web both in your queryText. Am able to get deep subsites as well using the above endpoint .
You can use the Search REST service to submit Keyword Query Language (KQL) or FAST Query Language (FQL) queries in your SharePoint Add-ins, remote client applications, mobile applications, and other applications. The Search REST service supports both HTTP POST and HTTP GET requests.
Using the SharePoint Online REST API, I’m trying to retrieve a list of all sites and subsites. Either of these APIs gives me all sub-sites of the root top level site:
How to get site contents using REST API?
REST API – https:// ktskumar.sharepoint.com/_api/Web/GetSubwebsFilteredForCurrentUser (nWebTemplateFilter=-1)?$filter=WebTemplate ne ‘APP’ Each tab sends a separate REST API request to get the respective data from the SharePoint. Below is the sample JavaScript code to get the lists of available Lists, Librarie, and Apps from the site.