因此试图将Twilio传真集成到我的Codeigniter应用程序中我一直收到错误:“未知域传真”从Twilio SDK中抛出。下面的例子几乎和他们告诉你在他们自己的例子中做的一样。所以我不确定潜在的问题是什么。更糟糕的是,我找不到任何文件,甚至暗示可能意味着什么。希望这里的某个人能够对这个问题有所了解。Twilio传真API未知域错误
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
// Require the bundled autoload file - the path may need to change
// based on where you downloaded and unzipped the SDK
require __DIR__ . '/twilio-php/Twilio/autoload.php';
// Use the REST API Client to make requests to the Twilio REST API
use Twilio\Rest\Client;
class Twilio {
public function icecream() {
// Your Account Sid and Auth Token from twilio.com/console
$sid = "omitted";
$token = "omitted";
$client = new Client($sid, $token);
$options = array(
"from" => "+15555555555"
);
$fax = $client->fax->v1->faxes->create(
"+15555555555",
"https://www.twilio.com/docs/documents/25/justthefaxmaam.pdf",
$options
);
echo $fax->sid;
}
}
我不认为这是问题,但快速加载PDF网址会返回404页面。 –
奇怪的是,该文件和网址最后工作我检查,但是..鉴于此,我把我的服务器上的PDF,并指出它从脚本现在。尽管如假设一样错误。 – chris