<?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 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 | 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 |
4 units used|| Status:Successful|| Msg: Campaign queued for processing|| Type:|| Reference:1762004689|| CustomRef:
{
"D":{
"details":[
{
"status":"key-invalid"
}
]
}
}