Integrating Dialogflow with babelforce is easy, however, there are a few steps you need to be doing on the Google side. This article is a step-by-step explanation.
1st: Create an Agent
Before getting started, make sure to setup the Agent you want to use in your Dialogflow. For each agent, you must create a new integration.
Also, you need to be the owner of the Agent to do the necessary changes.
2nd: Setup a new Service Account in Google Console
To get started, go to the IAM section in the Google console : https://console.cloud.google.com/iam-admin/iam. Select the agent you want to integrate from the top-bar drop down and then go to the side menu item Service Accounts (see screenshot below).
Now create a new Service Account:
Give it any name in the first step, in the second step, select the account access to the Dialogflow API Client.
In the last step, create a new key. Download the JSON file to your computer. This is very important, you will need this file for completing the integration on the babelforce side.
Now go to the file and open it. It will look a bit like the code block below. The three important elements from this file are marked yellow and bold. The only difference will be that you private_key is going to be much longer:
{
"type": "service_account",
"project_id": "intenttraining-xxx",
"private_key_id": "efawefdasdfadsfafeawwfeawffasdfa",
"private_key": "-----BEGIN PRIVATE KEY-----\ndfajladsf+adfliasdfaenfl\nafsdjfladf7894n2nlq4nfef.fwefq342lifneli32\nfajdsflasdf7adf92349324032rjlieafln\n-----END PRIVATE KEY-----\n",
"client_email": "intentapi@intenttraining-xxx.iam.gserviceaccount.com",
"client_id": "12312312321321321321312321",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/intentapi%40intenttraining-xxx.iam.gserviceaccount.com"
}
3rd: Format the private key
Before doing the bit on the babelforce side, go to this onlinen formatter: https://www.freeformatter.com/javascript-escape.html - we will have to get the private_key into a new format. We will get rid of the \n and put the whole key in a nice block.
Copy the whole key into the formatter and press unescape. The result should look something like this (just much longer):
4th: The babelforce bit:
The rest is super easy. Go to your babelforce account, find the integrations sections and click on Add.
Search for Dialogflow
In your last step, fill out the form with the details from the JSON file. For the private key please use the formatted version we created in the step above.
Comments
0 comments
Please sign in to leave a comment.