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}")
Metadata
Release files for microsoft-teams-api 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| microsoft_teams_api-2.1.0.tar.gz | 64.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| microsoft_teams_api-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 239.0 kB
Release files / microsoft_teams_api-2.1.0.tar.gz
| Download URL | microsoft_teams_api-2.1.0.tar.gz |
|---|---|
| Size | 64.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb5b36d36c18b29f82ac37687d1d3330d176595c6a354dd41a605475c895c064
|
|
BLAKE2b-256 checksum How to use checksums |
1aa22a6068b4d7acf05fc041dedaef4a98c4a6573952b81fcdaf2f495419ce83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|
Release files / microsoft_teams_api-2.1.0-py3-none-any.whl
| Download URL | microsoft_teams_api-2.1.0-py3-none-any.whl |
|---|---|
| Size | 174.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8293a228839c8a99ec2ac49cca4c34d34366d86d12b8f5dec4fa33fe123e41d2
|
|
BLAKE2b-256 checksum How to use checksums |
555cb15a7e235a0a3528dc9e3cc19891dfbc39c7d919b7a5c00c18c0e36d894b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|