0% found this document useful (0 votes)
31 views

github-com-GoogleC...

Uploaded by

Mahmoud Ramadan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

github-com-GoogleC...

Uploaded by

Mahmoud Ramadan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Sign in

GoogleCloudPlatform / dialogflow-integrations Public

Code Issues 51 Pull requests 43 Actions Projects Security

Files master dialogflow-integrations / cx / twilio /

jrash06 Merge pull request #227 from josobar/master 7f691ed · last year

Name Last commit message Last commit date

..

images add twilio instructions for whatsapp last year

README.md Merge pull request #227 from josobar/… last year

package.json changed package.json last year

server.js cleanup last year

test.js init twilio sms cx integration last year

README.md

Twilio (Text Messaging) Integration

Setup

Prerequisites
Follow the instructions on the main README file in the root directory of this
repository.
Create a Twilio account.
Copy and paste the following text into a new file titled env created in the folder for
this integration.
Replace PROJECT_ID with your Google Cloud project ID.
Replace AGENT_ID with your Dialogflow CX agent ID.
Replace LOCATION with your agent's location code, e.g. "us-central-1."

TWILIO_AUTH_TOKEN = ''
PROJECT_ID = ''
LOCATION = ''
AGENT_ID = ''
LANGUAGE_CODE = ''

Retrieving Credentials
1. Log in to the Twilio Dashboard.
2. Under the "Account Info" section, take the values for Account SID and Auth Token
and replace the value for TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN in the
.env file.

Buying a Phone Number


1. Navigate to the Twilio console.
2. Under the "Develop" tab, click "Manage," then "Phone Numbers".
3. Click "Buy a Number. "Search for a number that has SMS capabilities and buy it.
Additionally, all phone 10DLC numbers will need to be registered with Twilio. If this
applies to you, follow this guide to register your new number.

Deploying the Integration Using Cloud Run


In your local terminal, change the active directory to the repository’s root directory.

Run the following command to save the state of your repository into GCP Container
Registry. Replace PROJECT-ID with your agent’s GCP Project ID.

gcloud builds submit --tag gcr.io/PROJECT-ID/dialogflow-twilio

Deploy your integration to Cloud Run using the following command. Replace
PROJECT_ID with your agent’s GCP project Id, and DIALOGFLOW_SERIVCE_ACCOUNT with
the Service Account which you acquired in the Service Account Setup step of the main
README file.

gcloud beta run deploy --image gcr.io/PROJECT_ID/dialogflow-twilio --service

When prompted for a target platform, select a platform by entering the


corresponding number (for example, 1 for Cloud Run (fully managed) ).
When prompted for a region, select a region (for example, us-central1 ).
When prompted for a service name hit enter to accept the default.
When prompted to allow unauthenticated invocations press y .
Copy the URL given to you, and use it according to the README file in the given
integration's folder.

More information can be found in Cloud Run documentation.

You can view a list of your active integration deployments under Cloud Run in the GCP
Console.
Setting up Phone Number
1. In the "Phone Number" section, go to Active numbers.
2. Click on the purchased number.
3. Underneath "Messaging", take the value for the server URL printed in the console
after the completion of the execution of the last command from the above section
to the "A message comes in" fill-in box. Set the first drop-down to Webhook and
the HTTP method to HTTP POST.

Complete
Now simply text the Twilio phone number you registered and your agent will respond.

WhatsApp Setup
This integration can be used as a webhook with Twilio to send WhatsApp messages.

1. Under Messaging and Try it out, select Send a WhatsApp message


2. Follow the prompts to join the sandbox
3. Select the Sandbox settings tab
4. Fill When a message comes in with the webhook URL given during deployment
and select POST for the Method
5. Select Save
6. Send a message to your WhatsApp number to test the integration.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy