Sharepoint Search API not working.

Copper Contributor

When i am trying to call SharePoint search API via postman, i am getting below error. I have tried other SharePoint API and they working fine for me but when i am call search query API via Postman i am repeatedly getting below error.

 

API URL :- https://tenantname.sharepoint.com/_api/search/query?querytext='TestingFolder'

 

{ "odata.error": { "code": "-1, Microsoft.Office.Server.Search.REST.SearchServiceException", "message": { "lang": "en-US", "value": "Unauthorized." } } }

I have tried below AppPermissionRequests for my generated client_id.

 

<AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="https://sharepoint/content/tenant" Right="FullControl" /> </AppPermissionRequests>

<AppPermissionRequests> <AppPermissionRequest Scope="http://sharepoint/search" Right="QueryAsUserIgnoreAppPrincipal" /> </AppPermissionRequests>

<AppPermissionRequests> <AppPermissionRequest Scope="http://sharepoint/search" Right="FullControl" /> </AppPermissionRequests>

 

these permission i have applied in appinv.asxp page.
but still i am facing the same issue again and again.

please let me how to resolve this issue.

0 Replies