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.1
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.1.tar.gz | 64.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| microsoft_teams_api-2.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 239.0 kB
Release files / microsoft_teams_api-2.1.1.tar.gz
| Download URL | microsoft_teams_api-2.1.1.tar.gz |
|---|---|
| Size | 64.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b477006fc070d5315edd2042736c78cf52f5008167d9662804b7a0c5f07ac780
|
|
BLAKE2b-256 checksum How to use checksums |
b1abcd8e78d3aa2bde791493aae7477ac2be92a44284d52838c91784f6e94cd4
|
| 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.1-py3-none-any.whl
| Download URL | microsoft_teams_api-2.1.1-py3-none-any.whl |
|---|---|
| Size | 174.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
795602d6abc97e4dca334f2478fc0b07968fcc78f3aa5718e2d42fdd8f94dad6
|
|
BLAKE2b-256 checksum How to use checksums |
d9dc94accf394b6c74f343d415ee359b9aa846943e470963bbf5844a757773e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|