Since we use Twilio in a lot of our R packages while running analysis for our clients, we have built a wrapper for contacting the API. You can see and install it here. We have also built API wrappers for Stripe, Sendwithus, and Mandrill. Using these helps prevent code bloat and makes it cleaner. A lot of this post is going to be very similiar to our old blog post about Twilio and Shiny.
As Shiny Server gets more and more production ready, developers are adding new features that typically aren't easy to build in—examples include automated phone notifications through Twilio. Twilio allows your application to send phone calls and text messages to users of your application when a triggering event occurs. For example, we use it to call our clients of potential flaws, taints, and contamination's in their products in real time.
This tutorial will teach you to integrate Twilio with a basic Shiny application which places a sample call to your users. This tutorial will leave you with a working application which you can build into your own needs. This tutorial will require the following:
This tutorial focuses on Shiny Server, but most of the code could easily be converted to other R based web frameworks or batch scripts. The code for the Shiny Version is located on GitHub.