Getting "AclCheckFailed" error while fetching channel messages for Teams

Tarun George Koshy 71 Reputation points
2022-04-25T08:31:02.953+00:00

Hi,

WE get the following error while trying to get messages of a teams channel using the Graph API(channel-list-messages and chatmessage-list-replies )

Status Code: Forbidden   
{  
  "code": "Forbidden",  
  "message": {"errorCode":209,  
     "message":{  
     "subCode": "AclCheckFailed",  
     "details": "The initiator 28:app:22da2fa9-f8e7-4f8c-a588-a72b6896d459_2b99b040-b3...  
}  

I have checked the Graph API documentation and there is no mention of the errorCode 209 or subCode "AclCheckFailed". I can confirm that the the Protected API's permission needed for this API has been requested and approved. Also, The necessary application permissions "ChannelMessage.Read.All" has been granted by admin for the app.

I don't have the request-id, client-request-id and the additional error details. I wanted to know, if there are any circumstances that might cause this error code for the above APIs. And if there is a solution to fix it.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,592 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,846 questions
{count} vote

4 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 36,976 Reputation points
    2022-04-26T09:58:44.28+00:00

    Hi @Tarun George Koshy

    I'm not sure if application permissions require that your team and channel must have been created in a migrated state, maybe you could try using delegated permissions to see result how.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

  2. ChetanSharmamsft 1,026 Reputation points Microsoft Vendor
    2023-01-16T06:04:48.8633333+00:00

    Hello Němečková Hana - Please let us know if you are still facing this issue?
    If yes, could you please share the request id, timestamp and API details to further investigate the issue?

    0 comments No comments

  3. Wilson Ricardo Olarte Martínez 21 Reputation points
    2023-06-23T21:50:35.2333333+00:00

    Hi. I have the same error message: AclCheckFailed-The initiator my app gets the token correctly but using the api: https://graph.microsoft.com/v1.0/chats/xxxxxxxxxxxxxxxxxx/messages it doesn't work anymore

    Now i can reply this seach from Postman, i can see this error

    Before it worked correctly

    Before it worked correctly

    0 comments No comments

  4. Naga Dheeraj M 20 Reputation points
    2024-03-28T08:21:27.0533333+00:00

    https://learn.microsoft.com/en-us/graph/api/chat-delete?view=graph-rest-1.0&tabs=http

    Notes: This operation is not supported for non-admin users. Only tenant admins for the user who initiated the chat can delete the chat. For example, if a user from tenant A creates a thread and then adds a user from tenant B, only the admin from tenant A can delete the thread. This API deletes 1:1 chats, meeting chats, and group chat threads. It does not delete channel chat threads. After chats are deleted, tenant admins have seven days to restore them. Chats deleted for more than seven days can't be restored. One delete request per second per tenant is allowed.

    I guess the problem is that the chat is initiated by a user who is under a different tenant and it can't be deleted by your tenant admin.

    0 comments No comments