Slack integration
In short
Post messages, list channels and look up people in a workspace. Connect it on the Integrations page; your app then calls Slack through Sapilon without ever holding a Slack credential.
Lets your app post and update messages as a bot, list channels and look up users in the workspace you connect. Messages that mention the bot or DM it can be delivered to your app as events.
Add the bot to a channel before it can post there.
Connecting
On the Integrations page choose Connect on Slack, sign in to Slack and allow access.
You choose these permissions while connecting:
-
Receive messages that mention the bot (on by default)
-
Receive direct messages to the bot
-
Sapilon connects a bot to your workspace; it posts as the bot, not as you.
-
Invite the bot to a channel (/invite) before your app posts there.
What your app can do
Only these requests are available; anything else is refused.
POST /chat.postMessagePOST /chat.updateGET|POST /conversations.listGET|POST /users.listGET|POST /users.infoGET|POST /users.lookupByEmail
Events
Your app can react to: message, app_mention. Sapilon’s own Slack app delivers them for every workspace, so there is nothing to set up.
How the agent uses it
Use integrations.request('slack', …); paths are Slack Web API methods relative to https://slack.com/api. Slack answers HTTP 200 with { ok: false, error } on failure: check body.ok.
POST /chat.postMessage— Example:{ method: 'POST', path: '/chat.postMessage', body: { channel: '#sales', text: 'Deal closed' } }.POST /chat.update— edit a message the bot posted. Example:{ method: 'POST', path: '/chat.update', body: { channel: 'C123', ts: '1727.01', text: 'Updated' } }.GET /conversations.list— Example:{ method: 'GET', path: '/conversations.list', query: { types: 'public_channel', limit: '200' } }.GET /users.list,GET /users.info,GET /users.lookupByEmail— Example:{ method: 'GET', path: '/users.lookupByEmail', query: { email: 'sara@acme.com' } }.
The bot can only post in channels it was invited to. Events: integrations.on('slack', 'app_mention', handler) and 'message' (direct messages).
More from Slack: https://api.slack.com/methods