fork download
  1.  
  2. <?php
  3.  
  4. // Data untuk dikirim
  5. $data = array(
  6. 'session' => 'rejaaa',
  7. 'to' => '6285891495131', // Nomor telepon penerima dengan kode negara
  8. 'text' => 'Pesan Anda di sini'
  9. );
  10.  
  11. // Menginisialisasi curl
  12. $ch = curl_init('https://w...content-available-to-author-only...a.id/'); // Ganti URL_API_ANDA dengan URL API Anda
  13.  
  14. // Mengatur opsi curl
  15. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  16. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  17. curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
  18.  
  19. // Eksekusi curl
  20. $response = curl_exec($ch);
  21.  
  22. // Mendapatkan kode respons
  23. $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  24.  
  25. // Menutup curl
  26.  
  27. // Menampilkan respons
  28. echo "Kode Status: " . $status_code . "\n";
  29. echo "Respon: " . $response . "\n";
  30.  
  31. ?>
  32.  
Success #stdin #stdout 0.03s 26300KB
stdin
Standard input is empty
stdout
Kode Status: 0
Respon: