Slack कनेक्टर
real-time marketing notifications, customer events पर team alerts, और Slack interactions से triggered workflow automation के लिए Tajo के माध्यम से अपने Slack workspace को Brevo से कनेक्ट करें।
अवलोकन
| Property | Value |
|---|---|
| Platform | Slack |
| Category | Custom Integration |
| Setup Complexity | Easy |
| Official Integration | Yes |
| Data Synced | Users, Channels, Messages, Events |
| API Base URL | https://slack.com/api |
विशेषताएं
- Marketing alerts - campaign events, नए subscribers, और revenue milestones के लिए real-time notifications भेजें
- Customer event notifications - Brevo से high-value customer actions पर teams को alert करें
- Workflow triggers - Brevo automations trigger करने के लिए Slack interactions (button clicks, form submissions) का उपयोग करें
- Channel-आधारित routing - event type या customer segment के आधार पर notifications को specific channels में route करें
- User sync - internal communications के लिए Slack workspace users को Brevo contacts से map करें
- Interactive messages - team workflows के लिए buttons और actions के साथ rich messages भेजें
- Scheduled messages - daily/weekly marketing summaries के लिए notifications schedule करें
- Thread support - व्यवस्थित communication के लिए संबंधित notifications को threads में group करें
पूर्वावश्यकताएं
शुरू करने से पहले, सुनिश्चित करें कि आपके पास हैं:
- admin access वाला एक Slack workspace
- api.slack.com/apps पर बनाया गया एक Slack app
- आवश्यक scopes वाला Bot token
- API access वाला एक Brevo account
- एक Tajo account
प्रमाणीकरण
Bot Token (अनुशंसित)
अपने workspace में एक Slack app install करें और API access के लिए bot token का उपयोग करें।
- api.slack.com/apps पर app बनाएं
- “OAuth & Permissions” के अंतर्गत आवश्यक OAuth scopes जोड़ें
- app को workspace में install करें
- Bot User OAuth Token कॉपी करें (
xoxb-...)
curl -X POST "https://slack.com/api/chat.postMessage" \ -H "Authorization: Bearer xoxb-YOUR-BOT-TOKEN" \ -H "Content-Type: application/json" \ -d '{"channel": "C01234567", "text": "Hello from Tajo!"}'OAuth 2.0
अपने Slack integration को कई workspaces में distribute करने के लिए:
# Authorization URLhttps://slack.com/oauth/v2/authorize? client_id={client_id}& scope=chat:write,channels:read,users:read& redirect_uri={redirect_uri}
# Token exchangecurl -X POST "https://slack.com/api/oauth.v2.access" \ -d "client_id={client_id}" \ -d "client_secret={client_secret}" \ -d "code={auth_code}"आवश्यक Bot Scopes
chat:write # messages भेजेंchannels:read # channels list करेंchannels:history # channel messages पढ़ेंusers:read # workspace users list करेंusers:read.email # user email addresses पढ़ेंreactions:write # messages में reactions जोड़ेंfiles:write # files upload करेंUser Email Access
Slack users को Brevo contacts से मिलाने के लिए users:read.email scope आवश्यक है। इसके बिना, user mapping display names तक सीमित रहेगी।
कॉन्फ़िगरेशन
बेसिक सेटअप
connectors: slack: enabled: true bot_token: "${SLACK_BOT_TOKEN}" signing_secret: "${SLACK_SIGNING_SECRET}"
# Notification channels channels: marketing: "C01234567" sales: "C01234568" support: "C01234569" alerts: "C01234570"
# Event routing notifications: new_subscriber: channel: marketing template: subscriber_alert high_value_order: channel: sales template: order_alert support_ticket: channel: support template: ticket_alertField Mapping
Slack user data को Brevo contact attributes से map करें:
Default Mappings
| Parameter | Type | Description |
|---|---|---|
profile.email required | string | User email (Brevo matching के लिए unique identifier) |
real_name optional | string | पूर्ण नाम, FIRSTNAME/LASTNAME में विभाजित |
profile.phone optional | string | SMS attribute से map होता है |
profile.title optional | string | Job title |
tz optional | string | User timezone |
is_admin optional | boolean | Workspace admin status |
team_id optional | string | Workspace team ID |
status_text optional | string | User custom status |
API Methods
Messaging
| Method | Endpoint | विवरण |
|---|---|---|
POST | chat.postMessage | किसी channel में message भेजें |
POST | chat.update | मौजूदा message अपडेट करें |
POST | chat.delete | message हटाएं |
POST | chat.scheduleMessage | message schedule करें |
POST | chat.postEphemeral | user को ephemeral message भेजें |
Channels
| Method | Endpoint | विवरण |
|---|---|---|
GET | conversations.list | channels list करें |
GET | conversations.info | channel info प्राप्त करें |
GET | conversations.members | channel members list करें |
GET | conversations.history | channel messages प्राप्त करें |
Users
| Method | Endpoint | विवरण |
|---|---|---|
GET | users.list | workspace users list करें |
GET | users.info | user info प्राप्त करें |
GET | users.lookupByEmail | email द्वारा user खोजें |
GET | users.conversations | user channels list करें |
Interactions
| Method | Endpoint | विवरण |
|---|---|---|
POST | views.open | modal view खोलें |
POST | views.update | modal view अपडेट करें |
POST | reactions.add | emoji reaction जोड़ें |
Events
Brevo-to-Slack Notifications
| Event | Trigger | Slack Action |
|---|---|---|
new_subscriber | Brevo में Contact बनाया गया | #marketing पर post करें |
campaign_sent | Email campaign भेजा गया | #marketing पर summary post करें |
order_placed | High-value order detect हुआ | विवरण के साथ #sales पर post करें |
cart_abandoned | 30 मिनट के लिए cart abandoned | follow-up के लिए #sales पर post करें |
ticket_created | Support ticket खुला | #support पर post करें |
unsubscribed | Contact unsubscribed | #marketing पर alert post करें |
Slack-to-Brevo Triggers
| Slack Event | Trigger | Brevo Action |
|---|---|---|
message_action | Custom message shortcut | contact को list में जोड़ें या automation trigger करें |
block_actions | Message में Button click | contact attribute अपडेट करें या email भेजें |
view_submission | Modal form submit हुआ | contact बनाएं या workflow trigger करें |
कोड उदाहरण
कनेक्टर शुरू करें
import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({ apiKey: process.env.TAJO_API_KEY, brevoApiKey: process.env.BREVO_API_KEY});
// Slack कनेक्ट करेंawait tajo.connectors.connect('slack', { botToken: process.env.SLACK_BOT_TOKEN, signingSecret: process.env.SLACK_SIGNING_SECRET});Marketing Notifications भेजें
// जब high-value order place हो तो notification भेजेंawait tajo.slack.notify({ channel: 'sales', event: 'order_placed', data: { orderValue: '$1,250.00', products: ['Premium Widget', 'Pro Service'], isFirstOrder: true }, template: { blocks: [ { type: 'header', text: { type: 'plain_text', text: 'New High-Value Order' } }, { type: 'section', fields: [ { type: 'mrkdwn', text: '*Amount:*\n$1,250.00' } ] }, { type: 'actions', elements: [ { type: 'button', text: { type: 'plain_text', text: 'View in Brevo' }, url: 'https://app.brevo.com/contacts' } ] } ] }});Slack Interactions हैंडल करें
import crypto from 'crypto';
app.post('/slack/interactions', async (req, res) => { // Slack request signature सत्यापित करें const timestamp = req.headers['x-slack-request-timestamp']; const signature = req.headers['x-slack-signature']; const sigBasestring = `v0:${timestamp}:${req.rawBody}`; const mySignature = 'v0=' + crypto .createHmac('sha256', process.env.SLACK_SIGNING_SECRET) .update(sigBasestring) .digest('hex');
if (signature !== mySignature) { return res.status(401).send('Unauthorized'); }
const payload = JSON.parse(req.body.payload);
// button actions हैंडल करें if (payload.type === 'block_actions') { await tajo.connectors.handleWebhook('slack', { type: 'interaction', action: payload.actions[0].action_id, userId: payload.user.id, payload }); }
res.status(200).send();});Rate Limits
Slack API rate limits एक tiered system का उपयोग करते हैं:
| Tier | Limit | सामान्य Methods |
|---|---|---|
| Tier 1 | 1 request/minute | chat.delete, conversations.kick |
| Tier 2 | 20 requests/minute | conversations.history, users.info |
| Tier 3 | 50 requests/minute | conversations.list, users.list |
| Tier 4 | 100 requests/minute | chat.postMessage |
| Special | भिन्न | समान channel पर chat.postMessage: 1/sec |
अतिरिक्त limits:
- Web API: short-term throttle के साथ Burst limit
- Events API: 3 attempts के लिए Delivery retries
- Incoming Webhooks: प्रति webhook URL 1 message/second
- Block Kit: प्रति message अधिकतम 50 blocks
Channel Posting Rate
समान channel में post करना लगभग 1 message प्रति सेकंड तक सीमित है। rate limiting से बचने के लिए notifications को batch करें या threads का उपयोग करें।
समस्या निवारण
सामान्य समस्याएं
| समस्या | कारण | समाधान |
|---|---|---|
not_authed | अमान्य bot token | app पुनः install करें और नया bot token कॉपी करें |
channel_not_found | Bot channel में नहीं है | target channel में bot को invite करें |
missing_scope | आवश्यक scope नहीं दिया गया | scope जोड़ें और app पुनः install करें |
| Event प्राप्त नहीं हुआ | Event subscription सेट नहीं | Event Subscriptions URL कॉन्फ़िगर करें |
| Interaction timeout | Response >3 सेकंड | तुरंत 200 के साथ respond करें, async process करें |
Debug Mode
verbose logging enable करें:
connectors: slack: debug: true log_level: verbose log_events: trueConnection Test करें
tajo connectors test slack# ✓ Bot token valid# ✓ Workspace accessible# ✓ Channels readable# ✓ Message posting enabled# ✓ Event subscriptions activeसर्वोत्तम प्रथाएं
- Block Kit का उपयोग करें - Slack के Block Kit framework के साथ rich, interactive messages बनाएं
- जल्दी respond करें - 3 सेकंड के भीतर interactions स्वीकार करें, asynchronously process करें
- संबंधित messages को thread करें - noise कम करने के लिए संबंधित notifications को threads में group करें
- Channel द्वारा route करें - विभिन्न event types को उपयुक्त team channels में भेजें
- Action buttons शामिल करें - customer data तक त्वरित पहुंच के लिए “View in Brevo” buttons जोड़ें
- Unfurling लागू करें - Slack में shared किए गए Brevo links के लिए rich previews दिखाएं
सुरक्षा
- Bot Token - granular permissions के साथ OAuth-scoped access token
- Request signing - incoming requests के लिए HMAC SHA-256 signature verification
- OAuth 2.0 - multi-workspace distribution के लिए industry-standard authorization
- TLS encryption - सभी API communication HTTPS के माध्यम से encrypted
- Token rotation - enhanced security के लिए स्वचालित token rotation