List chat messages via Graph API

%3CLINGO-SUB%20id%3D%22lingo-sub-732776%22%20slang%3D%22en-US%22%3EList%20chat%20messages%20via%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-732776%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20are%20trying%20to%20use%20the%20Beta%20Chat%20APIs%20to%20retrieve%20Chat%20messages%20(1%3A1).%20We%20have%20an%20application%20set%20up%20with%20%22Chat.Read.All%22%20Application%20Permission%20added.%20I%20get%20an%20error%20on%20calling%20any%20of%20the%20list%20chat%20APIs%20(%2Fchats%2C%20%2Fusers%2F%7Bid%7D%2Fchats%2C%20%2Fme%2Fchats).%20The%20response%20comes%20back%20with%20401%20error%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%7B%0A%20%20%20%20%22error%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22code%22%3A%20%22UnknownError%22%2C%0A%20%20%20%20%20%20%20%20%22message%22%3A%20%22%22%2C%0A%20%20%20%20%20%20%20%20%22innerError%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22request-id%22%3A%20%2270e88c4f-2057-4e5b-8d35-9423ad8e0045%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22date%22%3A%20%222019-07-01T19%3A07%3A13%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%26nbsp%3B%3C%2FPRE%3E%3CP%3EDoes%20anyone%20know%20what%20this%20%22Unknown%20Error%22%20is%20and%20can%20help%20with%20fixing%20the%20problem%20here%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3ESnehal%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-732776%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1051231%22%20slang%3D%22en-US%22%3ERe%3A%20List%20chat%20messages%20via%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1051231%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F369502%22%20target%3D%22_blank%22%3E%40spatel07%3C%2FA%3E%26nbsp%3B%20So%20I%20can%20get%20it%20to%20work%20with%20Graph%20Explorer.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20see%20my%20chats%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fme%2Fchats%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fme%2Fchats%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20using%20a%20chatid%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fchats%2F%3CCHATID%3E%2Fmessages%3C%2FCHATID%3E%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGraph%20Explorer%20posts%20the%20chat%20message%20and%20I%20can%20see%20that%20in%20teams%2C%20but%20using%20powershell%20it%20get%3A%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%20size%3D%221%202%203%204%205%206%207%22%3EInvoke-RestMethod%20%3A%20%7B%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%20size%3D%221%202%203%204%205%206%207%22%3E%22error%22%3A%20%7B%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%20size%3D%221%202%203%204%205%206%207%22%3E%22code%22%3A%20%22UnknownError%22%2C%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%20size%3D%221%202%203%204%205%206%207%22%3E%22message%22%3A%20%22%22%2C%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%20size%3D%221%202%203%204%205%206%207%22%3E%22innerError%22%3A%20%7B%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%20size%3D%221%202%203%204%205%206%207%22%3E%22request-id%22%3A%20%2294ced8d0-b3f2-4343-a46f-d83a0eb94f93%22%2C%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%20size%3D%221%202%203%204%205%206%207%22%3E%22date%22%3A%20%222019-12-05T19%3A09%3A13%22%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%20size%3D%221%202%203%204%205%206%207%22%3E%7D%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%20size%3D%221%202%203%204%205%206%207%22%3E%7D%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%20size%3D%221%202%203%204%205%206%207%22%3E%7D%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1051244%22%20slang%3D%22en-US%22%3ERe%3A%20List%20chat%20messages%20via%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1051244%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20%22%3CSPAN%3EGroup.Read.All%22%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%22Chat.Read.All%22%26nbsp%3B%20and%26nbsp%3B%22Chat.ReadWrite%22%26nbsp%3B%20enabled.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EPosting%20and%20replying%20to%20a%20channel%20chat%20works.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1617829%22%20slang%3D%22en-US%22%3ERe%3A%20List%20chat%20messages%20via%20Graph%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1617829%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F81741%22%20target%3D%22_blank%22%3E%40Paul%20Flaherty%3C%2FA%3E%26nbsp%3BDo%20you%20get%20any%20work%20around%20or%20any%20update%20as%20i%20am%20facing%20the%20same%20issue%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

Hi,

 

We are trying to use the Beta Chat APIs to retrieve Chat messages (1:1). We have an application set up with "Chat.Read.All" Application Permission added. I get an error on calling any of the list chat APIs (/chats, /users/{id}/chats, /me/chats). The response comes back with 401 error code.

 

{
    "error": {
        "code": "UnknownError",
        "message": "",
        "innerError": {
            "request-id": "70e88c4f-2057-4e5b-8d35-9423ad8e0045",
            "date": "2019-07-01T19:07:13"
        }
    }
} 

Does anyone know what this "Unknown Error" is and can help with fixing the problem here ?

 

Thanks,

Snehal

3 Replies
Highlighted

@spatel07  So I can get it to work with Graph Explorer.

 

So see my chats:

https://graph.microsoft.com/beta/me/chats/

 

Then using a chatid;

https://graph.microsoft.com/beta/chats/<chatid>/messages

 

Graph Explorer posts the chat message and I can see that in teams, but using powershell it get:

Invoke-RestMethod : {
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"request-id": "94ced8d0-b3f2-4343-a46f-d83a0eb94f93",
"date": "2019-12-05T19:09:13"
}
}
}

Highlighted

I have "Group.Read.All", "Chat.Read.All"  and "Chat.ReadWrite"  enabled.

 

Posting and replying to a channel chat works.

@Paul Flaherty Do you get any work around or any update as i am facing the same issue