Get a Free WhatsApp Business Account – Includes Onboarding, API Access & Sandbox. Apply Now!


Sample Code For Sending Voice in Php

Sending SMS using Authkey APIs is a breeze and lightning fast. You can simply pass the message body, message sender, mobile number & authkey in the API request to send sms instantly.

Php Sample Code For Send SMS



<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.authkey.io/request?authkey=AUTHKEY&mobile=RecepientMobile&
  country_code=CountryCode&voice=Hello%2C%20your%20OTP%20is%201234",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET"
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Sending SMS using Authkey APIs is a breeze and lightning fast. You can simply pass the message body, message sender, mobile number & authkey in the API request to send sms instantly.