Home / Companies / Twilio / Blog / Post Details
Content Deep Dive

SMS and MMS Notifications with Java and Spark

Blog post from Twilio

Post Details
Company
Date Published
Author
Jose Oliveros
Word Count
1,063
Language
English
Hacker News Points
-
Summary

The Spark Java application demonstrates how to send SMS alerts when a server error occurs. The application first reads administrators' phone numbers from a JSON file using the Gson library, then configures the Twilio REST Client to send messages with the phone number of each administrator and a custom message. The application handles exceptions by mapping them to a configured type for all routes and filters, sending alerts to administrators when an exception occurs. A custom alert message is created to include a picture or screenshot, and the application logs requests and responses using a logging filter.