From CDYNE Wiki
Revision as of 15:12, 13 October 2010 by imported>Wcchenoweth
Jump to navigation Jump to search

The following example was built using PHP 5.3.2. Your setup may differ, so please assure that your PHP 5.x version supports the SOAPClient class.


  • Send a single message to a single number.


// Create a new soap client based on the SMS Notify! WCF service $client = new SoapClient('');

// Specify required info to send a text message $param = array( 'PhoneNumber' => '7891234567', 'LicenseKey' => '(your license key here)', 'Message' => 'test' );

// Send the text message $result = $client->SimpleSMSsend($param);

// View the response from CDYNE print_r($result);



  • Send different messages to different numbers with one method.


$client = new SoapClient('');

$lk = '(your license key here)';

$PhoneNumbersArray1 = array('0123456789', '4567891230'); $PhoneNumbersArray2 = array('1234567890', '7652212120');

$Message1 = 'Hello World'; $Message2 = 'Goodbye World';

$RequestArray = array( array( 'AssignedDID'=>,

                                     //If you have a Dedicated Line, you would assign it here.

'Message'=>$Message1, 'PhoneNumbers'=>$PhoneNumbersArray1, 'ReferenceID'=>,

                                     //User defined reference, set a reference and use it with other SMS functions.


                                     //This must be a UTC time.  Only Necessary if you want the message to send at a later time.


                                     //Your Post Back URL for responses.

) ,array( 'AssignedDID'=>, 'Message'=>$Message2, 'PhoneNumbers'=>$PhoneNumbersArray2, 'ReferenceID'=>, 'ScheduledDateTime'=>'2010-05-06T16:06:00Z', 'StatusPostBackURL'=> ) );

$request = new AdvancedCallRequestData($lk,$RequestArray); //print_r($request);

$result = $client->AdvancedSMSsend($request); print_r($result);

class AdvancedCallRequestData {

 public $AdvancedRequest;
 function AdvancedCallRequestData($licensekey,$requests) { 
           $this->AdvancedRequest = array();
           $this->AdvancedRequest['LicenseKey'] = $licensekey;
           $this->AdvancedRequest['SMSRequests'] = $requests;




  • Returns all Messages with a predefined user ReferenceID set in AdvancedSMSSend.


$client = new SoapClient('');

$param = array( 'ReferenceID' => '(your reference ID, set in AdvancedSMSSend)' ,'LicenseKey' => '(your license key)' );

$result = $client->GetMessageStatusByReferenceID($param);




  • Returns all unread SMSResponses attached to a single License Key and marks them as read.


$client = new SoapClient('');

$param = array( 'LicenseKey' => '(your license key)' );

$result = $client->GetUnreadIncomingMessages($param);




  • Returns the status of a single SMS message using the Message ID from the SMSResponse object.


$client = new SoapClient('');

$param = array( 'MessageID' => '(your message ID here)'//MessageID from SMSResponse Object );

$result = $client->GetMessageStatus($param);