$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://web.it-decision.com/v1/api/send-sms', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode(array( "phone" => "380632132121", "sender" => "InfoItd", "text" => "This is messages DecisionTelecom", "validity_period" => 300 )), CURLOPT_HTTPHEADER => array( 'Authorization: Basic ', 'Content-Type: application/json', ), )); $response = curl_exec($curl); if (curl_errno($curl)) { echo 'Error:' . curl_error($curl); } curl_close($curl); echo $response;