List chat messages via Graph API

Copper Contributor

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

@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"
}
}
}

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