Search code examples
node.jspush-notificationchatslackslack-api

Slack API client for push notification


I'm building a Slack (instant messaging) chat client, I'm looking for a way to trigger a notification to receipent when a new message is sent to him, push notification of course.

What's the endpoint or stream API to be able to trigger a push notification to devices?

I think it should be some backend microservice listening for incoming messages in a channel with a list for users to notify.


Solution

  • If you want to get instant notifications about new messages posted to a channel you can either use the Real Time Messaging API (RTM API) or the Events API.

    The main difference:

    • RTM API uses Websockets and you will receive a constant stream of events about everything that happens on the connected workspace.

    • Events API uses standard HTTP requests and Slack will only send events to your endpoint that you subscribed too.

    There are many factors to consider when choosing the right API for a project. Please also see the official FAQ from Slack on the topic for more details.