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

Commit

Permalink
modified package.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
raghusagar committed Oct 27, 2013
1 parent cb60601 commit 20bceb4
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 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
23 changes: 23 additions & 0 deletions src/classes/TwilioNameValuePair.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* This class is used to hold a key/value POST param.
*/
global class TwilioNameValuePair {

private String name;

private String value;

public TwilioNameValuePair(String name, String value) {
this.name = name;
this.value = value;
}

public String getName() {
return this.name;
}

public String getValue() {
return this.value;
}

}
5 changes: 5 additions & 0 deletions src/classes/TwilioNameValuePair.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>29.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion src/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<members>TwilioMemberList</members>
<members>TwilioMessage</members>
<members>TwilioMessageList</members>
<members>TwilioNameValuePair</members>
<members>TwilioNotification</members>
<members>TwilioNotificationList</members>
<members>TwilioOutgoingCallerId</members>
Expand All @@ -50,7 +51,6 @@
<members>TwilioTranscription</members>
<members>TwilioTranscriptionList</members>
<members>TwilioTwiML</members>
<members>TwilioNameValuePair</members>
<members>Twilio_TestAccounts</members>
<members>Twilio_TestApplication</members>
<members>Twilio_TestCalls</members>
Expand Down

0 comments on commit 20bceb4

Please sign in to comment.