Extending Watson Assistant: connecting to CRM systems

Here’s how to integrate your assistant in of the most common use cases we see every day. That’s right, Customer Relationship Management systems!

Rachel Liddell
IBM watsonx Assistant
6 min readApr 20, 2022

--

diagram of chatbot extensions

This article was written by Rachel Liddell and Mitchell Mason

Introduction

CRM systems store customer profile information so that you can interact with your customers in a more personal way. Your use case may be as simple as knowing your customer’s name, but in our experience the more you show you know your customer, the more valued they feel.

We’ll use Hubspot as our example CRM, but the interaction pattern and extension is nearly identical for all of the top CRM systems like Salesforce, Zoho, SugarCRM, Microsoft Dynamics, or SAP Sales Cloud to name a few.

Custom extensions in Watson Assistant use OpenAPI specifications to define any integration with a backend system. That way, the integration is easy to set up while still delivering powerful functionality. We’ve already included an OpenAPI spec for Hubspot in our starter kits, and (as mentioned above) any other CRM will follow a similar pattern. It should only take you a couple of hours to customize the Hubspot starter kit for the CRM system your company uses.

Exploring the Hubspot OpenAPI Specification

There are three key pieces to the Hubspot OpenAPI spec: the URL, the request parameters, and the response object.

1. The URL itself : This is obvious, but you’ll need the URL for the API endpoint you’re calling.

The example server & path to create the URL for Hubspot CRM2
URL of the endpoint the Hubspot extension will call

2. The request parameters: The request parameters tell the CRM system who the customer is. In this case, the customer is identified by the {ContactId}. In our example below, we collect this in the very first question to the user, but in a more advanced scenario, you could grab this from the webpage they are logged into and set it automatically.

Example parameters for calling Hubspot CRM to get a user’s profile
Request parameters collected by the Hubspot extension

3. The response object : by default the Hubspot API will return five pieces of information about a customer:

  • createdate: this is the date the customer record was created, the day they became a customer
  • email: this is the customer’s email address
  • firstname: the customer’s first name
  • lastname: the customer’s last name
  • hs_object_id: this is just the same identifier used to look up their profile originally, returned as the key to the profile

*Note: To get back additional profile information you may have stored about the user, you can send additional properties in the request. You can find more details on how to do in the readme file of the starter kit for Hubspot!

Example response object returned by Hubspot CRM
Response object returned by the Hubspot extension

Now that we know the key pieces of the OpenAPI spec to watch out for, let’s set up the custom extension within Watson Assistant

Integrating Hubspot with Watson Assistant

The first step is to create the custom extension for your CRM system using the OpenAPI Spec provided in our starter kit. If you want to learn more about how to add the extension to your catalog, you can review our documentation, our starter kits, or another great post on the subject.

Screenshot of the part of the Watson Assistant integrations catalog where you can add a custom extension
Here’s where to add a custom extension within the Watson Assistant integration catalog

Click the Build custom extension button to import your OpenAPI specification. Once you’ve added the extension and attached it to your environment, you’re ready to start building!

Looking up a customer profile with the Hubspot extension

I would recommend adding this extension directly to the Greet customer action that is already set by the assistant. That way, you can have a customer profile at hand at the very beginning of the conversation, before they even ask a question.

The first step is to collect their customer ID. As we discussed previously, you could also grab this ID automatically for an authenticated user. We just kept it simple for the purposes of this demo. In this example we have a regular expression that will capture any response that has at least one numeric character, which is HubSpot’s default Contact ID requirement.

Regular expression editing in Watson Assistant

Once you’ve collected the customer’s unique identifier, you’ll use it in the extension to pull up their user profile here:

The content author simply maps the response collected in the first step to the contact_id parameter

Now we can use the information returned from the CRM system to craft a personalized conversation. Here we check if their membership status is ‘Gold’ and give them a custom greeting based on that condition.

Step 4 conditioned on the user’s membership status to give a custom greeting

If the user isnt’t a gold member, then you could design the assistant to respond differently.

The extension flattens all of the items returned from the user profile so you can easily choose from them in the condition builder drop down or within the response text. You can direct customers to different actions based on the variables returned, or simply use them to personalize the conversation based on who they are.

Sending a confirmation email with the Hubspot extension

Here’s another example. Imagine that you want to book appointments through your assistant. I don’t know about you, but I always appreciate a confirmation email so I can keep track of my schedule.

Using the Hubspot extension, you can look up the user’s email, rather than asking them to type it out. This approach makes your assistant feel personalized and extra helpful.

Steps within an action addressing the user by their first name referenced from the Hubspot extension

We’re addressing the user by their first name, which we referenced from the Hubspot extension. Then, once we’ve confirmed that the user would like a confirmation email, we confirm their email address, which is another element of the Hubspot user profile.

Steps within an action confirming the user’s email referenced from the Hubspot extension

By using the Hubspot extension, we’re able to easily personalize the conversation with information captured in Hubspot.

But these are just two examples — you could use a custom extension to update the user’s contact information, look up their order history, or add notes to their customer profile. In short, Custom extensions enable you to combine the conversational AI of Watson Assistant with the customer history and personalization powered by your CRM.

Wrapping it up…

We hope these brief examples have illustrated just how easy it is to deliver personalized responses to your customers by combining Watson Assistant’s extensions capabilities with your CRM of choice.

Once this extension is implemented, your domain experts will be able to easily connect to the CRM directly from the Watson Assistant user interface, choose the data points they need for the conversation with the customer, and publish them without any additional work for your development team.

Join us as our extensions journey continues! We will soon publish more guides for filing tickets, working with internal databases, public APIs, and more!

Happy building!

--

--

Rachel Liddell
IBM watsonx Assistant

Rachel is a Product Manager for Watson Assistant. She focuses on channels and integrations.