[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/twilio-php/Services/Twilio/Rest/ -> Messages.php (summary)

(no description)

File Size: 73 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Services_Twilio_Rest_Messages:: (2 methods):
  create()
  sendMessage()


Class: Services_Twilio_Rest_Messages  - X-Ref

create($params = array()   X-Ref
Create a new Message instance

Example usage:

.. code-block:: php

$client->account->messages->create(array(
"Body" => "foo",
"From" => "+14105551234",
"To" => "+14105556789",
));

:param array $params: a single array of parameters which is serialized and
sent directly to the Twilio API. You may find it easier to use the
sendMessage helper instead of this function.


sendMessage($from, $to, $body = null, $mediaUrls = null,$params = array()   X-Ref
Send a message

.. code-block:: php

$client = new Services_Twilio('AC123', '123');
$message = $client->account->messages->sendMessage(
'+14105551234', // From a Twilio number in your account
'+14105556789', // Text any number
'Come at the king, you best not miss.'   // Message body (if any)
array('https://demo.twilio.com/owl.png'),   // An array of MediaUrls
);

:param string $from: the from number for the message, this must be a
number you purchased from Twilio
:param string $to: the message recipient's phone number
:param $mediaUrls: the URLs of images to send in this MMS
:type $mediaUrls: null (don't include media), a single URL, or an array
of URLs to send as media with this message
:param string $body: the text to include along with this MMS
:param array $params: Any additional params (callback, etc) you'd like to
send with this request, these are serialized and sent as POST
parameters

:return: The created :class:`Services_Twilio_Rest_Message`
:raises: :class:`Services_Twilio_RestException`
An exception if the parameters are invalid (for example, the from
number is not a Twilio number registered to your account, or is
unable to send MMS)



Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1