This Groovy script is called from an ExpressionRule of type 'Alarm'. For example, in an Expression rule
IF: Alarm.severity > 500
THEN: ExecuteCustomObject("SMSMe", "[numberToSMS]")
calls the script "SMSMe" with the parameter phoneNumber. The ExecuteCustomObject provides a way to call from this simple two-line business rule into a modern programming environment with access to the complete Platform SDK, as well as all the features of the Groovy language. In Groovy, it's straightforward to use the built-in httpclient library to POST an HTTP request to Twilio to send an SMS to the specified cellphone number.
Groovy Scripts
The groovy script named SMSMe is executed by the Expression Rule above and connects to the Twilio Server passing in a list of parameters.
String apiID = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
String apiPass = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
Parameters
Variable Name Display Name
phoneNumber phoneNumber

