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.0a17.tar.gz (46.8 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.0a17-py3-none-any.whl (142.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: microsoft_teams_api-2.0.0a17.tar.gz
  • Upload date:
  • Size: 46.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: RestSharp/106.13.0.0

File hashes

Hashes for microsoft_teams_api-2.0.0a17.tar.gz
Algorithm Hash digest
SHA256 15534c781b53d21a9f4fd562fe8837a2590f57e2651f12a4949d5d7484d24c9e
MD5 1e71935d27c0cdfb67b245160c530a30
BLAKE2b-256 e68effecb9b1d7a3a370ab3228fd50a58e515096a404c5dbcdedcfb1eb53edf7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for microsoft_teams_api-2.0.0a17-py3-none-any.whl
Algorithm Hash digest
SHA256 6faeb82b8dcc036e048ab403f2a696dc40936e6426753813342240fbb5686bbe
MD5 09bcd534b90ab603e7f35c89d6b558e1
BLAKE2b-256 b1aa011b5e21e6f16f7badae1ed5afdcd94c98774c446e34af3fc0173fd99553

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