Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #27 from brettgerry/messages-support
Browse files Browse the repository at this point in the history
Support for new Messages resource (MMS and Media)
  • Loading branch information
brettgerry committed Oct 29, 2013
2 parents 81bdcff + 20bceb4 commit c4d3aea
Show file tree
Hide file tree
Showing 29 changed files with 2,602 additions and 1,580 deletions.
26 changes: 24 additions & 2 deletions docs/usage/messages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SMS Messages
============

For more information, see the `SMS Message REST Resource <http://www.twilio.com/docs/api/rest/sms>`_ documentation.
For more information, see the `SMS Message REST Resource <http://www.twilio.com/docs/api/rest/message>`_ documentation.

Sending a Text Message
----------------------
Expand All @@ -20,11 +20,33 @@ Send a text message in only a few lines of code.
'From' => '+15555555555',
'Body' => 'Hello!'
};
TwilioSMS message = client.getAccount().getSmsMessages().create(properties);
TwilioMessage message = client.getAccount().getMessages().create(properties);
.. note:: The message body must be less than 160 characters in length

Sending a MMS
----------------------

Send a MMS in only a few lines of code.

.. code-block:: javascript
String ACCOUNT_SID = 'AXXXXXXXXXXXXXXXXX';
String AUTH_TOKEN = 'YYYYYYYYYYYYYYYYYY';
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
List<TwilioNameValuePair> properties = new List<TwilioNameValuePair>();
properties.add(new TwilioNameValuePair('To','+13216851234'));
properties.add(new TwilioNameValuePair('From','+15555555555'));
properties.add(new TwilioNameValuePair('MediaUrl','https://www.twilio.com/packages/company/img/logos_downloadable_round.png'));
TwilioMessage message = client.getAccount().getMessages().create(properties);
.. note:: The message body must be less than 160 characters in length


If you want to send a message from a `short code
<http://www.twilio.com/api/sms/short-codes>`_ on Twilio, just set :attr:`From`
to your short code's number.
Expand Down
Loading

0 comments on commit c4d3aea

Please sign in to comment.