ATOM Documentation

← Back to App

Teams Integration - Quick Testing Cheat Sheet

Base URL

https://atom-saas.fly.dev

Quick 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:

  1. Open a team
  2. Click "..." next to team name → "Get link to team"
  3. URL format: https://teams.microsoft.com/l/team/19:TEAM_ID@thread.tacv2/
  4. Copy the TEAM_ID part

For Channel ID:

  1. Open a channel within the team
  2. The channel ID is in the URL
  3. 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

EndpointSuccess Indicator
Healthok: true, connected: true
AuthorizeReturns authorization_url
ChannelsReturns array of channels
MessageReturns message_id
HistoryReturns array of messages
AnalyticsReturns statistics
DisconnectReturns success: true

---

Common Error Codes

CodeMeaningFix
TENANT_NOT_FOUNDNot logged inLog in first
TOKEN_EXPIREDToken expiredShould auto-refresh
TOKEN_REFRESH_FAILEDRefresh failedRe-authorize
403Access deniedCheck permissions
404Not foundInvalid team/channel ID