Slack कनेक्टर

real-time marketing notifications, customer events पर team alerts, और Slack interactions से triggered workflow automation के लिए Tajo के माध्यम से अपने Slack workspace को Brevo से कनेक्ट करें।

अवलोकन

PropertyValue
PlatformSlack
CategoryCustom Integration
Setup ComplexityEasy
Official IntegrationYes
Data SyncedUsers, Channels, Messages, Events
API Base URLhttps://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 करें

पूर्वावश्यकताएं

शुरू करने से पहले, सुनिश्चित करें कि आपके पास हैं:

  1. admin access वाला एक Slack workspace
  2. api.slack.com/apps पर बनाया गया एक Slack app
  3. आवश्यक scopes वाला Bot token
  4. API access वाला एक Brevo account
  5. एक Tajo account

प्रमाणीकरण

Bot Token (अनुशंसित)

अपने workspace में एक Slack app install करें और API access के लिए bot token का उपयोग करें।

  1. api.slack.com/apps पर app बनाएं
  2. “OAuth & Permissions” के अंतर्गत आवश्यक OAuth scopes जोड़ें
  3. app को workspace में install करें
  4. Bot User OAuth Token कॉपी करें (xoxb-...)
Terminal window
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 करने के लिए:

Terminal window
# Authorization URL
https://slack.com/oauth/v2/authorize?
client_id={client_id}&
scope=chat:write,channels:read,users:read&
redirect_uri={redirect_uri}
# Token exchange
curl -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_alert

Field 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

MethodEndpointविवरण
POSTchat.postMessageकिसी channel में message भेजें
POSTchat.updateमौजूदा message अपडेट करें
POSTchat.deletemessage हटाएं
POSTchat.scheduleMessagemessage schedule करें
POSTchat.postEphemeraluser को ephemeral message भेजें

Channels

MethodEndpointविवरण
GETconversations.listchannels list करें
GETconversations.infochannel info प्राप्त करें
GETconversations.memberschannel members list करें
GETconversations.historychannel messages प्राप्त करें

Users

MethodEndpointविवरण
GETusers.listworkspace users list करें
GETusers.infouser info प्राप्त करें
GETusers.lookupByEmailemail द्वारा user खोजें
GETusers.conversationsuser channels list करें

Interactions

MethodEndpointविवरण
POSTviews.openmodal view खोलें
POSTviews.updatemodal view अपडेट करें
POSTreactions.addemoji reaction जोड़ें

Events

Brevo-to-Slack Notifications

EventTriggerSlack Action
new_subscriberBrevo में Contact बनाया गया#marketing पर post करें
campaign_sentEmail campaign भेजा गया#marketing पर summary post करें
order_placedHigh-value order detect हुआविवरण के साथ #sales पर post करें
cart_abandoned30 मिनट के लिए cart abandonedfollow-up के लिए #sales पर post करें
ticket_createdSupport ticket खुला#support पर post करें
unsubscribedContact unsubscribed#marketing पर alert post करें

Slack-to-Brevo Triggers

Slack EventTriggerBrevo Action
message_actionCustom message shortcutcontact को list में जोड़ें या automation trigger करें
block_actionsMessage में Button clickcontact attribute अपडेट करें या email भेजें
view_submissionModal 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: {
customerEmail: '[email protected]',
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: '*Customer:*\n[email protected]' },
{ 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 का उपयोग करते हैं:

TierLimitसामान्य Methods
Tier 11 request/minutechat.delete, conversations.kick
Tier 220 requests/minuteconversations.history, users.info
Tier 350 requests/minuteconversations.list, users.list
Tier 4100 requests/minutechat.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 tokenapp पुनः install करें और नया bot token कॉपी करें
channel_not_foundBot channel में नहीं हैtarget channel में bot को invite करें
missing_scopeआवश्यक scope नहीं दिया गयाscope जोड़ें और app पुनः install करें
Event प्राप्त नहीं हुआEvent subscription सेट नहींEvent Subscriptions URL कॉन्फ़िगर करें
Interaction timeoutResponse >3 सेकंडतुरंत 200 के साथ respond करें, async process करें

Debug Mode

verbose logging enable करें:

connectors:
slack:
debug: true
log_level: verbose
log_events: true

Connection Test करें

Terminal window
tajo connectors test slack
# ✓ Bot token valid
# ✓ Workspace accessible
# ✓ Channels readable
# ✓ Message posting enabled
# ✓ Event subscriptions active

सर्वोत्तम प्रथाएं

  1. Block Kit का उपयोग करें - Slack के Block Kit framework के साथ rich, interactive messages बनाएं
  2. जल्दी respond करें - 3 सेकंड के भीतर interactions स्वीकार करें, asynchronously process करें
  3. संबंधित messages को thread करें - noise कम करने के लिए संबंधित notifications को threads में group करें
  4. Channel द्वारा route करें - विभिन्न event types को उपयुक्त team channels में भेजें
  5. Action buttons शामिल करें - customer data तक त्वरित पहुंच के लिए “View in Brevo” buttons जोड़ें
  6. 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

संबंधित संसाधन

Subscribe to updates

developer-docs

Drop your email or phone number — we'll send you what matters next.

auto-detect
AI Assistant

Hi! Ask me anything about the docs.