SMS 不会使用 Plivo
SMS is not going using Plivo
我正在尝试使用 PHP 中的 Plivo API 向号码发送消息。起初我给了两个美国号码作为来源和目的地。它没有用,所以我在那之后给了印度非 DND 号码。代码仍然无法正常工作。因为我是第一次尝试这个,所以任何人都可以帮助我,这是什么错误。
(注:我使用的是 Code-igniter 框架)
public function sendsms()
{
$this->load->helper('url');
require_once APPPATH.'libraries/plivo_php/plivo.php';
$auth_id = "MAYZU4MDGXXXXXXXXXXX";
$auth_token = "M2JmYTQwMDY1MTXXXXXXXXXXXXXXXXXXXXXXXXXX";
$p = new RestAPI($auth_id, $auth_token);
// Send a message
$params = array(
'src' => '917XXXXXXXXX',
'dst' => '919XXXXXXXXX',
'text' => 'Hi, Message from Srusti',
'type' => 'sms'
);
$response = $p -> send_message($params);
// Print the response
echo "Response : ";
print_r ($response['response']);
$this->load->view('sendsms');//Here sendsms is the view name..
}
亲,可能有以下可能发生。
- 检查您的授权令牌和授权 ID。
- 登录到您的 Plivo 帐户并检查是否可以使用此授权令牌和授权 ID 向国际号码发送短信。
- 检查您用于 class Plivo(plivo.php) 的路径。
这些是可能导致错误的问题。
我正在尝试使用 PHP 中的 Plivo API 向号码发送消息。起初我给了两个美国号码作为来源和目的地。它没有用,所以我在那之后给了印度非 DND 号码。代码仍然无法正常工作。因为我是第一次尝试这个,所以任何人都可以帮助我,这是什么错误。 (注:我使用的是 Code-igniter 框架)
public function sendsms()
{
$this->load->helper('url');
require_once APPPATH.'libraries/plivo_php/plivo.php';
$auth_id = "MAYZU4MDGXXXXXXXXXXX";
$auth_token = "M2JmYTQwMDY1MTXXXXXXXXXXXXXXXXXXXXXXXXXX";
$p = new RestAPI($auth_id, $auth_token);
// Send a message
$params = array(
'src' => '917XXXXXXXXX',
'dst' => '919XXXXXXXXX',
'text' => 'Hi, Message from Srusti',
'type' => 'sms'
);
$response = $p -> send_message($params);
// Print the response
echo "Response : ";
print_r ($response['response']);
$this->load->view('sendsms');//Here sendsms is the view name..
}
亲,可能有以下可能发生。
- 检查您的授权令牌和授权 ID。
- 登录到您的 Plivo 帐户并检查是否可以使用此授权令牌和授权 ID 向国际号码发送短信。
- 检查您用于 class Plivo(plivo.php) 的路径。
这些是可能导致错误的问题。