Slack "New Event" setup. How to check new messages in private channel?

I’m trying to connect the Slack module “New Event” to receive data on a webhook when a new message is posted in a private channel.

  • But no matter how I try, no matter what permissions I add, nothing comes to the webhook. I do everything according to the tutorial from the Make documentation.



blueprint (5).json (8.5 KB)

I’m trying to connect the Slack module “New Event” to receive data on a webhook when a new message is posted in a private channel.

But no matter how I try, no matter what permissions I add, nothing comes to the webhook. I do everything according to the tutorial from the Make documentation.

have you ever solved it? I’ve got nothing and I’m sure I’m missing something simple :frowning:

No, I use the HTTP module for this.

1 Like

Appreciate your reply @Oleksandr_Tsap!

Hello! Welcome to the Make Community @Oleksandr_Tsap and @fily.
I made the same test as you, and I had the same issue. It looks like the Event Subscription is not created in the Slack App, for an unknown reason. I will ask what happens to figure out if there is something specific we are missing in the documentation.

But, I managed to make it work with a Make Custom Webhook, and configuring manually the Event in the Slack App.

image

If you still need to do it, let me know, so that I share how I did (it requires a few tricky steps)

Benjamin

4 Likes

@Benjamin_from_Make it would make my day if that’s not a problem :slight_smile: been trying to do it this way (I need to get the file attachment) but it was beyond my level. Thanks!

1 Like

Here are the steps I went through

Step 1: we create the App in Slack (Slack API: Applications | Slack)
In our context, Oauth2 is not really needed unless we want connect to Slack from Make to send messages as a user or as a bot, or to do any other action.
I added the redirect urls for User and Bot connections in case we need it later, but it’s not mandatory if we only want to subscribe to events.
Redirect URLs I used:
https://www.integromat.com/oauth/cb/slack2
https://www.integromat.com/oauth/cb/slack3

Step 2: In Make we create a new Custom Webhook, and we copy its URL
This step is classic, it allows us to generate the URL we need in the Slack App

Step 3: We configure the Event Subscription in Slack (part1)
See the recording and see my explanation below


We have copied the URL of the Webhook, and we enabled Event Subscriptions in the Slack App
You notice that when we added the url of the webhook, it failed. It’s because Slack expects a response from the webhook during configuration. I show the documentation. It expects the webhook scenario to return the challenge. It’s next step below :blush:

Step 4: We continue to configure the Event Subscription in Slack (part2)


As you see, since the scenario was off, the message is still in the queue, so we run the scenario; it will help us see the structure of the data sent by Slack for testing.
We add a webhook response with relevant body and header, and we run the scenario. Then in Slack we retry => passed!!

Step 5: We continue to configure the Event Subscription in Slack (part3)


This part is key. You can see there are 2 types:

  • Bots event
  • On behalf of users
    I configured only for Bot, but you can use any of the 2, for any type of event, it’s just amazing!
    I don’t know everything about the behaviour for other events, but for the one I chose “Message.groups”, here is the behaviour according to the type you choose:
  • Bots Event (the one I chose in the video): Only the Private Channels where the Slack App is invited will be monitored!
  • On behalf of users
    I’m not completely sure it works everywhere, but so far, all my private channels were monitored, I didn’t need to invite the Slack App
    IMHO, Bot event is better in that case. We’ll see later how to invite the App to a private channel.

Step 6: Deploy the Slack App in the Slack Workspace

Step 7: Invite the Slack app to any Private Channel we want to monitor

Step 8: adapt the webhook scenario and test

TADAAAAAAAA!!!
As you can see, we no longer need the Webhook Response since it was used during configuration.
And we had a message in the queue => This is important, you will also receive notifications when the Slack App is invited or removed to/from a Private Channel. Can be useful when you want to prepare some database for instance

Voilà, I hope it was clear. Please give it a try, and let me know the outcome.

Have fun!

Benjamin

9 Likes

Bloody THANK YOU! :fire: works like a charm

3 Likes

Hey there @fily :wave:

Glad to hear that this amazing solution from @Benjamin_from_Make has worked for you. Would you mind marking his comment as a solution?

This way we keep our community organized and tidy. Thanks! :broom:

Can I do it if it’s not my thread? Can’t see how.

My bad, I thought that this was originally your thread. Thanks for pointing me in the right direction. :pray:

Also, remember that it’s always better to create a new thread for your question, rather than to comment on an older post. This approach also keeps our community organized. Thanks :star:

1 Like

So, it seems that native Slack module “New Event” isn’t working as expected? Maybe there are some plans to fix it?

1 Like

@Anton_Zanizdra welcome to the community!

Good point! Let me ask and get back to you

Benjamin

Hello @Anton_Zanizdra,

I had the information that it’s a known issue. It’s under investigation.

Kind regards,

Benjamin

1 Like