1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00
phorge-phorge/externals/twilio-php/docs/usage/rest/members.rst
Bob Trahan e96c363eef Add SMS support
Summary:
Provides a working SMS implementation with support for Twilio.

This version doesn't really retry if we get any gruff at all. Future versions should retry.

Test Plan: used bin/sms to send messages and look at them.

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: aurelijus, epriestley, Korvin

Maniphest Tasks: T920

Differential Revision: https://secure.phabricator.com/D8930
2014-05-09 12:47:21 -07:00

46 lines
1.2 KiB
ReStructuredText
Executable file

=============
Members
=============
List All Members in a Queue
============================
Each queue instance resource has a list of members.
.. code-block:: php
$client = new Services_Twilio('AC123', '123');
$queue_sid = 'QQ123';
$queue = $client->account->queues->get('QQ123');
foreach ($queue->members as $member) {
echo "Call Sid: {$member->call_sid}\nWait Time: {$member->wait_time}\n";
}
Dequeue a Member
=================
.. code-block:: php
$client = new Services_Twilio('AC123', '123');
$queue = $client->account->queues->get('QQ123');
foreach ($queue->members as $member) {
// Dequeue the first member and fetch the Forward twimlet for that
// member.
$member->dequeue('http://twimlets.com/forward', 'GET');
break;
}
Retrieve the Member at the Front of a Queue
===========================================
The Members class has a method called ``front`` which can be used to retrieve
the member at the front of the queue.
.. code-block:: php
$client = new Services_Twilio('AC123', '123');
$queue = $client->account->queues->get('QQ123');
$firstMember = $queue->members->front();
echo $firstMember->position;
echo $firstMember->call_sid;