27 Apr SMS based customer support system with Restcomm and Zendesk (PART 1)

SMS based customer support system with Restcomm and Zendesk

No matter the size of your business, good customer service will improve the odds of your success. Often, providing great customer service, at the right time and via the most convenient channel for your customers is a challenge. Customers are busy and often on the go. If we value their time and strive to provide the best support possible, we need to be available any time off the day or night. While email is the traditional channel that customers use, they are now requesting SMS because it increases reachability while on the go. More importantly, It saves time, does not require customers or agents to be logged into their email or helpdesk portal account.

In this tutorial we will show you how to integrate Restcomm and Zendesk – one of the most popular customer service software and support ticketing systems (and the one that we use here at Telestax) – and create an SMS-based support system for your customer and support agents. Here is what the application will provide:

  • Get menu with options
  • Create a ticket
  • Update a ticket

 

To begin with, we will need a Zendesk agent account credentials. Note that only agent’s account must have the right to update tickets via the API. Regular user accounts do not have that access.

Secondly, we will need to create a Restcomm Visual Designer (RVD) application that will handle all incoming SMS messages, filter and post them to Zendesk, and then send a reply back to the customer or agent.

Finally, we will register an SMS-enabled phone number and bind the Restcomm Visual Designer application to it.

In our RVD application we will have the following set of modules:

  • A menu module to display all available commands to the user
  • A welcome module with `Control` elements that will filter the incoming SMS
  • A module to create the new ticket in Zendesk
  • A module to retrieve the ticket ID and send it to the user
  • And a module to update an existing Zendesk ticket

 

Let’s get started!

 

Building your SMS based customer support system

Log into your Restcomm account and navigate to Applications. Choose to create a new Visual Designer application. Give your application a name, set its type to SMS and hit Create. After the application is created click on Design button. You will be redirected to the visual designer environment where we will start building the application modules.

Let’s start with the menu module. Drag and drop an SMS element to the work area. Enter the list of all available commands in the SMS text area. In our case these are:

  1. NEW – to create a new ticket
  2. [id] – to update this ticket ID
  3. MENU – to show this menu

Set the sender and recipient fields to $core_To and $core_From values.

SMS based customer support system with restcomm and zendesk menu module

Next, create the Welcome module that will filter all incoming SMS. In this module we will use a set of Control elements in order define our filters. Each application filter will “search” the body text of the SMS for a particular phrase. If the SMS doesn’t contain the phrase we are looking for, a Zendesk ticket won’t be created or updated. All Control elements use regex-match to match the SMS body and tell RVD how to process the message. In other words, it will decide whether that message be used for creation of a new ticket or for updating of an existing issue.

 

Then we will define the menu filter. Drag and drop a Control element into the work space:

  • Choose regex-match from the Conditions drop down.
  • Set the regular expression pattern to “MENU” and its text to “$core_Body” – that’s the variable that stores the SMS text body.
  • Proceed to Actions. Click on the plus button and create a new one.
  • Choose Assign from the drop down and set its variable to “thebody”. Make the variable available for the whole application by navigating to the drop down on the right handside of it.
  • Set its text to “$core_Body”.
  • Create another condition and choose Capture from the drop down.
  • Set its value to “showmenu”. Since we want the body of the incoming SMS to start with the word “MENU” we will set the pattern to “[^ ]+\w+(.*)” and the text to “$thebody” because same has to be extracted from the text body of the SMS.

 

Moving on with the second controller. This one will help us create a new ticket on the behalf of the user.

  • Drag and drop another Control element below.
  • Create a regex-match condition, set its value to “^([NEW]+).+$” and text to “$core_Body”.  
  • Create an Action above.
  • Choose to Assign the “thebody” variable and set its text to “$core_Body”. Make sure that this variable is also available for the whole application.
  • Add another action and choose to Capture “ticketbody” variable and set its pattern to “[^ ]+\w+(.*)”. Set its text to “$thebody”, Similar to the previous controller.

 

