Had these files as part of local exp Kinda was clutering the system Folder reorg-ed courtesy Cowork
A Python SDK for creating Microsoft Teams meetings and managing transcripts using the Microsoft Graph API.
- OAuth 2.0 authentication with PKCE flow
- Create Teams meetings with automatic recording and transcription
- Download meeting transcripts in VTT format
- Webhook subscriptions for transcript notifications
- Automatic token refresh
- Python 3.7+
- Microsoft Azure App Registration with the following permissions:
OnlineMeetings.ReadWriteOnlineMeetingTranscript.Read.AllUser.Read
cd teams-sdk
pip install -r requirements.txtCopy the example environment file and fill in your Azure app credentials:
cp env.example .envEdit .env with your Azure app details:
CLIENT_ID=your-client-id-here
CLIENT_SECRET=your-client-secret-here
TENANT_ID=your-tenant-id-here
REDIRECT_URI=http://localhost:8000/callback
- Go to Azure Portal
- Navigate to Azure Active Directory > App registrations > New registration
- Configure:
- Name: Your app name
- Redirect URI:
http://localhost:8000/callback(or your custom URI)
- After creation:
- Copy the Application (client) ID →
CLIENT_ID - Copy the Directory (tenant) ID →
TENANT_ID - Go to Certificates & secrets → Create new client secret → Copy value →
CLIENT_SECRET
- Copy the Application (client) ID →
- Go to API permissions → Add permissions:
- Microsoft Graph → Delegated permissions:
OnlineMeetings.ReadWriteOnlineMeetingTranscript.Read.AllUser.Read
- Click Grant admin consent
- Microsoft Graph → Delegated permissions:
cd meet-creation
# 1. First time: Authenticate
python auth.py
# 2. Create a meeting
python create_meeting_main.py
# 3. Download transcript (wait 5-15 mins after meeting ends)
python pull_transcript_main.pyFirst, authenticate and save your tokens:
cd meet-creation
python auth.pyThis will:
- Open a browser for OAuth authentication
- Save your access and refresh tokens to
teams_tokens.json - Store user information
Note: teams_tokens.json is gitignored and should never be committed!
python create_meeting_main.pyFeatures:
- Automatically refreshes expired tokens
- Creates meeting with recording and transcription enabled
- Returns meeting join URL and ID
Important: Save the meeting ID - you'll need it to download transcripts!
After a meeting ends (transcripts may take 5-15 minutes to be available):
python pull_transcript_main.pyEnter the meeting ID when prompted. Transcripts will be saved to the transcripts/ folder in VTT format.
Production Scripts (use these!):
auth.py: OAuth authentication and token managementcreate_meeting_main.py: Create meetings with auto-recording/transcriptionpull_transcript_main.py: Download meeting transcripts
See meet-creation/README.md for detailed documentation!
Experimental/advanced usage:
webhook_handler.py: Flask server for real-time notificationstranscript_poller.py: Automated transcript pollingsubscription_manager.py: Setup webhook subscriptions
Troubleshooting and debugging:
check_permissions.py: Verify Azure app permissionsdiagnosis.py: Comprehensive diagnostic informationsubscription_review.py: Review active subscriptionsdebug.py: Advanced debugging tools
Older experimental code kept for reference (may not work with current setup)
Library modules for integration into other projects
This is an experimental/personal project. Feel free to fork and adapt for your needs.
See LICENSE file for details.