Introduction
Totango's Webhook action in SuccessPlay is a powerful feature that allows you to call 3rd party APIs and push messages to Slack and other systems near real time! Let's walk through a scenario and learn how to push messages to Slack based on events in Totango. Here is a sample Slack post for an NPS response that was received from David for Account ABB. Let's look at how we can configure a webhook in Totango to post a message as shown below to a designated Slack channel
Steps to post NPS survey responses to a Slack channel.
Before we begin, this article assumes you have an active NPS survey running in Totango that is sent to customers. If you haven't setup your NPS survey I suggest you read this article to setup your NPS survey and come back her to setup the webhook to push the NPS survey responses to your Slack channel.
1 - Create an incoming webhook app in Slack
The first step is to generate an incoming webhook URL in Slack that you can use later. If you already have an incoming webhook you may use that and skip to setting up the SuccessPlay in Totango in Step 2.
Go to api.slack.com and click on "Create a new Slack App"
- Provide an App Name and choose the right workspace
- Once created go to "Incoming Webhooks" on the left as shown below
- Turn on Activate Incoming Webhooks and also click Add New Webhook to Workspace
- Choose a Slack channel to post the survey responses to.
-
- Copy the Webhook URL
- You are now ready to create your SuccessPlay in Totango 😊
2 - Setting up your Webhook in Totango
Create a new SuccessPlay in your Voice of the Customer SuccessBLOC or the SuccessBLOC that is running your NPS survey.
- Go to SuccessPlays tab and click on + to create a new SuccessPlay
- Provide a name and specify the criteria for the right segment of customers whose survey responses you want to post on the Slack channel
- Choose the Webhook Action in the Play and uncheck the "Trigger actions for users that currently meet the defined criteria" so your Slack channel is not flooded with survey responses. When the Webhook page opens start entering the following details
- Enter a name for the Webhook
- Enter the Incoming webhook URL you copied above in Step 5
- Choose the Advanced option to enter the JSON of the NPS message. The message uses Slack's Block Kit format to configure the message. Paste the following JSON I have prepared for you here. If you look closely all the dynamic attributes are wrapped in the {{}} format. Account attributes are written in {{account.attribute api name}} and user attributes are written in {{user. attribute api name}}. Use the "Add data" link at the bottom right of the textarea to insert account or user attributes.
-
{
"type":"home",
"blocks":[
{
"type":"header",
"text":{
"type":"plain_text",
"text":"Account - {{account.account_name}}"
}
},
{
"type":"divider"
},
{
"type":"context",
"elements":[
{
"type":"image",
"image_url":"https://uploads-ssl.webflow.com/5abc6c4b0a243a475139ee3b/604794d2481099ddcc3d362e_webhook-user.png",
"alt_text":"{{user.First Name}}"
},
{
"type":"mrkdwn",
"text":"*<https://app-test.totango.com/t01/vijay-pmtest/#/users/{{user.User Id}}|{{user.First Name}} {{user.Last Name}}>*"
},
{
"type":"mrkdwn",
"text":"responded to NPS Survey"
}
]
},
{
"type":"section",
"text":{
"type":"mrkdwn",
"text":"NPS Score: *{{user.Relationship NPS}}*\nSurvey Response Date: *{{user.Relationship NPS_response_date}}*\nNPS Comment: *{{user.Relationship NPS_comment}}*"
},
"accessory":{
"type":"image",
"image_url":"https://uploads-ssl.webflow.com/5abc6c4b0a243a475139ee3b/604794d2596186bcd75ebd30_webhook-detractor.png",
"alt_text":"Detractor"
}
}
]
}
-
- Preview the JSON to double check if it looks ok.
- Press the Test Connection button by choosing a sample user. At this point you should see a test post in the slack channel!
- Set the schedule and activate the Play
- You are all set! NPS responses should start getting posted to the designated channel once the Play is active
Other scenarios to post to Slack
The above scenario was just one example but there could be many scenarios that may apply that is unique to your business! One of our customers has a "Digital Hurray's" program where they want to broadcast every major milestone their users complete as a motivation to internal team to indicate adoption of the product! This feature would work beautifully for that. Do you have other ideas? Tell us and we would love to add them here so it triggers ideas for other customers.
Here are a few Images for you to use with ❤️ from our designer!
Comments
0 comments
Please sign in to leave a comment.