SMS campaign list is returned by request. When sending a request, it is possible to perform data selection due to which SMS campaigns will be returned from the database. Selection parameters are transferred, while SMS campaign list (array) is returned. If selection parameters are not transferred, information about all SMS campaigns is returned.
smsCampaigns(array $filters, integer $start, integer $limit) : array
Array of SMS campaigns. Each SMS campaign is represented as an array that includes:
smsCampaigns(); header("Content-Type: text/plain"); if ($api->errorCode){ echo "Unable to load smsCampaigns()!"; echo "\tCode=".$api->errorCode."\n"; echo "\tMsg=".$api->errorMessage."\n"; } else { echo sizeof($retval)." SMS Campaigns Returned:\n"; foreach($retval as $c){ echo "Campaign Id: ".$c['id']." - ".$c['title']."\n"; echo "\tStatus: ".$c['status']."\n"; echo "\tsent: ".$c['send_time']." to ".$c['sms_sent']." members\n"; } }
New SMS campaign is created and array of parameters is passed including information about SMS campaign settings and SMS message content.
smsCampaignCreate(array $options, array $content) : string
$smsSenderID, 'recipients' => array( 'list_id' => $listId, //'segment_id' => $segmentId, 'merge' => $smsMergeField, ), 'tracking' => array( 'clicks' => true ), 'analytics' => array( 'google' => 'my_google_analytics_key' ), 'title' => 'Test SMS Title', 'unicode' => true, 'concatenate' => true ); /* $content = array( 'template_id' => 'template_id', ); */ $content = array( 'text' => 'some pretty content message', ); $retval = $api->smsCampaignCreate($options, $content); header("Content-Type: text/plain"); if ($api->errorCode){ echo "Unable to load smsCampaignCreate()!\n"; echo "\tCode=".$api->errorCode."\n"; echo "\tMsg=".$api->errorMessage."\n"; } else { echo "New SMS Campaign ID:".$retval."\n"; }
Submit request of delivering SMS campaign that previously was saved as a draft. SMS campaign is sent immediately. SMS campaign ID number is passed as a parameter.
smsCampaignSendNow(string $cid) : boolean
smsCampaignSendNow($cid); header("Content-Type: text/plain"); if ($api->errorCode) { echo "Unable to load smsCampaignSendNow()!\n"; echo "\tCode=" . $api->errorCode . "\n"; echo "\tMsg=" . $api->errorMessage . "\n"; } else { echo "SMS Campaign Sent!\n"; }
Update of one of the previously created values of SMS campaign parameters.
smsCampaignUpdate(string $cid, string $name, mixed $value) : boolean
smsCampaignUpdate($cid, $name, $value); header("Content-Type: text/plain"); if ($api->errorCode){ echo "Unable to load smsCampaignUpdate()!\n"; echo "\tCode=".$api->errorCode."\n"; echo "\tMsg=".$api->errorMessage."\n"; } else { echo "SUCCESS! \n"; }
SMS campaign delivery is scheduled. Time is set according GMT, but if a specific time zone needs to be set up, required number of hours have to be added or subtracted. Time is written in YYYY-MM-DD HH:II:SS +GMT format. Example of time format: ‘2020-05-18 11:59:21 +0100’, where ‘+0100’ is an added hour to the standard time.
smsCampaignSchedule(string $cid, string $schedule_time) : boolean
smsCampaignSchedule($cid, $schedule_time); header("Content-Type: text/plain"); if ($api->errorCode) { echo "Unable to load smsCampaignSchedule()!\n"; echo "\tCode=" . $api->errorCode . "\n"; echo "\tMsg=" . $api->errorMessage . "\n"; } else { echo "SMS Campaign Scheduled to be delivered $schedule_time!\n"; }
SMS campaign delivery time is unscheduled. SMS campaign is saved as a draft and is not delivered.
smsCampaignUnschedule(string $cid) : boolean
smsCampaignUnschedule($cid); header("Content-Type: text/plain"); if ($api->errorCode) { echo "Unable to load smsCampaignUnschedule()!\n"; echo "\tCode=" . $api->errorCode . "\n"; echo "\tMsg=" . $api->errorMessage . "\n"; } else { echo "SMS Campaign Unscheduled!\n"; }
Existing SMS campaign is replicated and the ID of the new SMS campaign is returned.
smsCampaignReplicate(string $cid) : string
smsCampaignReplicate($cid); header("Content-Type: text/plain"); if ($api->errorCode){ echo "Unable to load smsCampaignReplicate()!\n"; echo "\tCode=".$api->errorCode."\n"; echo "\tMsg=".$api->errorMessage."\n"; } else { echo "New SMS Campaign Id = ".$retval."\n"; }
Submit request and as a result obtain a list (array) with saved SMS templates in user’s account.
smsCampaignTemplates() : string
Array of SMS templates. Each SMS template is represented as an array that includes:
smsCampaignTemplates(); header("Content-Type: text/plain"); if ($api->errorCode) { echo "Unable to load smsCampaignTemplates()!"; echo "\tCode=" . $api->errorCode . "\n"; echo "\tMsg=" . $api->errorMessage . "\n"; } else { echo "Your templates:\n"; foreach ($retval as $tmpl) { echo "\t" . $tmpl['id'] . " - " . $tmpl['name'] . " - " . $tmpl['layout'] . "\n"; } }
Delete SMS campaign from the account of a specific user.
smsCampaignDelete(string $cid) : boolean
smsCampaignDelete($cid); header("Content-Type: text/plain"); if ($api->errorCode){ echo "Unable to load smsCampaignDelete()!\n"; echo "\tCode=".$api->errorCode."\n"; echo "\tMsg=".$api->errorMessage."\n"; } else { echo "SMS Campaign Deleted!\n"; }
Send request for registering SMS sender information. Upon receipt of an SMS, customers will see the sender's name. New Sender ID is registered within 1 business day.
smsSenderIdRegister(string $sender, string $phone, string $company, string $fullname, string $companyposition, string $comments) : boolean
smsSenderIdRegister($sender, $phone, $company, $fullname, $companyposition, $comments); header("Content-Type: text/plain"); if ($api->errorCode){ echo "Unable to load smsSenderIdRegister()!\n"; echo "\tCode=".$api->errorCode."\n"; echo "\tMsg=".$api->errorMessage."\n"; } else { echo "The request has been received!\n"; }