Set Sites.Selected permissions
NOTE: This article is related to setting Graph API Permissions
Â
Add the Sites.Selected permissions under App registration / API permissions and ensure it is granted.
Get site ID
For the upcoming step, we need the site id. The easiest is to append ‘_api/site/id’ to the site url. E.g.
https://<yoursite>.sharepoint.com/sites/<subsite>/_api/site/id
Make a note with a copy of the id.
Another option is to is Graph Explorer with GET request:
https://graph.microsoft.com/v1.0/sites/<yoursite>.sharepoint.com:/sites/<subsite>
Â
Allow Application to access the Site
Â
We need to make another API call to allow our voyager app to access the site of the id we get in the previous step. In order to do so we can use Microsoft graph explorer and do POST request to the permission endpoint with the siteId:
Â
https://graph.microsoft.com/v1.0/sites/{site-id}/permissions
Â
And post the JSON body with the application ID:
{
  "roles": ["read"],
  "grantedToIdentities": [{
    "application": {
      "id": "e92eac42-4eac-469f-b680-fa95bbe7f0ac",
      "displayName": "Voyager app"
    }
  }]
}
Â
Â
Â
If you get a forbidden exception you might need to allow Graph Explorer to set up site permissions by granting Sites.Manage.All.
Â
Another valuable source:
Â
Â
Once done the Indexing should properly work and no other permissions should be needed.
Â