Skip to content

Instantly share code, notes, and snippets.

@mplacona
Created May 13, 2017 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mplacona/3669d5255f986010977155c5eb9ea3c7 to your computer and use it in GitHub Desktop.
Save mplacona/3669d5255f986010977155c5eb9ea3c7 to your computer and use it in GitHub Desktop.
import com.twilio.http.TwilioRestClient
import com.twilio.rest.api.v2010.account.MessageCreator
import com.twilio.type.PhoneNumber
// ...
@RequestMapping(value = "/sendMessage")
fun sendMessage(){
val client = TwilioRestClient.Builder("YOUR_TWILIO_ACCOUNT_SID", "YOUR_TWILIO_AUTH_TOKEN").build()
val message = MessageCreator(
PhoneNumber("YOUR_PHONE_NUMBER"),
PhoneNumber("YOUR_TWILIO_NUMBER"),
"Look ma I'm type inferred!").create(client)
println(message.getSid())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment