Our goal is to query the Sharepoint Search API and fetch all files from OneDrive (my drives/personal sites) where the search input exists in the content. We are using the following query:
POST https://[tenantName].sharepoint.com/_api/search/postquery
Body: { "request": { "Querytext": "abc", "RefinementFilters": [ "Path:\"https://[tenantName]-my.sharepoint.com/personal*\"" ] } }
But no results are being returned, when we remove the RefinementFilters
, search api is returning responses from sharepoint sites, but we want search on Onedrive only. we have added all the permissions required, to use this api (mentioned here : https://docs.microsoft.com/en-gb/archive/blogs/vesku/using-add-in-only-app-only-permissions-with-search-queries-in-sharepoint-online).
Are we missing any anything here? is there special configuration required for onedrive? Any help will be appreciated. TIA.
refiners='Path'
part