Di Wang
Di Wang

Reputation: 33

Always getting 'Unknown Error' response when using Microsoft Graph beta getAllMessage api

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: enter image description here

I also found a Note shown this api is a Protected API in Microsoft Teams. enter image description here

But I can not see this getAllMessage api in the list of Protected API.enter image description here

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

Answers (1)

Dev
Dev

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

Related Questions