Forum Discussion

christosjubile's avatar
christosjubile
Brass Contributor
Mar 04, 2021
Solved

MS Teams: can not fetch channel messages with Graph API using an application token

I have created a test application which is requesting adminconsent from a MS teams admin with the following scopes:

 

openid offline_access channelmessage.read.group channelmessage.read.all chat.read chat.readbasic chat.readwrite user.read.all channel.readbasic.all directory.read.all group.read.all groupmember.read.all organization.read.all people.read.all presence.read.all team.readbasic.all

I am using an application token to fetch ms teams organization data like users, channels, teams etc. I have managed to fetch with Graph API the user, channel, teams data of an organization,
but when I tried to fetch messages
with

https://graph.microsoft.com/v1.0/teams/team_id/channels/channel_id/messages

I am getting the following error:

{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"date": "2021-03-03T22:23:47",
"request-id": "a279044a-ab9e-4c18-af71-5a65ea7cee86",
"client-request-id": "a279044a-ab9e-4c18-af71-5a65ea7cee86"
}
}
}

4 Replies

      • christosjubile's avatar
        christosjubile
        Brass Contributor
        Yes this solution is working so you can consider this question as solved but I want some extra help
        Right now with this API I can get all messages both channel and chats my question is how can I get some information about the chat rooms and especially the member of a chat room

Resources