Hi @Andrei Papou
It seems that you are getting an unauthorized operation error while trying to use the SharePoint search API with your app.
This could be due to several reasons, such as:
1.Your app does not have the required permissions to access the SharePoint content. You may need to grant your app more permissions, such as Full Control for the site collection or web scope.
2.Your app has not been trusted by the site collection administrator. You may need to request or approve the app permissions in the SharePoint admin center.
3.Your app token has expired or is invalid. You may need to refresh or regenerate your app token using the appropriate authentication method56.
To troubleshoot this issue, you can try the following steps:
Check the permissions of your app in the SharePoint admin center and make sure they match your app manifest file.
Check the status of your app in the SharePoint app catalog and make sure it is approved and installed.
Check the validity of your app token and make sure it is not expired or corrupted.
Check the syntax and format of your search query and make sure it is valid and supported by the SharePoint search API.
Hope these are useful to you
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