<?php // using cURL POST $key="YOUR-ACCOUNT-KEY"; $phone="080XXXXXXXX,080XXXXXXXXX,090XXXXXXXXXX"; $message="My Voice Message"; $custom_ref="REFERENCE-ID"; $response = httpPost("https://api.textng.xyz/voice/" ,array("key"=>"$key","phone"=>"$phone","message"=>"$message","custom_ref"=>"$custom_ref")); // using php curlfunction httpPost($url, $data) { $curl =curl_init ($url);curl_setopt ($curl, CURLOPT_POST, true);curl_setopt ($curl, CURLOPT_POSTFIELDS, http_build_query($data));curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); curl_close($curl);echo $response; } ?>
Parameter | Example | Description |
---|---|---|
Key |
XXXXX-XXXX-XXXXX | This can be found in the Developers page of your dashboard. The key authorizes the transaction. |
phone |
070001000, 0919494495 | The recipients' phone numbers. Separate each number with commas ',' |
message |
Hello, how are you | This is the voice message to be played to the customer when the call is answered. |
custom_ref | YOUR TRACE ID | This is the reference code or ID set from your server side/application side to trace/track the message transaction pushed to us. |
{
"status":"Successful ",
"units_used":"4",
"type":"single number",
"reference":"XXXXXXXXXXXXXXXXXX",
"custom_ref":"XXXXXXXXXXXXXXXXXXXXXXXXX",
"route":"VOICE-BROADCAST"
}
{
"status":"ERROR ",
"comment":"ERROR WILL BE DISPLAYED HERE"
}