Webhooks from within Notification Workflows allow FluentStream customers to integrate specific actions with their own custom built APIs. They also allow for integration between your FluentCloud phone system and web services such as Slack.


In order to set up integration between your FluentCloud phone system and Slack, you first need to follow the guide listed here to set up the desired notification workflow.



SLACK Notifications


You need to enable a webhook for the desired channel/s by browsing to https://my.slack.com/services/new/incoming-webhook/

Choose a channel that you'd like the notification to appear in, and click Add Incoming WebHooks Integration




Take note of the Webhook URL which you'll need to enter in Notification Workflows my.fluentcloud.com




Open the previously created Notifcation Workflow and click "Add New Action"

Select Create Webhook and Select POST from the Hook Verb dropdown menu.

Under Hook URL enter the Webhook URL from Slack's API setup.

"Hook JSON Input" is where the message is specified that you would like posted to your slack channel. 




Here is a basic layout for defining what appears in slack when the notification triggers: (This is the message that we send to Slack, there are more options for this listed in their documentation)


{

    "username": "Notification-bot",

    "icon_emoji": "",

    "text": "Alert Notification. Incoming Call from [[CallerIDName]] <[[CallerIDNum]]> to [[ToNum]] on [[Date]]."

}


Each of the fields above can be customized to fit your needs.


username: You can insert any text in here, this is the username that will show up in slack when a new notification is sent.

icon_emoji: This can be any of the built-in emojis, or custom ones added to your account. (This is an optional field)


text: This is what will be posted to your slack channel. (The variables listed below are what is currently allowed for an incoming call notifications. At this time, only incoming call notifications allow for variables in the text field):


[[CallerIDName]]  This is the name tied to the phone number that is calling in.

[[CallerIDNum]]    This is the Number of the originating caller.

[[ToNum]]              This is the Number that the call came in on.

[[Date]]                  This is the current date and time in the following format: Thursday 12th of May 2016 11:16:59 AM


The rest of the text in this section is fully customizable to fit how you want the message to appear in slack. For more information on richer test formatting please see Slack's documentation here.


Scroll the the bottom of Notification Workflow Settings and click 'Save Notification Settings'.


You should now have Slack notification enabled when the Notification Event triggers!