fork download
  1. <?php
  2.  
  3. // Initialize cURL session
  4. $curl = curl_init();
  5.  
  6. // Set cURL options
  7. CURLOPT_URL => 'https://o...content-available-to-author-only...s.net/api/cloud/Dialog',
  8. CURLOPT_RETURNTRANSFER => true,
  9. CURLOPT_ENCODING => '',
  10. CURLOPT_MAXREDIRS => 10,
  11. CURLOPT_TIMEOUT => 0,
  12. CURLOPT_FOLLOWLOCATION => true,
  13. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  14. CURLOPT_CUSTOMREQUEST => 'POST',
  15. CURLOPT_POSTFIELDS => json_encode([
  16. "type" => "template",
  17. "messaging_product" => "whatsapp",
  18. "to" => "+919889727669",
  19. "template" => [
  20. "namespace" => "6303a0c8_993c_4804_b4a3_a758cc735d19",
  21. "language" => [
  22. "policy" => "deterministic",
  23. "code" => "en"
  24. ],
  25. "name" => "leave_app",
  26. "components" => [
  27. [
  28. "type" => "body",
  29. "parameters" => [
  30. ["type" => "text", "text" => "v1"],
  31. ["type" => "text", "text" => "v2"],
  32. ["type" => "text", "text" => "v3"],
  33. ["type" => "text", "text" => "v4"],
  34. ["type" => "text", "text" => "v5"],
  35. ["type" => "text", "text" => "v6"],
  36. ["type" => "text", "text" => "v7"],
  37. ["type" => "text", "text" => "v8"],
  38. ["type" => "text", "text" => "v9"],
  39. ]
  40. ]
  41. ]
  42. ]
  43. ]),
  44. CURLOPT_HTTPHEADER => [
  45. 'API-KEY: p8VM0R8NDfXKNXJKiEMLHFy4AK',
  46. 'Content-Type: application/json',
  47. 'Cookie: ARRAffinity=02ae74106f75c18b37c15ed26bb1ae912f8846936589eaf72f28f572df95a2eb; ARRAffinitySameSite=02ae74106f75c18b37c15ed26bb1ae912f8846936589eaf72f28f572df95a2eb'
  48. ],
  49. ]);
  50.  
  51. // Execute the cURL session and fetch the response
  52. $response = curl_exec($curl);
  53.  
  54. // Check for errors
  55. if (curl_errno($curl)) {
  56. echo 'Error:' . curl_error($curl);
  57. } else {
  58. // Print the response if no errors occurred
  59. echo $response;
  60. }
  61.  
  62. // Close the cURL session
  63. curl_close($curl);
  64.  
Success #stdin #stdout 0.04s 25992KB
stdin
Standard input is empty
stdout
Error:Could not resolve host: orailap.azurewebsites.net