Hello Saira Munir,
Thank you for reaching out to Microsoft Support!
The error message you're encountering, AclCheckFailed-The initiator does not have permission to access thread
, typically indicates a mismatch between the tenant ID of the initiator (your application) and the tenant ID of the chat thread you're trying to access. Here are a few steps to troubleshoot and resolve this issue:
- Verify Tenant IDs: Ensure that the tenant ID of the application matches the tenant ID of the chat thread. This mismatch can occur if the chat thread belongs to a different tenant than the one your application is registered under. To list chat messages in application context, the request must be made from the tenant that the channel owner belongs to (represented by the tenantId property on the channel). Please refer documentation.
- Check Permissions: Although you have granted
Chat.ReadWrite.All
andChatMessage.Read.All
permissions, make sure these permissions are correctly configured and consented to by an admin in the tenant where the chat thread resides. Verify that the access token you are using has the correct scopes. Decode using jwt.io
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.