Automatically add a post and file to a Teams Channel using Python

MARKIEWICZ, EDWARD A 0 Reputation points
2025-01-14T16:13:45.09+00:00

I need to add a new Microsoft Teams channel Post, including uploading an Excel file, automatically using Python. I can add the Post "text" using pymsteams, but cannot determine how to include the Excel file. I've been researching this issue and see references to a BOT framework but I'm unfamiliar with this. Can someone suggest a method or URL or anything I can research to fulfill this requirement?

~Ed

Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,692 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sayali-MSFT 3,851 Reputation points Microsoft External Staff
    2025-01-15T08:34:41.85+00:00

    Hello @MARKIEWICZ, EDWARD A,, To automate the process of adding a new Microsoft Teams channel Post and uploading an Excel file using Python, you can use the Microsoft Graph API in combination with the Bot Framework.
    Here is sample and documentation link for reference:-
    1.https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/bot-file-upload/python
    2.https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bots-filesv4#use-the-graph-apis

    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.