Unable to send messages in channel

DanielK 20 Reputation points

We are trying to send message in channel using Application in Graph API.
Getting code": "Unauthorized",
"message": "Message POST is allowed in application-only context only for import purposes. I don't understand what we are doing wrong because in docs Application is supported.
Can anyone help!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,771 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shivam Dhiman 5,946 Reputation points

    Hi @DanielK

    As per the documentation, Application permissions are only supported for migration.
    This means that your team and channel must both be created in a migrated state, otherwise you can only send chat messages in a delegated permissions. I have tried this Graph API using delegated permissions, its working as expected. Please refer to the below sample screenshot:
    User's image

    Hope this helps. If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.