<?php // Using cURL POST $key="YOUR-ACCOUNT-KEY"; $bypasscode="BYPASS CODE SERVER KEY"; $shortcode="SHORT CODE"; $message="MESSAGE TO BE SENT"; $amount="AMOUNT"; $push_pin="PIN"; $response = httpPost("https://api.textng.xyz/carrier_shortcode/" ,array("key"=>"$key","bypasscode"=>"$bypasscode","shortcode"=>"$shortcode","message"=>"$message","amt"=>"$amount","pin"=>"$push_pin")); // 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; } ?>
Parameters | Example | Description |
---|---|---|
Key |
XXXXX-XXXX-XXXXX | This can be found in the Developers page of your dashboard. The key authorizes the transaction. |
Bypasscodes |
XXXXXXXXXX | This is to specify our carrier billing engine to use your unique bypass code. The code can be found at Carrier Billing Home under API code |
Shortcode |
131 | This is the destination shortcode you want to send a message to on the specified bypass code for the carrier billing service. |
message |
2 | This is the message you want to send to the shortcode on the specified bypass code for the carrier billing service. |
Amount |
0 | This is the amount of money received if you charged for the service. This is just to help you keep track of cash received if your vending on our service. Leave the value at "0" if you wish to ignore. |
pin |
XXXXX | This is the push pin used to authorize the query to run on the carrier billing service |
{
"D":{
"details":[
{
"status":"successful ",
"ref_id":"REFERENCE_ID",
"query":"SHORTCODE_QUERY_PUSHED",
"type":"SHORTCODE"
}
]
}
}
{
"D":{
"details":[
{
"status":"error -bypasscode-expired-or-not-exist"
}]
}
}
{
"D":{
"details":[
{
"status":"incorrect-push-pin"
}]
}
}
{
"D":{
"details":[
{
"status":"error -key-invalid"
}
]
}
}