我正在尝试使用他们的PHP库从twilio获取最近的调用,但是我收到错误,我找不到任何关于它的信息。
我正在使用的脚本我是从twilio获得的,它看起来像这样:
<?php
require __DIR__ . '/twilio-php-master/Twilio/autoload.php';
// Use the REST API Client to make requests to the Twilio REST API
use Twilio\Rest\Client;
// Step 2: Set our AccountSid and AuthToken from https://twilio.com/console
$AccountSid = "Sid here";
$AuthToken = "Token";
// Step 3: Instantiate a new Twilio Rest Client
$client = new Client($AccountSid, $AuthToken);
try {
// Get Recent Calls
foreach ($client->account->calls->read() as $call) {
$time = $call->startTime->format("Y-m-d H:i:s");
echo "Call from $call->from to $call->to at $time of length $call->duration \n";
}
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}
?>
当我使用浏览器访问此文件时,我得到了
Error: [HTTP 451] Unable to fetch page
有没有人有同样的问题?你是怎么解决的?