[英]How to get all messages of a specific number in Twilio using PHP API
[英]Twilio API: Count messages number has received
在 PHP 中使用 Twilio API 如何計算某個傳入號碼收到的消息數量?
來自 Twilio 的 Ricky。
您可以使用消息列表資源訪問此信息。 這是使用PHP 幫助程序庫的示例:
$sid = "{{ account_sid }}";
$token = "{{ auth_token }}";
$client = new Services_Twilio($sid, $token);
$count = 0;
foreach ($client->account->sms_messages->getIterator(0, 50, array(
'To' => '{{ phone_number }}',
)) as $message) {
$count++;
}
echo "Total Messages: " . $count;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.