infoBip ゲートウェイ システムを介して SMS を送信するこの CakePHP 関数を作成しましたが、エラー コードが空の宛先を与え続けるため、機能していないようです。to=>nullこれはドキュメントのリンクです
public function sendSMS($recipient, $sender, $message) {
$url = 'https://api.infobip.com/sms/1/text/single';
$to = explode(',', $recipient);
$data = ["to" => $to, "from" => $sender, "text" => $message];
$postData = array("messages" => array($data)); //message to send to gateway
// encoding object
$postDataJson = json_encode($postData);
$request = array('header' => array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'Basic #################'
));
$response = $this->cakeSocket($url, $postDataJson, $request);
pr($postDataJson);
($response->body());
return $response->body();
//$this->redirect(array('action' => 'index'));
}
送信している変数と、ゲートウェイから取得したエラー応答を添付して参照してください
システムが変数を受け取っていないため、私が間違っていることについてアドバイスが必要です。ありがとう。CakePHP の使い方を学んでいます。