Watson Assistant: connecting Customer Care to IBM Cloud Functions APIs

Deliver virtual assistants that can do more!

Douglas Ayers
IBM watsonx Assistant
7 min readApr 13, 2022

--

IBM just made it easier to connect your virtual assistants to backend systems and third party APIs using Watson Assistant’s custom extensions. This is particularly good news for companies leveraging IBM Cloud Functions (IBM’s Function-as-a-Service platform) to make their business applications and processes more available. They’re in perfect position to deliver customer care virtual assistants that can do more. This article takes you through the steps needed to connect your virtual assistant to IBM Cloud Functions APIs using Watson Assitant Extensions.

The Value

Why is this a good idea? Watson Assistant is an intelligent virtual agent that helps your customers get stuff done quickly, easily, and on any channel. IBM Cloud Functions lets you run your application code without servers, scale it automatically, and pay nothing when it’s not in use. Using these two technologies together eliminates the need to create, maintain, and host a separate SOE (Service Orchestration Engine) lowering your total cost of ownership.

Enabling your customers to engage with your company through natural language any time they want creates a compelling, smooth customer experience. And because IBM just revamped Watson Assistant to make it dramatically easier for anyone to build, publish, and improve a virtual assistant, you can deliver these experiences faster without incurring long development cycles or needing an army of programmers or data scientists.

How IBM Delivers That Value

IBM’s low code approach to integration delivers more power than a typical webhook while keeping authoring simple. The key to making this kind of enterprise connectivity fast and easy is separating the technical tasks from the design and configuration of the conversational experience you want to create for your customers.

Your API developers just do all the technical things they normally do to write, test, and deploy web services. Your customer care experts who will create the conversational experience with Watson Assistant don’t need to know the technical details of connecting to APIs, how the code is implemented, or even what backend systems are being accessed. That’s because the new Watson Assistant build experience is tailored to people who interact with your customers on a daily basis, not developers. But don’t worry. They are still taking advantage of Assistant’s built-in AI capabilities which automatically handle all sorts of things that could go wrong during a conversation, like topic changes, vague requests, misunderstandings, and asking for a human agent, to name a few.

What the Developer Does

IBM Cloud Functions gives developers a way to rapidly build web services which are implemented as Actions, e.g. an action that opens case tickets in Zendesk, a widely used customer service platform.

An IBM Cloud Functions action to create a Zendesk ticket

IBM Cloud Functions automatically configures the URL endpoint for invoking this action as a standard, RESTful web service.

But let’s say you want to connect this action to a customer facing virtual agent, e.g. to log customer contacts or perhaps queue up needed support. What are the things the API developer would need to do?

Create a Managed API

First, expose the Cloud Functions action as a managed API. Developers often create managed APIs to apply security and rate limiting policies, view API usage and response logs, and define sharing policies.

Simply give the API a name, specify the base path, and provide some additional configuration information.

Then select the authentication method. In this example, API Key authentication is selected.

Generate the API Key

After the managed API is created, generate an API key. These credentials will be needed later when you’re ready to start testing the Watson Assistant extension.

Download the OpenAPI Description

Download the description of the managed API which Watson Assistant will use to create and configure the extension. IBM Cloud Functions automatically generates this description which conforms to the OpenAPI Specification (formerly known as Swagger API).

Convert the OpenAPI Description Format

Watson Assistant Extensions support OpenAPI v3.0.1 in the JSON format. Currently, however, IBM Cloud Functions generates the description in the YAML format at the v2.0 level. So use swagger.io (or the OpenAPI editing tool of your choice) to convert the OpenAPI service description from v2 to v3.0.1 and from YAML to JSON. As supported formats and versions evolve, this step may at some point no longer be required.

Enrich the OpenAPI Description

A few additional pieces of information have to be added to the generated OpenAPI description before using it to create the Watson Assistant Extension. You can add these values using an OpenAPI specification editor or by manually editing the JSON file.

First, add ‘summary’ and ‘description’ properties to the operation. In this example, there’s a ‘post’ operation at the ‘/zendesk’ endpoint but your names will be different. Adding these values ensures that the non-technical, customer care expert configuring the conversational experience will see a natural language description of what the service does.

Next, define the object properties passed to the web service in the request body. These must correspond to the parameter values expected by the Cloud Functions action. Only the name and data type are required. In this example, the web service creating the ticket in the Zendesk expects the six (string) values shown. Your web service may require other data types or even complex object structures, all of which are supported by the specification.

Finally, specify the content type and schema of the data returned by the web service to the application. Cloud Function actions always return an object for which you must define properties. In this example, the sole property is the ‘ticket’ object created by Zendesk. These definitions allow the virtual assistant to reference and communicate data values returned by the service, e.g. the ticket id number.

What the Customer Care Expert Does

Now that we’ve looked at what the API developer does, let’s look at how easily a customer care expert can connect these IBM Cloud Functions APIs (and the business services they expose) to their virtual assistant. They can complete all of this work in the point-and-click environment of the new Watson Assistant build experience.

Create the Watson Assistant Extension

First, navigate to the Integrations Catalog, create the Watson Assistant Extension, and upload the OpenAPI description provided by the API developer.

Everything looks good!

Add the Integration to Your Environment

Add the extension to the environment of choice. Companies typically want to test the extension in a sandbox before moving it to a live environment.

Simply select the environment you want and provide the necessary credentials which in this case will be the API key of the managed Cloud Functions API. The API developer can provide the API Key or perform this step of the set-up themselves.

Create the Conversational Customer Experience

This is where the power of IBM’s revamped build experience for Watson Assistant really shines. You don’t need to be a programmer or data scientist to design the interactions with your customers. One of my colleagues has already written another article describing all that you can do, but here are some of the highlights.

When the customer wants to create a support ticket, or when this action is triggered by something else, tell the assistant to respond by using the extension you’ve just configured.

Map the information you’ve collected in the dialog with the customer to the inputs required by the service. You don’t have to concern yourself with any of the technical details at this point.

Finally, create a response to the customer that communicates whatever information is needed.

Test the Extension

Go ahead and interact with your Assistant which you can do from the build environment to make sure all is working as expected.

All looks great! Our customer care expert can even review the ticket created in Zendesk if desired.

Conclusion

You can see how easy it is to connect your virtual assistant to IBM Cloud Functions APIs. It’s just as easy to connect to APIs of other business applications, e.g. CRM, commerce sites, or real-time data. Go try it out for yourself, and expect more posts from me soon!

--

--

Douglas Ayers
IBM watsonx Assistant

Principal Brand Technical Specialist, IBM Technology, US Industry Market