2-Way SMS Gateway API (Webservices)

Web Services enables rapid integration using standard HTTP and SOAP protocols. It provides a secure and technology-independent way of communicating with the CellTrust Multimodal Gateway. Using XML stream and encrypted data, Web Services provides a very reliable, high performance solution. Web Services and XML protocol creates an independent format for data exchange on any type of operating system.

Download .Net Sample Project: PM Console.zip

PHP Web Services Example

This is an example of using CellTrust Web Services API with PHP. The HTTP API can also be used in conjunction with PHP

Using “sendSMS” Web Service Method With PHP

$URN = "urn:notify.soap.primemessage.com"; 
$WSDL="http://pmgateway.net/pmws/services/TxTMessageService?wsdl";

//SOAP elements (dont edit, and case sensitive!)
$SOAP_ACTION = "sendSMS";
$CTUSERNAME = "Username";
$CTPASSWORD = "Password";
$CTNICKNAME = "nickname";
$DESTINATION = "destination";
$MESSAGE = "message";

$USER_ID = "YourUserID"; //your username at CellTrust
$NICKNAME = "YourNickName"; //your nickname at Celltrust
$PASSWORD = "YourPassword"; //your password at Celltrust

//create user and password SOAP header elements
$UserHdr = new SoapHeader( $URN, $CTUSERNAME, $USER_ID, false);
$PassHdr = new SoapHeader( $URN, $CTPASSWORD, $PASSWORD, false);

//create SOAP body elements, add your destination phone number, and message here
$body = array($CTNICKNAME => $NICKNAME, $DESTINATION=> "18015204567",
$MESSAGE => "Test Message");

//create SOAP client
$client = new SoapClient($WSDL, array('trace' => 1, 'exceptions' =>0));

//set SOAP headers
$client->__setSoapHeaders(array($UserHdr, $PassHdr));

//call web service
$result = $client->__call($SOAP_ACTION, $body, NULL);

//check for SOAP error
if (is_soap_fault($result))
{
trigger_error("SOAP Fault: (faultcode: {$result->faultcode},
faultstring: {$result->faultstring})", E_ERROR);
echo "ERROR\n";
echo $result->faultstring."\n";
}

//very usefull for debug purposes
//show what was requested
var_dump($client->__getLastRequest());
//show gateways response
var_dump($client->__getLastResponse());
?>

Using Send Message Web Service Method With PHP

$URN = "urn:notify.soap.primemessage.com"; 
$WSDL="http://pmgateway.net/pmws/services/TxTMessageService?wsdl";
$encoding = SOAP_DEFAULT_ENCODING;

//SOAP elements (dont edit, and case sensitive!)
$SOAP_ACTION = "sendMessage";
$CTUSERNAME = "Username";
$CTPASSWORD = "Password";
$CTNICKNAME = "nickname";
$DESTINATION = "destination";
$MESSAGE = "message";
$RECIPIENT = "recipients";
$ADMINEMAIL = "adminEmail";
$SUBJECT = "subject";

$USER_ID = "YourUserID"; //your username at CellTrust
$NICKNAME = "YourNickName"; //your nickname at Celltrust
$PASSWORD = "YourPassword"; //your password at Celltrust
$EMAILADDRESS = "You@YourDomain.Com"; //email address where you would
like a summary sent

//create user and password SOAP header elements
$UserHdr = new SoapHeader( $URN, $CTUSERNAME, $USER_ID, false);
$PassHdr = new SoapHeader( $URN, $CTPASSWORD, $PASSWORD, false);

//create SOAP body elements, add your destination phone number, and message here
$dialstring = array(array("deliveryType" => 0, "destination" => "14806490123",
"firstName" => "John", "lastName" => "Doe"));

$bodymulti = array($CTNICKNAME => $NICKNAME, $MESSAGE => "Test SMS Message",
$SUBJECT => "Test SMS Message Sent ", $RECIPIENT => $dialstring,
$ADMINEMAIL = $EMAILADDRESS);

//create SOAP client
$client = new SoapClient($WSDL, array('trace' => 1, 'exceptions' =>0));

//set SOAP headers
$client->__setSoapHeaders(array($UserHdr, $PassHdr));

//call web service single sms
$result = $client->__call($SOAP_ACTION, $bodymulti, NULL);

//very usefull for debug purposes
//show what was requested
var_dump($client->__getLastRequest());
//show gateways response
var_dump($client->__getLastResponse());
?>
CellTrust 2-Way SMS Gateway

Development Kit

Buy Now

View Demos

Contact Us
CellTrust™ Australia & New Zealand
35 Amax Avenue
Girraween NSW Australia

Tel: +61 2 9769 0555
Fax: +61 2 9769 0545

info@celltrust.com.au
© Copyright CellTrust™ 2010
Privacy Policy - Terms of Use - Anti-Spam Policy
Standards Matter To Us
Valid: XHTML | CSS | Accessibility | Sitemap
Home - Products - Solutions - Developers - Partners - Services - Media - About Us - Support - Contact Us - Free Trial - Buy Now - Log In - Blog