Lisa Gilbert
Lisa Gilbert

Reputation: 65

Sending sms via Twilio with link

I'm trying to send sms using the twilio-java helper library on a Java application. I would like to include a link in my sms and alt its text. How is that possible? Here's my code:

        TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

        Account account = client.getAccount();

        SmsFactory smsFactory = account.getSmsFactory();
        Map<String, String> smsParams = new HashMap<String, String>();
        smsParams.put("To", to);
        smsParams.put("From", PHONE_NUMBER); 
        smsParams.put("Body", text);
        Sms sms = smsFactory.create(smsParams);

Upvotes: 5

Views: 10353

Answers (1)

xmjw
xmjw

Reputation: 3434

SMS doesn't really do this - you can put the URL in the message like so:

http://www.twilio.com

But you cannot do this in HTML style like so:

Twilio

SMS is just raw text, then your device finds the URLs and makes them into links. The Twilio 'Url' parameter is for making calls, rather than for SMS.

Upvotes: 12

Related Questions