Menu
Introduction Getting started SMS Promotional - Large campaigns Transactional - Basic Transactional (Alerts) - Virtual Number Route Transactional (Alerts) - Priority Routing Transactional (OTPs & Alerts) - Special route International route to Nigeria International route to Other Countries SMS DLR SMS DLR Webhooks Voice Voice OTP Voice Broadcasts Voice DLR Campaigns SMS - Get Groups SMS Initiate Units Transfer Units to Sub-Account Transfer Units to Other Account Check Units Balance Sender IDs Register Sender IDs Check Sender ID status Categories Add Customer Remove Customer Virtual Number Inbox webhook Carrier Billing Run USSD Query Run Shortcode Query Query Status Carrier Callback Tools Create Sub-Account Check DND Status Check Service Status 3rd-party integrations ZOHO
Initiate Campaigns - SMS The API is used when you want to initiate SMS campaigns over API.
POST
https://api.textng.xyz/campaigns-initiate/
PHP code
<?php
 // Using cURL POST
  $key="YOUR-ACCOUNT-KEY";
  $sender="MyBrand";
  $title="My first campaign";
  $message="This is an advert message";
  $start_date="2024-10-18";
  $end_date="2024-10-19";
  $group_id="152,602";
  $msg_count="10000,5000";
  $response = httpPost("https://api.textng.xyz/campaigns-initiate/",array("key"=>"$key", "sender"=>$sender, "title"=>$title, "message"=>$message, "start_date"=>$start_date, "end_date"=>$end_date, "msg_count"=>$msg_count, "group_id"=>$group_id));
  // using php curl
  function 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
Parameters Example Description
Key xxxxxx-xxxxx-xxxxx This can be found in the Developers page of your dashboard. The key authorizes the transaction.
Sender xxxxxx-xxxxx-xxxxx Your preferred Sender Name
Title xxxxxx-xxxxx-xxxxx Your preferred Campaign Title
Message xxxxxx-xxxxx-xxxxx Message to send out
Start Date xxxxxx-xxxxx-xxxxx Campaign start date
End Date xxxxxx-xxxxx-xxxxx Campaign end date
Group IDs 152,603 Comma separated values of group IDs gotten from get-groups API
Msg Count 10000,25000 Comma separated values of message count for each group ID selected above
Responses
Your transaction response will appear in TEXT format as shown below.
Successful (TEXT)
4 units used|| Status:Successful|| Msg: Campaign queued for processing|| Type:|| Reference:1762004689|| CustomRef:
Error - Invalid key (JSON)
{
    "D":{
        "details":[
            {
            "status":"key-invalid"
            }
        ]
    }
}