We want to let external users search for documents in our SharePoint.
For this we created a web API that gets an acces token (delegation) for MS Graph and executes the Search query.
This works fine for our own users but executing the query for external users (Guest users in our tenant) we get a BadRequest response.
The request we do:
{
"requests": [
{
"entityTypes": ["driveItem"],
"query": {
"queryString": "lorum path:\"https://mytenant.sharepoint.com/sites/subsite\""
}
}
]
}
The BadRequest response we get
{
"error": {
"code": "BadRequest",
"message": "\r\n The call failed, please try again.",
"innerError": {
"date": "2021-05-17T10:27:49",
"request-id": "SOME_ID",
"client-request-id": "SOME_ID"
}
}
}
I couldn't find anywhere if the call should work for external users. BadRequest responses often suggest that some incorrect permissions but we can't figure out what permissions we need to give.
Any information on this topic is welcome!