For SharePoint Online connector We used following steps to fetch all sites:
Step 1: Created Add-in on SharePoint instance with following permission xml
<AppPermissionRequests>
<AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl"/>
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="Read"/>
</AppPermissionRequests>
Step 2: Used below API to get all sites and subsites
https://<site_name>.sharepoint.com/_api/search/query?querytext='contentclass:STS_Site' &rowlimit=100
Issue we are facing –
- Above endpoint is returning all
sites, sub sites along with user’s personal site(One drive)
, while we need allsites and sub sites
only. - Please suggest minimal required permission to read all site, all subsite, all folders and files metadata
We referred following links: