Harness Webhooks in Your Series to Send Survey Responses to Slack

  • 10 December 2023
  • 0 replies
  • 172 views

Userlevel 4
Badge +5

As a Customer Support Engineer, a common question I get from customers is, “Can I send Intercom Survey results to Slack?”

The answer is a resounding “Yep”! In fact, it’s possible to do this within Intercom without having to write a single line of code. (Though a little knowledge about how APIs work never hurts 😀!)

 

What you’ll need to do this: 

  1. Create the Series

Create a new Series in your workspace and set up your Audience rules to filter for your intended Survey audience. In my example, I want to send a Survey to all of my customers who have signed up for my product in the last 90 days. This Survey can send on any URL that my Intercom workspace is installed on.

1G3RoI2h-AmoM9JqtjeX1JAC2JGy95LBgd2eWp5sOY4ON3_RcqtkspeJ2SEyz9k6S3CXWzvEzwLFSIJcrrhf9qJDt_LnVi7l91n4x2jJ7Gi2ImTp2UYHXnMDoy2kx5tAo2KI-7ctNgM8O20Ps1bLCZY

  1. Create and Add your Survey

I’m not going to go through all the steps of creating a Survey. If you want to learn how to set one up you can read about that here. That said, one important thing to remember to do when setting the Survey up is to sync the value of your customer’s Survey responses to a Custom People Data Attribute that you’ve created. 

 

In the example below, I’ve created a single-question NPS Survey that stores the User’s response to an Intercom data attribute that I created named nps_score.

PYY4HLouOjm-pAi0EzL-baPnXD2r8JmV92UcIvkVgnSIwr0DnzKtUBxtZXXqVeji_mv5W3WxglYEmK4QyaI-dPrj6efHpXVackKKdKvp6HsVsq2yHK0bxOc-Z_xUKPR-y9KgwLmwS3QegG4p8CKKICw

 

If I were to set the below Series live now, a User who fit the Series’ Audience filters would enter the Series and receive the Survey when they log into my app.

901TE5ABD4v7R8vB1Bvs0rvQWm_ZvSxqkmZR_WLjbGgHarUSG2o_b6JGJXZ26AFLqogh4hSW_KDetcaY4RmnJv1WRRiSBsnOvE9awZecwo58g5yY1VR7q3oZNsDLaCZUlxK98UOtG1V3JeGLU7nCsJ8

  1. Send Survey results to Slack via Webhook

Once a User receives the Survey and submits it, we want to trigger a Webhook that sends a notification message to Slack with the Survey’s results.

 

To do this, we’ll need to use the option “When delivered and completed” for moving the user to the next node of our Series.

vG0UKgVbMqrmYIg2Hk8C3dpZkgwHCoItPgX9JPm6XEdFzqSA3Zu4yxEsogAdIlJMCbDBT8ICoJxmoinP-dAiY-6ckMU1uvBfYwsRFiHnnN-Um5W28IbysClRT-HTtT5duskyft4NDy2Ck2ziRUyGIw4

This will create a Rule Block in our Series which we then want to connect to a Webhook block, as shown below.

ZbS5tT0w1-RTxuqR6DpRClODZJDSwIScZrqYnVEkw8eJLColsEqQsVvXM0SABwdnjcXBtpkdFtAy2_vLbwYeFv_8IVYAn8Y1smRGb0prbiBute8Msa72V-PAApD-BEAurBa9JDnvKpjbtl4WXUCLDlY

 

When working with 3rd party platforms like Slack, you’ll need to make sure that you are consulting their docs so you understand how their side of the setup works. You can find Slack’s API docs here. These docs will walk you through how to:

  • Create a Slack App (if you haven’t already)
  • Enable incoming Webhooks
  • Create an incoming Webhook
  • Use your Incoming Webhook to post a message

Back in Intercom, fill out your Webhook details. You’ll want to make this Webhook call using the POST method and use the Webhook URL that you generated by following along with the Slack docs, above.

 

You’ll need to a Content-Type header of application/json and the message that you send to Slack will be associated with the ‘text’ attribute (as dictated in Slack’s docs). 

 

You can dynamically add the User’s Name, nps_score, and any other user attributes by clicking on the {..} icon that appears when you hover in the value field of the Webhook Body section.

X20jhiehfXmwCok3yYe4r8NH5s7p8ye_hhXdy828h44G4hUVxN6rjj6I7t9P4HIUPfqv29yhEYN7h3Y_77qPKWyhQ6RiZQHjsmAH3vqPUDVc7MUI8z5nUsfzvxKQn4B1pTI4OGYeYgZ2azq8MMKaPFQ

 

Your final Webhook will look something like the one below.

 

86N5cVvuXezUOXYfH63QdDnqdYBr6VfyLfaD9wI0l0Aml8g5is-vRqGptJhYz66BsgK2_bMjBa-Tbw8c4m3ELg-hRxPDwOc8CUCp4S00L0FCch9OFHdpwE6iAJgUjS2XV8exah5XsikXWWbG3m79w-U

NOTE:  “Long text entry” Survey questions can’t be sent this way since they may exceed character length limitations.

 

  1. Test!

Once you have the Webhook set up, you can test it out by clicking on the ‘Test’ button at the top of the screen. 

SySMTOZvvijQWbi8wN3fRG63JoJZ1Zd6zoHSXFEbW-3rmZ7-9eFpqfwW2Rt5pMxPRG_zCfJYQPqfloGYH78yHz1rS-cmw5T35P5fMAoHShBjU-OU5O0sh2UCIk7H-Y9GF4D6AErAMyNheY3HqUWndII

Running that test will make sure that the Webhook is properly sending to your Slack channel 👇

Y-cH4twMHIHtbkILS3wj-c5f9chP1G_2B5USXbVsbR8FhLv7auY-s1MjNtSVb3LOfkUGtIWtayti_79JSbqvskV26dRwmZJMCvqeopBa9Fy94ss-R1lDUqf-ol9bi03F_xjyJpoo4IjvFvAhIh-k_60

 

NOTE: If the attribute that you are storing the Survey response in doesn’t have a value yet for your test User when you click on that ‘Test’ button, then no value will be sent for it in your message.

 

Now that you’ve confirmed the Webhook works you can test out the entire Series with a test User. You can do this by having the Series’ Audience rules target your own test User’s email address and set it live. 

 

Log into your app as your test User. You should receive the Survey modal. When you complete the Survey and submit it, a notification should be sent to Slack to let your team know!

 

You can end the Series here or, if there’s more messaging or actions that you want the Series to take, you can continue to build on to it. 👍


 


0 replies

Be the first to reply!

Reply