ADAM CHAN: Hello, and welcome to Getting
Started with Business Messages.
This is Adam, your friendly Business Communications
Developer Relations Engineer.
And in today's video, I'll show you
everything you need to do to set up a conversational agent
on Business Messages.
Let's start with a 10,000-foot view.
Business Messages connects a business
and an interested consumer.
As a consumer is searching for a business on Google,
they may see a chat button tied to a store location,
a brand, or when they're trying to contact a company.
The chat button appears to the consumer
in a timely and helpful manner as they
are going about their search, getting them
into an engaging conversation with the business
when they need it.
When they tap on Message, it opens a conversational surface
with the business.
And when they begin the conversation,
their message flows through the Business Messages platform
to a messaging provider or the brand itself.
The platform can be used to help drive sales,
build customer loyalty, and improve customer satisfaction
through assistive experiences and rich features
within the conversation.
The messaging provider's web application
exposes a webhook endpoint, and this webhook
is where you receive messages from the Business Messages
platform as JSON payloads.
The web application should respond
to the messages received from the users,
and these responses go through the Business Messages platform,
where we manage the delivery of that message to all users.
In this video, I'll help you get set up as a messaging provider
so you can have conversations on Business Messages.
Don't have a webhook?
Don't sweat it.
In this video, we'll deploy a sample application
we've created to make this easy for you.
Don't have your own infrastructure?
No problem.
We'll use Google Cloud and deploy to Google App Engine,
and it will be frictionless.
So we are going to do a number of things today.
We will create a Google Cloud project,
register with Business Messages, wait for
and receive the confirmation email,
enable the APIs in Google Cloud, deploy a web application
to receive messages, head over to the Business Communications
Developer Console and set the webhook URL,
create a brand and an agent, then have
our first conversation.
Piece of cake, really.
So without further ado, let's jump over to the computer.
First, we must log into the Google Cloud platform
to create a GCP project.
Navigate over to this URL, and select the dropdown,
and then click New Project.
Set a name of your liking, and click Create.
GCP takes a moment to complete this request,
but when it is done, you'll be prompted
with this notification, where you can click Select Project.
Once you click that, you'll be presented
with your project information.
We'll note the GCP project number and the project ID
for later.
To register with Business Messages,
head over to the developer website.
Navigate to the Developer Docs, on the left-hand menu Select
Register with Business Messages.
In Register with Business Messages,
you'll find a form as you scroll down the page.
Let's complete it together.
In the email field, I'll specify my email.
Part of our terms of services is that we
require corporate emails tied to an employer's domain.
Personal emails, like at gmail.com, are not allowed.
Partner Name is the name of my organization.
I'll use BizComms, which is short for Business
Communications.
The GCP project number is the project number of the Google
Cloud project I just created.
I'll just copy and paste that from my note.
The Reporting Email is the account
where you want to receive quality monitoring metrics.
For example, you will receive customer satisfaction reports
of how conversational experiences went for customers.
I'll just specify my own email.
We are going to skip the webhook URL field in this form,
but we will add it when we are inside
of the Business Communications Developer Console.
If you have colleagues that you'd
like to give access to the Business Communications
Developer Console, access to the Business Messages API,
or invitations to our biweekly office hours,
this is the place to specify those emails.
You can also email bm-support@google.com
at a later time to add your colleagues.
Finally, open and read the Terms of Service
for Business Messages.
When you are ready, come back to the form,
click the checkbox to agree, and submit it for registration.
At this point, we are done with the prerequisite setup.
We can step away from the computer for a short time
and wait for the support team to confirm your registration.
Now is a good time to pause and take a break.
Come back to the video when you've received confirmation
from the support team.
You should expect to hear back within one business day.
This is the partner registration confirmation email
that our support team will send you.
It contains all of the information that
allows you to integrate with Business Messages API and much
more.
With this email in your inbox, we are ready to proceed.
Let's head back to the Google Cloud Console
to enable the APIs.
Make sure the correct project has been selected if you
have multiple GCP projects.
We'll need the Business Communications API
and the Business Messages API.
Additionally, we'll need the Cloud Build
API to build our application for Google App Engine.
Click on the hamburger menu on the top left,
and scroll down to APIs & Services, and click Library.
Let's first enable the Cloud Build API
to allow us to use Google App Engine.
Search for Cloud Build API, select it, and select Enable.
This prompts a modal to come up on screen
to select a Billing account if you haven't already set one.
We need to enable two more APIs for use
with Business Messages-- the Business Communications API
and the Business Messages API.
So you might be asking, why two APIs?
Within Business Communications, we actually
have a whole suite of products.
If you haven't already, check out Verified SMS, RCS Business
Messaging, and Verified Calls.
I'd recommend it, as they are really
cool technologies built on well-tested communication
protocols.
The Business Communications API allows
you to interact with business communication entities,
such as brands, agents, and locations,
for use across our product suite to make your life easier.
The Business Messages API lets you send messages
over the Business Messages platform.
To enable these APIs, search for Business Messages,
select Business Messages API, and click Enable.
And when it completes, go back and do the same
for the Business Communications API.
Let's deploy a web application that
can receive and respond to messages
over Business Messages.
We will be deploying to the Google Cloud platform
using Google App Engine to run our application.
The application exposes an endpoint
that we call your webhook, and this
is where Business Messages sends conversational data.
Head over to the Business Communications GitHub page.
There, we have a variety of samples
that we maintain regularly to ensure
we are showcasing the latest features introduced
on Business Messages.
We are going to deploy one of the echo bot samples.
We have these samples written in Python, Node.js, and Java.
They are all mostly the same, with minor differences.
For this video, we are going to deploy the Node.js sample.
Grab the Git clone link, and then head over to our terminal.
Let's create a new folder on our machine, navigate to it,
and clone the GitHub sample.
We'll be deploying the full sample,
so navigate to full_sample within the Git repo.
Now that this is done, it's a good time
to ensure we have gcloud installed.
Gcloud is a binary that lets us communicate with GCP
and deploy applications right here from our command line.
You can check if you have gcloud installed just
by issuing the command gcloud in the terminal.
This should be your expected output.
You can also check the version of gcloud
by issuing this command.
If you don't have gcloud installed,
you can check out the gcloud SDK page
for installation instructions.
With gcloud installed, let's authenticate
so we can communicate with our GCP account.
Now we should set our project configuration.
My GCP project name that I registered with Business
Messages is {} so I'll issue this command.
Great.
Now that we are ready, we can go ahead
and deploy our application.
As this is our first deployment, we
will be prompted with a few configuration details.
The first is to select a region where you want your App Engine
application to run.
As I'm in US region west, I'll select
one of the us-west servers.
It then presents us with the details about the GCP project
set and to confirm what we are seeing is correct.
Everything looks right here, so I'll proceed
by typing Y and hitting Enter.
All right.
So our infrastructure is set up, and we
are super close to having our first conversation.
Bear with me now, this is the final stretch.
Note down the URL endpoint that has
been set after deploying the echo bot sample.
The echo bot application encodes a URL endpoint at /callback.
So by appending the /callback to the end of the URL,
we have our webhook endpoint.
We'll need this for the next step.
Navigate to the Business Communications Developer
Console.
This is the developer console.
We are going to use it to set your account webhook URL
and create brands and agents.
Everything you can do in the console
can also be done directly using the Business Communications
API.
Let's get on to updating our webhook URL first.
In the top right corner, click the gear icon
to enter the Settings.
Make sure you see reference to the GCP project
you've created for this tutorial.
We can set our project webhook here.
Set the webhook endpoint to the URL
that we made note of earlier.
This configuration ensures that the Business Messages platform
will send messages over to that webhook URL
until an appropriate response is received.
Let's head back into the console's main view
and create our first agent.
An agent is the entity that a user interacts with
and is the representation of a brand within Business Messages.
The configuration details you make on the agent
is what a user ultimately sees when
interacting with your agent on Business Messages.
Once you're happy with your brand and agent name,
you can go ahead and click Create Agent.
Once the agent has been created, you
can click on the agent to view the agent overview.
Here, there are some key identifiers specific
to your agent.
You'll also find the agent test URLs and verification status.
You'll need to send the agent test URLs to your mobile device
for testing.
You can manually create an email, send it via text,
or use the Send feature provided in the console.
I'll make use of the Send feature, which
will send the test URLs to the currently signed-in email.
Then, on your mobile device, open up the email
and tap the URL for the appropriate platform
and invoke the conversational surface
to have your first conversation.
Check it out.
We are interacting with an echo bot
that we deployed on Google App Engine on the Business Messages
platform.
The echo bot that is deployed can
showcase some of the rich features on the platform.
For example, if I send the phrase "card,"
I'll get a rich card.
Similarly, if I send the message "carousel,"
I'll see a carousel of cards.
And lastly, if I send the message "chips,"
I'll get a list of suggestion chips
that can help guide the conversation.
These features can be added as conversation starters
through the console or the APIs to guide
the user into the conversation.
As you'd expect from an echo bot,
the bot will also echo messages that you send it.
There are tons of use cases with applications built
on messaging alone, and a lot can be done
with Business Messages today.
Check out some of our samples on GitHub.
We also have codelabs that walk you
through the use of our APIs to build more complex experiences.
And for more detailed information about the Business
Messages platform, I recommend checking out
the developer website and the Business Messages home page.
Thank you for watching this video.
I hope you were able to deploy an agent smoothly.
And if you need support, please reach out
to bm-support@google.com with your inquiry.
I'm looking forward to catching you next time.