SMSv2 php


 * Add a service reference to http://sms2.cdyne.com/sms.svc?wsdl

SimpleSMSSend

 * Send a single message to a single number.

$client = new SoapClient('http://sms2.cdyne.com/sms.svc?wsdl');

$param = array(	'PhoneNumber' => '7891234567',	'LicenseKey' => '(your license key here)',	'Message' => 'test' );

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

print_r($result);

AdvancedSMSSend

 * Send different messages to different numbers with one method.

$client = new SoapClient('http://sms2.cdyne.com/sms.svc?wsdl');

$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. //'ScheduledDateTime'=>'2010-05-06T16:06:00Z', //This must be a UTC time. Only Necessary if you want the message to send at a later time. 'StatusPostBackURL'=>'' //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; } }

GetMessageStatusByReferenceID

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

$client = new SoapClient('http://sms2.cdyne.com/sms.svc?wsdl');

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

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

print_r($result);

GetUnreadIncomingMessages

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

$client = new SoapClient('http://sms2.cdyne.com/sms.svc?wsdl');

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

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

print_r($result);

GetMessageStatus

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

$client = new SoapClient('http://sms2.cdyne.com/sms.svc?wsdl');

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

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

print_r($result);