我想使用 nexmo 发送活动消息。我有nexmo 帐户并使用以下代码将消息发送到列表中。但我收到响应 101 Invalid Account for Campaign。
$nx_mkt_uri = "https://rest.nexmo.com/sc/us/alert/json";
$data = array('to' => $to, 'time' => $message,);
$data = array_merge($data, array('api_key' => 'xxxxxxxx', 'api_secret' => "xxxxxxxx"));
$post = '';
foreach ($data as $k => $v) {
$post .= "&$k=$v";
}
// If available, use CURL
if (function_exists('curl_version')) {
$to_nexmo = curl_init($this->nx_mkt_uri);
curl_setopt($to_nexmo, CURLOPT_POST, true);
curl_setopt($to_nexmo, CURLOPT_RETURNTRANSFER, true);
curl_setopt($to_nexmo, CURLOPT_POSTFIELDS, $post);
if (!$this->ssl_verify) {
curl_setopt($to_nexmo, CURLOPT_SSL_VERIFYPEER, false);
}
$from_nexmo = curl_exec($to_nexmo);
curl_close($to_nexmo);
}
回复:
{message-count: "1", messages: [{status: "101", error-text: "Invalid Account for Campaign"}]}
message-count
:
"1"
messages
:
[{status: "101", error-text: "Invalid Account for Campaign"}]
0
:
{status: "101", error-text: "Invalid Account for Campaign"}
什么是可能的解决方案?