The Programmable Fax API was closed on the 17th December 2021, so this example app has been deprecated and archived.
This is an example application that you can use to send and track faxes using the Twilio Fax API.
To find out how to build an application like this, read the blog post on how to send and track faxes with the Twilio Fax API using Sinatra and Ruby.
You'll need the following to run the app:
- Ruby
- Bundler for installing dependencies
- ngrok so we can expose webhook endpoints in style
- A Twilio account with a fax capable number
Then clone the application:
git clone https://github.com/philnash/twilio-fax-ruby-sinatra.git
cd twilio-fax-ruby-sinatra
Install the dependencies:
bundle install
Copy the example config file to config/env.yml
:
cp config/env.yml.example config/env.yml
Fill in config/env.yml
with your Twilio Account SID and Auth Token available on your Twilio console. Enter a fax capable Twilio number from your account as the FROM_NUMBER
.
Start ngrok to point at port 3000.
ngrok http 3000
Fill in the URL_BASE
in config/env.yml
with your ngrok URL.
Start the application:
bundle exec shotgun config.ru -p 3000
Open localhost:3000 and start sending faxes!