Table of Contents
Dialogflow: Connecting to Dialogflow
Updated
by xander
How to Build a Chatbot with Dialogflow
How to Use respond.io as a Dialogflow CRM
Connecting Dialogflow to respond.io is simple as you will only need to retrieve a JSON file from Dialogflow and upload it to respond.io platform.
Video Tutorial
This video guide will take you through generating and retrieving the Google Service Account Key (a JSON file) from your Dialogflow Agent and uploading it respond.io platform.
Setting Up Dialogflow
In order to set up Dialogflow, we will need to do the following:
Getting a Dialogflow Account
Step 1: Navigate to this page and proceed to login with your Google account.

Step 2: Review the terms and check the box. Click Accept to proceed.

Creating a Dialogflow Agent
In Dialogflow, there is a module named Agent that acts as the brain of your bot. This component will help your bot understand and classify human languages.
Step 1: Once you have logged in, click the dropdown arrow and click Create new agent at the side navigation menu.

Step 2: Give the agent a name for internal reference. Make any necessary changes to the default settings.

Fields | Description |
Name | For identification purposes. This name will be used for internal reference only. |
Language | The language to be used for Dialogflow's natural language processes. Choose the language of your target audience. |
Timezone | The timezone to be adopted for analytics purposes on Dialogflow. |
Step 3: When you are ready, click CREATE to create the agent.
Connecting to Dialogflow
Connecting Dialogflow to the respond.io platform is simple as you will only need to retrieve a JSON file from Dialogflow and upload it to the respond.io platform.
Step 1: Login using your Google account that is associated with Dialogflow.
Step 2: Navigate to the Settings module by clicking the ⚙ icon beside the Agents dropdown menu.

Step 3: In the General tab, click the link in the Service Account to view the associated Google Project.

Step 4: With the Google Project open, click Go to project setting.

Step 5: In the IAM & Admin menu > Select Service Accounts

Step 6: In the Service Account Details screen, name the Service Account and click CREATE AND CONTINUE

Step 7: Assign the Dialogflow API Client role to the service account > click CONTINUE

Step 8: The Grant users access to this service account step is optional.
Step 9: Click DONE
Step 10: Locate the previously created Service Account and select Manage Key from the actions menu.

Step 11: In the Keys screen, click ADD KEY > Create new key and select JSON when prompted which format of key is preferred > click CREATE


Step 12: Log in to respond.io with your user account and navigate to Settings > Integrations

Step 13: From the list, search for Dialogflow and click Connect.
Step 14: Select the language of your target audience and upload the JSON file downloaded from Step 11.

Step 15: Click Connect to connect the Dialogflow Agent to the platform.
Dialogflow Multilingual Agent
When creating an agent in Dialogflow, the language you choose is set as the default language. With the Multilingual Agent feature your agent can now support additional languages.
How Dialogflow Multilingual Agent works in respond.io
The Language Field in the contact’s details on the respond.io platform is used in the request sent to Dialogflow. When a request is sent to Dialogflow, the contact's language will be included and Dialogflow will resolve and respond according to the language value.
Example: If the Contact's Language Field is English, the platform will request an en response and if the Language Field is Spanish the platform will request the es response.
How to Create a Multilingual Agent
To create a Multilingual Agent, follow the steps below.
Step 1: In the left sidebar menu, click the + button to add another language.

Step 2: In the Languages tab click Select Additional Language and select an additional language from the dropdown menu.

Step 3: To add language localization for a specific region, hover over the language and click + Add locale.

Step 4: Click SAVE
What's next?
The interaction between Dialogflow Agent and Contact is managed by intents. In summary, intents are used to describe the expected behavior for one conversation turn based on the prescribed incoming behavior.
Read more on how to manage intents: