send channel message is not working with application permissions

Lee Gu 5 Reputation points
2023-02-01T17:45:26.87+00:00

i am getting "

Message POST is allowed in application-only context only for import purposes

teams api.PNG"

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,119 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,645 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,559 questions
{count} votes

3 answers

Sort by: Most helpful
  1. HarmeetSingh7172 4,811 Reputation points
    2023-02-01T18:01:05.3166667+00:00

    Hello @Lee Gu

    Thanks for reaching out!

    As per the documentation, application permissions are supported only for migration purposes. For this, your team and channel both must be created in a migrated state. However, you can use this graph API in a delegated context (with signed-in user).

    Reference: Send ChatMessage in Channel

    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.


  2. Phani Kumar Venigalla 0 Reputation points
    2023-02-01T19:12:39.66+00:00

    Hi

    What is the API that can use for sending teams channel message from JAVA application.

    We are looking for application level access. Can we use graph API to send channel messages?

    Thanks,

    P

    0 comments No comments

  3. Notificações 30 Reputation points
    2023-02-06T12:04:19.0766667+00:00

    Hello, i have the same problem, someone knows how solve this?

    I'm trying to send a message in a private chat, I can do it through the demo api, but not on my system

    0 comments No comments