Giter VIP home page Giter VIP logo

automated-survey-rails's Introduction

Twilio

Automated Surveys with Ruby on Rails and Twilio

This application demonstrates how to use Twilio and TwiML to perform automated phone surveys.

Read the full tutorial here!

Note: protect your webhooks

Twilio supports HTTP Basic and Digest Authentication. Authentication allows you to password protect your TwiML URLs on your web server so that only you and Twilio can access them.

Learn more about HTTP authentication here, which includes sample code you can use to secure your web application by validating incoming Twilio requests.

Local development

This project is built using the Ruby on Rails web framework and NodeJS to serve assets through Webpack.

  1. First clone this repository and cd into it.

    $ git clone [email protected]:TwilioDevEd/automated-survey-rails.git
    $ cd automated-survey-rails
  2. Install Rails dependencies

    $ bundle install
  3. Install Node dependencies

    $ npm install
  4. Create the database and run migrations.

    Make sure you have installed PostgreSQL. If on a Mac, I recommend Postgres.app.

    $ bundle exec rails db:setup
  5. Make sure the tests succeed.

    $ bundle exec rspec
  6. Run the server

    $ bundle exec rails s
  7. Expose your application to the wider internet using ngrok. You can click here for more details. This step is important because the application won't work as expected if you run it through localhost.

$ ngrok http 3000

Once ngrok is running, open up your browser and go to your ngrok URL. It will look something like this: http://9a159ccf.ngrok.io

  1. Configure Twilio to call your webhooks

You will also need to configure Twilio to call your application when calls or messages are received on your Twilio Phone Number.

The Voice Request URL should look something like this:

http://<sub-domain>.ngrok.io/surveys/voice

The SMS & MMS Request URL should look something like this:

http://<sub-domain>.ngrok.io/surveys/sms

That's it!

How To Demo

Voice Surveys. Call your Twilio phone number and follow the instructions.

SMS Surveys. Text your Twilio phone number with any text and follow the instructions.

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.

automated-survey-rails's People

Contributors

acamino avatar dependabot-preview[bot] avatar dependabot[bot] avatar dprothero avatar joliveros avatar kathyguerron avatar maylonpedroso avatar mmena1 avatar ronualdo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

automated-survey-rails's Issues

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler could not find compatible versions for gem "ruby":
  In Gemfile:
    ruby (~> 3.0)

    bootstrap (>= 4.5.3, <= 4.6.0) was resolved to 4.6.0, which depends on
      ruby (>= 2.3.3)

    pg was resolved to 1.2.3, which depends on
      ruby (>= 2.2, < 2.8.dev) x64-mingw32

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Tutorial Changes

In the tutorial titles for each step should be in Title Case. Also, there is a missing url in line 189

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.