Search in sources :

Example 1 with Message

use of com.twilio.rest.api.v2010.account.Message in project api-snippets by TwilioDevEd.

the class MmsSender method main.

public static void main(String[] args) throws URISyntaxException {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
    String uri = "https://static0.twilio.com/recources/logos/twilio-loco-circle-50x50.png";
    Message message = Message.creator(// to
    new PhoneNumber("+14159352345"), // from
    new PhoneNumber("+14158141829"), "Where's Wallace?").setMediaUrl(new URI(uri)).create();
}
Also used : Message(com.twilio.rest.api.v2010.account.Message) PhoneNumber(com.twilio.type.PhoneNumber) URI(java.net.URI)

Example 2 with Message

use of com.twilio.rest.api.v2010.account.Message in project api-snippets by TwilioDevEd.

the class SmsSender method main.

public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
    Message message = Message.creator(// to
    new PhoneNumber("+14159352345"), // from
    new PhoneNumber("+14158141829"), "Where's Wallace?").create();
    System.out.println(message.getSid());
}
Also used : Message(com.twilio.rest.api.v2010.account.Message) PhoneNumber(com.twilio.type.PhoneNumber)

Aggregations

Message (com.twilio.rest.api.v2010.account.Message)2 PhoneNumber (com.twilio.type.PhoneNumber)2 URI (java.net.URI)1