Skip to main content

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


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.0.0a5.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microsoft_teams_api-2.0.0a5-py3-none-any.whl (135.3 kB view details)

Uploaded Python 3

File details

Details for the file microsoft_teams_api-2.0.0a5.tar.gz.

File metadata

File hashes

Hashes for microsoft_teams_api-2.0.0a5.tar.gz
Algorithm Hash digest
SHA256 efbb44635fa4d8e2226c19ca39138dd52aa663ca4c58b5d35d87437175c223a8
MD5 4ef6ee55cf24bd57a6b7b0670910c188
BLAKE2b-256 4f08d34c795e43a83fed0ae98429e2d8f9d8d705ff9787c1d4897228098c4546

See more details on using hashes here.

File details

Details for the file microsoft_teams_api-2.0.0a5-py3-none-any.whl.

File metadata

File hashes

Hashes for microsoft_teams_api-2.0.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 6467950a266add59141b3790471e882c65cef10f46aeb33057a9299468a63392
MD5 0c48b8a0a644235b347e0d4188b7aefd
BLAKE2b-256 d7feb84aa6541bc3a9a15b8dcd745b901f4c9d4539e2d670d6b3348358e7c5b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page