First of all, I think the type of authentication being used is the application.
- Create an app and set permissions
o I created an app with Microsoft Entra and set the Permissions as shown in the image below.
o enter image description here - Obtaining an Access Token
o We got an access token in the following two steps. - Admin Consent URL
- Token URL
o Parameter:
grant_type:client_credentials
Then, when I tried to send a message to a channel using the above app, I ran into the following two issues:
Issue 1: Error sending message
I tried to send a message using the Microsoft Graph API to a channel for an existing team that I created in Teams, but I got the following error:
Error message:
**MessageWritesBlocked-Thread is not markedfor import
**
Failed requests:
POST https://graph.microsoft.com/v1.0/teams/{ID}/channels/{ID}/messages
“error”: {
“code”: “Forbidden”,
“message”: “InsufficientPrivileges”,
“innerError”: {
“code”: “1”,
“message”: “MessageWritesBlocked-Thread is not marked for import”,
“date”: “2024-08-05T22:48:34”,
“request-id”: “9*********************b”,
“client-request-id”: “**********************b”
Send message to Teams using Graph-API POST.
Error : “message”: “MessageWritesBlocked-Thread is not marked for import”,