Using Graph API to post messages and media in Teams

Marco Streitner 0 Reputation points
2024-07-25T08:08:27.0766667+00:00

Hello.

After looking into the Graph API for a bit, a few questions have arised for me, and I would appreciate if someone could help me out with it :D

So since webhooks are being deprecated soon-ish, we would somehow need to replace a feature that publishes Teams messages into channels, that include limited text and image contents. (3 lines of text and 2 ~720p images)

  • Would it be possible to substitute this using the Graph API?
  • What does the pricing for Graph API look like in a scenario, is it per 1k requests?
  • Is it possible to use the Graph API to also write/send images and text to users direct messages, rather than in channels?

If anything is unclear, please feel free to further ask me for details, and big, big thanks in advance! :)

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

1 answer

Sort by: Most helpful
  1. Yakun Huang-MSFT 6,415 Reputation points Microsoft Vendor
    2024-07-25T09:13:55.2133333+00:00

    Hi @Marco Streitner

    1. You can use the Graph Api to send messages in teams, see the documentation for details.
    2. Sending messages using the Graph Api is free, but requires an MS365 License. If you don't have a License, you need to try purchasing or free trial MS 365 license for your tenant, then go to Azure AD and grant that license to the logged in user.
    3. Yes, you can use Graph API to send messages directly. For details, please refer to the case in the document.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.