Slack Apps with Apex on Salesforce

Slack has traditionally been associated more with non-Salesforce backends such as AWS. Now that Slack is a Salesforce product, Salesforce developers are probably curious about what is like to develop Slack apps. Good news! Salesforce is a wonderful backend for building Slack Apps! This post will show you how you can use your existing, Slack Apps with Apex on Salesforce.

Salesforce is a good platform for building many Slack apps on. We will talk about include concepts such as security, surfaces, interactions, and an overview of the various Slack APIs.

Transferable skills

Salesforce has a database and Apex, as well as APIs but Slack just has APIs.

Similarities between Apex and Slack

  1. Slack Web API / Salesforce REST API
  2. Slack bots / Service Account in Salesforce (integration user)
  3. Slack Events API / Salesforce Platform events
  4. Workspace / Dev org
  5. Global, message shortcuts / Global quick actions, object quick actions
  6. Block Kit / Lightning Base Components

Slack APIs for Salesforce

  1. ? RTM API (WebSocket, older, doesn’t support some of the new rich features)
  2. ? Socket Mode (WebSocket for Web API / Interactivity)
  3. ? Slack Incoming Webhooks (old school, simple)
  4. ✅ Events API over HTTP (Slack calls your endpoint)
  5. ✅ Slack Web API

Surfaces (ways your app can present to the user)

  1. App Home Tab
  2. Modals (Block Kit)
  3. Messages (text or Block Kit)

Slack Events

  1. Passive way to do things similar to Interactivity.
  2. New user joins a channel
  3. User deletes a message
  4. User adds emoji reaction
  5. User sends a message

Security

Think of endpoint URLs like password.  Long and strong.  We get 2 or 3 chances with a URL! Token verification or signature verification. Grant proper guest access to platform events and Apex Classes.

Slack Apps with Apex on Salesforce Video

YouTube video

Summary

Now we understand how to build Slack Apps with Apex on Salesforce. Check this repo for complete code used in demo.

Amit Chaudhary
Amit Chaudhary

Amit Chaudhary is Salesforce Application & System Architect and working on Salesforce Platform since 2010. He is Salesforce MVP since 2017 and have 17 Salesforce Certificates.

He is a active blogger and founder of Apex Hours.

Articles: 461

Leave a Reply

Your email address will not be published. Required fields are marked *