Microsoft Teams API Client
Core API client library for Microsoft Teams Bot Framework integration. Provides HTTP clients, authentication, and typed models for Teams Bot Framework APIs.
Features
- API Clients: Bot, User, Conversation, Team, and Meeting clients
- Authentication: ClientCredentials and TokenCredentials support
- Activity Models: Typed Pydantic models for Teams activities
- JWT Tokens: JsonWebToken implementation with TokenProtocol interface
Authentication
from microsoft_teams.api import ClientCredentials, TokenCredentials
# Client credentials authentication
credentials = ClientCredentials(
client_id="your-app-id",
client_secret="your-app-secret"
)
# Token-based authentication
credentials = TokenCredentials(
client_id="your-app-id",
token=your_token_function
)
API Client Usage
from microsoft_teams.api import ApiClient
# Initialize API client
api = ApiClient("https://smba.trafficmanager.net/amer/")
# Bot token operations
token_response = await api.bots.token.get(credentials)
graph_token = await api.bots.token.get_graph(credentials)
# User token operations
user_token = await api.users.token.get(params)
token_status = await api.users.token.get_status(params)
Activity Models
from microsoft_teams.api import MessageActivity, Activity, ActivityTypeAdapter
# Validate incoming activities
activity = ActivityTypeAdapter.validate_python(activity_data)
# Work with typed activities
if isinstance(activity, MessageActivity):
print(f"Message: {activity.text}")
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
microsoft_teams_api-2.1.0.tar.gz
(64.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file microsoft_teams_api-2.1.0.tar.gz.
File metadata
- Download URL: microsoft_teams_api-2.1.0.tar.gz
- Upload date:
- Size: 64.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
RestSharp/106.13.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb5b36d36c18b29f82ac37687d1d3330d176595c6a354dd41a605475c895c064
|
|
| MD5 |
e75374c5d00ea897c20f5ea6848cf466
|
|
| BLAKE2b-256 |
1aa22a6068b4d7acf05fc041dedaef4a98c4a6573952b81fcdaf2f495419ce83
|
File details
Details for the file microsoft_teams_api-2.1.0-py3-none-any.whl.
File metadata
- Download URL: microsoft_teams_api-2.1.0-py3-none-any.whl
- Upload date:
- Size: 174.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
RestSharp/106.13.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8293a228839c8a99ec2ac49cca4c34d34366d86d12b8f5dec4fa33fe123e41d2
|
|
| MD5 |
ba597df3b2caaa08ccc33e3a99c8157a
|
|
| BLAKE2b-256 |
555cb15a7e235a0a3528dc9e3cc19891dfbc39c7d919b7a5c00c18c0e36d894b
|