Get team channels API returning 401 Unauthorized

Copper Contributor

I am getting the following response while trying to fetch channels corresponding to a team using the Graph API. It was working fine few days ago but started failing recently.

 

https://graph.microsoft.com/v1.0/teams/team-id/channels

 

 

 

{
    "error": {
        "code": "Unauthorized",
        "message": "Failed to execute Aad backend request GetUsersByObjectIdsRequest. Workload Unknown. Request Url: https://graph.windows.net/myorganization/getObjectsByObjectIds?api-version=1.61-internal, Request Method: POST, Response Status Code: Unauthorized, Response Headers: ocp-aad-diagnostics-server-name: JniMij6yIQ+28j3rO74gZklFGwbp+nmK/bJ9wZpbrLU=\r\nrequest-id: 81878619-142f-48fa-988a-d63b5dba490c\r\nclient-request-id: ff0e9916-dc45-4e77-b81e-1e6ffe99736c\r\nStrict-Transport-Security: max-age=31536000; includeSubDomains\r\nDate: Tue, 27 Oct 2020 23:11:43 GMT\r\n, Reason Phrase: Unauthorized",
        "innerError": {
            "date": "2020-10-27T23:11:44",
            "request-id": "44c3a289-d3d7-4638-9ea5-25796bd85693",
            "client-request-id": "44c3a289-d3d7-4638-9ea5-25796bd85693"
        }
    }
}

 

 

I am using client_credentials grant to obtain the token with the following app permissions:

 

 

 

"roles": [
    "TeamMember.Read.All",
    "Chat.UpdatePolicyViolation.All",
    "TeamsActivity.Read.All",
    "ChannelSettings.Read.All",
    "Channel.ReadBasic.All",
    "Group.Read.All",
    "Sites.ReadWrite.All",
    "Files.ReadWrite.All",
    "Directory.Read.All",
    "User.Read.All",
    "ChannelMember.Read.All",
    "GroupMember.Read.All",
    "Team.ReadBasic.All",
    "Chat.Read.All",
    "ChannelMessage.Read.All",
    "Chat.ReadWrite.All",
    "ChannelMessage.UpdatePolicyViolation.All",
    "Chat.ReadBasic.All"
  ],

 

 

 

Other APIs to list teams, list teams members etc are working fine. 

0 Replies