Teams Integration - Quick Testing Cheat Sheet
Base URL
https://atom-saas.fly.devQuick Test Commands (Replace placeholders)
1. Health Check
curl -X GET "{{base_url}}/api/v1/integrations/teams/health"2. Get Auth URL
curl -X GET "{{base_url}}/api/v1/integrations/teams/authorize?tenant_id={{tenant_id}}"3. List Channels
curl -X GET "{{base_url}}/api/v1/integrations/teams/channels?workspace_id={{team_id}}"4. Send Message
curl -X POST "{{base_url}}/api/v1/integrations/teams/message" \
-H "Content-Type: application/json" \
-d '{
"workspace_id": "{{team_id}}",
"channel_id": "{{channel_id}}",
"text": "Hello from API!"
}'5. Get Message History
curl -X GET "{{base_url}}/api/v1/integrations/teams/history/{{channel_id}}?workspace_id={{team_id}}&limit=10"6. Get Analytics
curl -X GET "{{base_url}}/api/v1/integrations/teams/analytics"7. Disconnect
curl -X DELETE "{{base_url}}/api/v1/integrations/teams/disconnect"---
How to Find Your Team & Channel IDs
In Microsoft Teams:
- Open a team
- Click "..." next to team name → "Get link to team"
- URL format:
https://teams.microsoft.com/l/team/19:TEAM_ID@thread.tacv2/ - Copy the TEAM_ID part
For Channel ID:
- Open a channel within the team
- The channel ID is in the URL
- Or use the channels endpoint to list all channels
---
Required Environment Variables
MICROSOFT_CLIENT_ID=xxx
MICROSOFT_CLIENT_SECRET=xxx
MICROSOFT_TENANT_ID=common
MICROSOFT_REDIRECT_URI=https://atom-saas.fly.dev/api/integrations/callback---
Success Indicators
| Endpoint | Success Indicator |
|---|---|
| Health | ok: true, connected: true |
| Authorize | Returns authorization_url |
| Channels | Returns array of channels |
| Message | Returns message_id |
| History | Returns array of messages |
| Analytics | Returns statistics |
| Disconnect | Returns success: true |
---
Common Error Codes
| Code | Meaning | Fix |
|---|---|---|
TENANT_NOT_FOUND | Not logged in | Log in first |
TOKEN_EXPIRED | Token expired | Should auto-refresh |
TOKEN_REFRESH_FAILED | Refresh failed | Re-authorize |
| 403 | Access denied | Check permissions |
| 404 | Not found | Invalid team/channel ID |