The third controller will grab the ticket ID from the SMS body text and handle ticket updates.

  • Drag and drop one more Control element.
  • Create a Condition by choosing regex-match from the drop down, setting the value to “^([0-9]+).+$” and its text to ”$core_Body”.
  • You will also need to add actions. The first condition will be the same as in the other controllers.
  • Assign “thebody’ and set its text to “$core_Body”.
  • Add another action and capture “ticketbody” variable. Set its pattern to “[0-9]+\s+(.*)”  and text to “$thebody”.
  • Then create one last action to capture “ticketid” with pattern “^([0-9]+).+$” and text “$thebody”.

Your screen will now look something like this:

sms based customer support system welcome module controllers

sms based customer support system with restcomm welcome controllers

Let’s now build the Zendesk ticket creation module.

  • Drag and drop and External Service element in the central area of RVD.
  • From the method drop down choose “POST” and set the content type to json.
  • Enter your agent’s username and password in the fields on the right.
  • In the area below enter the following json:
    • {“ticket”: {“subject”: “$core_From”, “comment”: { “body”: “$ticketbody” }}}
      • $core_From variable stores the caller phone number. Same will become subject of the Zendesk ticket.
      • $ticketbody stores the body text of the SMS which will be the body of the ticket.
  • Assign your response to “id” variable.
  • From the scope drop down choose to make it available for the whole application.  
  • Select “object”-> Property named on the right handside.
  • Name it tickets (that is the json object from which we are going to get the ticket ID).
  • Next click on the “add operation” button then select again “property named” from the drop down and name the property “id”.
  • Click one more time on the “add operation” button and this time choose “value” from the drop down.

 

Your screen should look something like this below:

create zendesk ticket with restcomm

Next up is the application module that will send and SMS with the ticket ID to the user after the ticket has been created.

  • Drag and drop an SMS element and enter the text that the user will receive when a ticket is created. In our example we used the following message:
    • “Your ticket has been successfully created. Your ticket ID is $id. Our team member will reach out to you shortly.”
  • You can also open a new ticket, update an existing one or type MENU to get back to the main menu.”
  • Set the To and From fields to $core_From and $core_To so that the user can receive the message properly.

Your screen should look the one below:

sms based customer support with restcomm - send zendesk ticket id

Finally, you have to create the module that will update the Zendesk ticket.

  • Drag and drop external service module.
  • Your service URL will point to the Zendesk API endpoint that updates a ticket:  /api/v2/tickets/{id}.json
  • Your service URL will look like this:
    • https://yourdoamin.zendesk.com/api/v2/tickets/$ticketid.json
  • Select PUT from the method drop down.
  • Set the content type to json.
  • Enter your agent’s credentials on the right side. In the area below enter the following json:
    • {“ticket”: {“status”: “open”, “comment”: { “body”: “$ticketbody” }}}
  • Then drag and drop and SMS element below the external service one and enter the following message in the SMS text area:
    • “Your ticket update was submitted successfully.  
  • You can open a new ticket, update an existing one or type MENU to get back to the main menu.”
  • Set your To and From fields to $core_From and $core_To.

Your screen should now look something like this:

sms based support system with restcomm - update zendesk ticket by id

sms based customer support system with restcomm - confirm zendesk ticket update

Now we are done building the application modules. Next, we need to connect all the modules together in order to make your application work.

Go back to your Welcome module and follow the steps below:

  • Choose your menu condition to “Continue to” menu module
  • Choose your new tickets condition to “Continue to” to Create Zendesk Ticket module
  • Choose your third condition to “Continue to” Update a ticket module

Navigate to Create Zendesk Ticket module. In your external service within the “Make the the routing decision area” choose to “Continue to” Send ticket ID module. Save your application changes.

You are now ready to test your SMS based customer support system!

 

Testing your SMS based customer support system

Head back to your Restcomm Cloud dashboard and register a new phone number. Choose your application from the SMS request area drop down and save your changes.

Start sending SMS messages to the newly registered phone number.

sms based customer support system with restcomm and zendesk chat log

Enjoy your SMS based customer support system 🙂

In a couple of follow up blogs posts, we will show you how to create SMS notifications system for your customers and support agents, as well as how to provide live call support using Restcomm and Zendesk. Stay tuned!

Meanwhile I encourage you to try this out for yourself and sign up for a trial account today.

Rate this article:
Sending
User Review
5 (2 votes)
No Comments

Post A Comment