Discussions

Ask a Question
Back to All

Send to an Individual Subscriber

I don´t know whats is wrong. Im trying to senda test to a subscribed user using php. could you help me

$title, 'message' => $message, 'url' => $url, 'subscriber_id' => $subscriberId ); $httpHeadersArray = Array(); $httpHeadersArray[] = 'Authorization: key='.$apiToken; //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $curlUrl); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields)); curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeadersArray); //execute post $result = curl_exec($ch); $resultArray = json_decode($result, true); if($resultArray['status'] == 'success') { //success //echo $resultArray['request_id']; //ID of Notification Request echo("sucess"); } else if($resultArray['status'] == 'failure') { //failure echo("erro1"); } else { //failure echo("erro2 " . $result); } //echo($subscriberId); ?>