Reputation: 33
I am trying to use Microsoft Graph beta getAllMessage api to get all messages from all teams chats. This is the getAllMessage url below: https://learn.microsoft.com/en-us/graph/api/chats-getallmessages?view=graph-rest-beta
The problem is I am always getting Unknown Error and Unauthorized 401 response and I have consented all the permission as the pic shown:
I also found a Note shown this api is a Protected API in Microsoft Teams.
But I can not see this getAllMessage api in the list of Protected API.
I am starting getting lost now. Hope someone knows the real cause of this problem and let me know whether should I submit the Protected API request form or not.
Thanks
Di
Upvotes: 0
Views: 562
Reputation: 2464
I see that you're calling Getallmessages() and facing the error. Yes the documentation is correct. As you're calling application permission and getting the messages/chat then it comes under protected api's - so you need to submit the request, get approval as discussed in the document. This will help you move forward.
Upvotes: 2