我正在尝试使用Twilio PHP启动发送我的第一条消息,但它返回以下错误:“将请求发送到服务器时出错”
有人知道这意味着什么吗?
我把测试凭据和我刚刚在Twilio上设置的电话号码。并升级了我的帐户,因此我不知道问题可能来自哪里......
答案 0 :(得分:1)
该回购在一年内没有更新。最好尝试从头开始发送消息,并确保使用最新版本的PHP library。
您需要发送消息的代码:
https://www.twilio.com/docs/guides/sms/how-to-send-sms-messages-in-php
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;
// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACfe6807be04581521240f555c6314c8bc";
$token = "your_auth_token";
$client = new Client($sid, $token);
$client->messages->create(
'+15558675309',
array(
'from' => '+15017250604',
'body' => "This is the ship that made the Kessel Run in fourteen parsecs?"
)
);