API package for Microsoft Teams
Project description
[!CAUTION] This project is in public preview. We’ll do our best to maintain compatibility, but there may be breaking changes in upcoming releases.
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}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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.0.0a18.tar.gz.
File metadata
- Download URL: microsoft_teams_api-2.0.0a18.tar.gz
- Upload date:
- Size: 47.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: RestSharp/106.13.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e1e0cbdb668129c188ad7a12ffdf76123313c4fba128c9c52480be13b7a46f5
|
|
| MD5 |
e356eb249c9aa7050c66730d8bba7cfb
|
|
| BLAKE2b-256 |
ef4b696f9b3ec140999754f48f7a07cb39a0791f615ee4f5e61c3b14b18d5401
|
File details
Details for the file microsoft_teams_api-2.0.0a18-py3-none-any.whl.
File metadata
- Download URL: microsoft_teams_api-2.0.0a18-py3-none-any.whl
- Upload date:
- Size: 143.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: RestSharp/106.13.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1f2014e96a20a4bff54abf6ecea6178bd38f0178ec6656d30c0711b7b30cb5d
|
|
| MD5 |
db8e8f83c03057e75856feaa89846748
|
|
| BLAKE2b-256 |
218a6c99bb68b1732601cb1bf19fcd0eccaadf00f83c0451cc46e081e0a3e3b4
|