2016-08-16 84 views
0

我想使用nexmo发送广告系列消息。我有nexmo帐户,并使用以下代码发送消息到列表中。但我得到的回应101无效帐户的活动。广告系列Nexmo帐号无效

$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"} 

什么是可能的解决方案?

回答

0

该响应表明正在使用的API密钥未链接到Campaign。

例如,如果Nexmo帐户上有两个API密钥,并且第一个API密钥上的短代码Campaign处于活动状态,并且您使用第二个API密钥发出请求,如果此第二个API密钥没有关联广告系列有了它,你会收到上面提到的101响应。

我建议使用Nexmo支持检查来验证这一点。

[免责声明:我是Nexmo员工]

相关问题