

You can use the other event types if you want to post to Slack before or after messages are sent on PubNub.ĭelete any code in the editor and replace it with a function to post to Slack: // FOR A PUBNUB SERVERLESS ENV. Set the event type to “On Request”, and set the path to “slack-post”. Next, click “Functions” in the sidebar and then create a new module named “Slack Incoming Webhook.”Ĭreate a Function with the name “Slack Incoming Webhook.”
Slack incoming webhooks example how to#
Then click on the keyset that was created for that app. How To Use Here is a curl command example demonstrating how to send a message via an Incoming Webhooks URL. Go to your PubNub Admin Dashboard and select your app. Setting up a Slack Incoming Webhook Function If you want your Action to send messages only to a single Slack channel upon invocation, you need to configure your app with an Incoming Webhook. Once you sign up, you can get your unique PubNub keys from the PubNub Admin Dashboard.


What are Functions?įunctions is a serverless environment for executing functions. Then, click Edit next to Webhook to make your changes. Tip: If you need to add, remove, or modify variables at any point, open your workflow in Workflow Builder. You can also use Incoming Webhooks to ask if a user has permission for a resource with the ability to respond from Slack. In the example below, if the user, severity, and incidentdescription were not sent with your webhook request, the workflow would fail. You can use Incoming Webhooks to send an alert when a user has paid, an error occurred, or if a service isn’t responding. Using Incoming Webhooks, you can create notifications or alerts and even make them interactive. This tutorial explains how to post messages to Slack from a Function using Slack Incoming Webhooks.
