A microservice component that manages messages (activities) in Microsoft Teams:
- Send new messages
- Update existing messages
- Delete messages
Shares it's database with bf-directline-endpoint
.
Uses one of two methods:
- Password-based:
MICROSOFT_APP_PASSWORD
- Certificate-based: Both
MICROSOFT_APP_CERTIFICATE
+MICROSOFT_APP_PRIVATEKEY
Environment variables (can be set via .env
file):
PORT
: Server port (default: 3980)
MICROSOFT_APP_ID
: Application ID from app registrationMICROSOFT_APP_TENANT_ID
: Azure AD Tenant IDMICROSOFT_APP_PASSWORD
: App secret/passwordMICROSOFT_APP_CERTIFICATE
: PEM certificate (Base64 encoded)MICROSOFT_APP_PRIVATEKEY
: PEM private key (Base64 encoded)
DATABASE_URL
: PostgreSQL connection string Format:postgresql://{USER}:{PASSWORD}@{HOST}/{DATABASE}
Interactive documentation available at:
/docs
- Swagger UI/redoc
- ReDoc UI
All POST routes require a conversation_token
(obtained from MS Teams bot interaction) and returns a message_id
:
{
"message_id": "uuid-v7"
}
- Text Message
POST /api/v1/message/text
{
"conversation_token": "conversation_token (uuid)",
"text": "Your message content"
}
- Simple Message
POST /api/v1/message/simple
{
"conversation_token": "conversation_token (uuid)",
"text": "Your message content",
"title": "Message title",
"title_color": "default" // Options: dark, light, accent, good, warning, attention
}
- Simple Message
POST /api/v1/message/card
{
"conversation_token": "conversation_token (uuid)",
"card": {}, // Teams Adaptive Card object
"summary": "Notification summary"
}
- A generic one that can take any of the previous payload
POST /api/v1/message
{
"conversation_token": "conversation_token (uuid)",
[... one of the previous payload...]
}
To update a message, send a PATCH /api/v1/message
with one of the previous payload (not necessarily of the same kind), without the conversation_token
but the provided message_id
.
Just send a DELETE /api/v1/message
without the conversation_token
but the provided message_id
.