0
我正在研究一個項目,我們需要將轉儲到網頁的傳入文本消息的歷史記錄。我已經開始使用Twilio REST API和php庫來獲取SMS日誌數據。不過,我目前遇到了無法抓取發送日期的問題。據Twilio說,我應該能夠迴應DateSent
屬性。目前只有body
和from
目前正在爲我工作。Twilio API:將SMS日誌數據推送到網頁
我的PHP:
<?php
// this line loads the library
require('xxxx/twilio-php/Services/Twilio.php');
$account_sid = 'xxxxxxxxxxxxxxxxxxxxxxxxxx';
$auth_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxx';
$client = new Services_Twilio($account_sid, $auth_token);
$messages = $client->account->messages->getIterator(0, 50, array(
));
foreach ($messages as $message) {
echo $message->body;
echo $message->DateSent;
echo $message->from;
}
在得到我正在尋找,以顯示信息的任何想法?
使用js將其加載到我的網頁並動態刷新。
謝謝!