Giter Site home page Giter Site logo

artificialsolutions / tie-api-example-twilio-whatsapp Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 6.0 75 KB

Make your Teneo bot available on Whatsapp or SMS using the Twilio API for WhatsApp.

Home Page: https://developers.artificial-solutions.com

License: Apache License 2.0

JavaScript 100.00%
twilio-whatsapp teneo teneo-engine teneo-studio

tie-api-example-twilio-whatsapp's Introduction

tie-api-example-twilio-whatsapp

This node.js example connector allows you to make your Teneo bot available on WhatsApp using the Twilio API for WhatsApp. This guide will take you through the steps of setting up a Twilio WhatsApp sandbox phone number and deploying the connector so it can respond to messages sent using WhatsApp.

Note that the Twilio API for WhatsApp is currently in Beta and is subject to change before becoming generally available.

Prerequisites

Https

Making the connector available via https is preferred. Ngrok is recommended for this.

Teneo Engine

Your bot needs to be published and you need to know the engine url.

Setup instructions

Download, install and start connector

  1. Download or clone the connector source code:
    git clone https://github.com/artificialsolutions/tie-api-example-twilio-whatsapp.git
    
  2. Install dependencies by running the following command in the folder where you stored the source:
    npm install
    
  3. Start the connector with the following command (replacing the environment variable with the appropriate value):
    TENEO_ENGINE_URL=<your_engine_url> node server.js
    

Make the connector available via https

You can make your locally running connector available via https using ngrok as follows:

  1. The connector runs on port 4337 by default, so execute the following command:
    ngrok http 4337
    
  2. Running the command above will display a public https URL, copy it, we will use it in the following steps.

Setup a Twilio WhatsApp phone number

  1. Setup a free Twilio account, which comes with free credit money you can spend on buying a number.

  2. Go to the left panel menu and click the Programmable Messaging item, then from the submenu choose Try it Out > Try Whatsapp.

  3. Follow the 5-step process to setup communication between Twilio Sandbox and WhatsApp on your phone.

  4. Next, in Programmable Messaging > Settings > Whatsapp Sandbox Settings submenu, add the https URL you copied earlier to the When a message comes in field. Hit save at the bottom of the page.

That's it! Now you can use the WhatsApp sandbox to interact with your bot!

Running the connector on Heroku

Note: Starting November 28, 2022, free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis® plans will no longer be available.

Click the button below to deploy the connector to Heroku:

Deploy

In the 'Config Vars' section, add the following:

  • TENEO_ENGINE_URL: The engine url

Next, follow the 'Setup a Twilio WhatsApp phone number' instructions above. Make sure that in the step 4 you set the 'When a message comes in' URL to the url of the Heroku app.

Twilio API for WhatsApp

The Twilio API for Whatsapp is currently in beta. For more details, visit the Twilio website: Twilio API for WhatsApp.

tie-api-example-twilio-whatsapp's People

Contributors

dependabot[bot] avatar josuegalher avatar jp-artsol avatar lucaswillering avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.