Dialogflow Twilio Programmable Chat Integration allows you to easily create Twilio Programmable Chat bots with natural language understanding based on the Dialogflow technology.
Setting Up Programmable Chat
In order to set up the Twilio Programmable Chat integration for your agent, you'll need the following:
Create a Chat Service in Twilio
Login to Twilio and click on the three horizontal dots, and then Programmable Chat.
Click on the Get Started button, then the Create a Chat Service button.
Enter a Friendly Name and then click on the Create button.
Getting Your Service SID
Make note of the Service SID on the Base Configuration page.
Getting Your Account SID
Click on the three horizontal dots, Programmable Chat, and then Show API Credentials in the upper right corner.
Make note of the Account SID in the revealed section.
Getting Your API SID and Secret
Click on Tools > API Keys then Create new API Key.
Enter a Friendly Name and then click Create API Key.
Make note of the SID and Secret, check the box and click Done.
Setting Up Dialogflow
In Dialogflow, go to Integrations in the left hand menu.
Click on Twilio.
Enter the related info into the following fields:
- Service Instance SID
- Account SID
- API Key SID
- API Secret
Click the Start button.
To test your agent, you will need to download and setup a test application.
- Download the IP Messaging Demo Application and unzip it.
- Open the unzipped folder and make a copy of "credentials.example.json".
Rename the file to "credentials.json" and enter the following info:
- accountSid - This is your Account SID
- signingKeySid - This is your API Key SID
- signingKeySecret - This is your API Secret
- serviceSid - This is your Service Instance SID
Save the file.
In a terminal, cd to the unzipped folder and run the following commands:
- npm install
Go to http://localhost:8080 in your browser, enter a name, and click the Log in As Guest button.
Click Channel for Dialogflow bot on the left and then start talking to your agent.