2016-08-16 38 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員工]

相關問題