Build integrations with any third-party service or platform
Use our REST API, GraphQL, webhooks, and SDKs to connect any system
// Post to Slack when deal is closed
const { CognexiaClient } = require('@cognexiaai/sdk');
const { WebClient } = require('@slack/web-api');
const cognexia = new CognexiaClient({ apiKey: process.env.API_KEY });
const slack = new WebClient(process.env.SLACK_TOKEN);
// Listen for webhook
app.post('/webhook', async (req, res) => {
const event = req.body;
if (event.type === 'deal.closed') {
const deal = event.data.object;
await slack.chat.postMessage({
channel: '#sales',
text: `🎉 Deal closed: ${deal.title} - $${deal.value}`
});
}
res.sendStatus(200);
});