简体   繁体   中英

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

When you are using application permissions you need to you must request access.For details, see Protected APIs in Microsoft Teams.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM