Hi@Valentine2922,
Judging from the error message you provided, the reasons for the current problem are as follows:
- Verify the authentication method: Make sure you are using the correct authentication method to access the SharePoint Search API. Depending on your scenario, you might need to use a different authentication method, such as user context or app-only context. Make sure to use the appropriate method for your application.
- Check the access token: If an access token was used to authenticate the API request, verify that the access token was correctly obtained and included in the request header. Make sure the token has the required permissions to access the search functionality.
- Verify application permissions: If you are using an application-only context, verify that your application has the required permissions to access the SharePoint Search API. This involves configuring the necessary permissions in the application manifest or in the application permission request page.
- Grant appropriate permissions: Make sure the user or application context has the appropriate permissions to perform the search operation. Check the user's permissions in SharePoint to make sure they have the access they need to perform the search.
- Validate API endpoints and parameters: Double-check the API endpoint URL and query parameters used in the request. Make sure the URL is correct and matches the target site and tenant. Review the query parameters and syntax to make sure they are well-formed. .
- Cross-tenant access issues
Considering that none of the above five problems are correct in your description, please check the tenant's access policy.
Cross-tenant access may be restricted by the target tenant's security policies and configurations. Therefore, before implementing cross-tenant access, it is recommended to communicate with the administrator of the target tenant to ensure that you comply with their requirements and restrictions
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards
Cheng Feng