Samples
Sample - PHP

Web Service

Connecting to the TextAnywhere Web Service from PHP can be accomplished using an older version of NUSOAP. This version will work, using the latest version of NUSOAP may not.

Just extract the PHP_NUSOAP.zip into your project folder. You can then access the Web Service and send messages using NUSOAP:

require_once('nusoap.php'); $parameters = array( 'Client_ID' => 'my_id', 'Client_Pass' => 'my_pass', 'Client_Ref' => 'my_ref', 'Billing_Ref' => 'billing_ref', 'Connection' => '2', 'Originator' => '+447912345678', 'OType' => '0', 'DestinationEx' => '+447923456789', 'Body' => 'hello world', 'SMS_Type' => '0', 'Reply_Type' => '0', 'Reply_Data' => '' ); $nusoapclient = new nusoapclient('http://ws.textanywhere.net/ta_SMS.asmx?wsdl'); $result = $nusoapclient->call('SendSMSEx',$parameters,'http://ws.textanywhere.net/TA_WS','http://ws.textanywhere.net/TA_WS/SendSMSEx');

You can call any of the Web Service methods in a similar manner. When using different methods be sure to change the highlighted text to match the name of the method you are calling. You can specify a proxy server if required:

$nusoapclient->setHTTPProxy('server', 'port', 'username', 'password');

TextPremium Web Service

The TextAnywhere TextPremium Web Service can be accessed using an older version of NUSOAP. This version will work, using the latest version of NUSOAP may not.

Just extract the PHP_NUSOAP.zip into your project folder. You can then access the Web Service and retrieve incoming messages using the ReadTextMT method:

require_once('nusoap.php'); $parameters = array( 'Client_ID' => 'my_id', 'Client_Pass' => 'my_pass', 'Inbound_Number' => '80000_keyword' ); $nusoapclient = new nusoapclient('http://ws.textanywhere.net/ws_textpremium/TA_WS_RB.asmx?wsdl'); $result = $nusoapclient->call('ReadTextMT',$parameters,'http://ws.textanywhere.net/','http://ws.textanywhere.net/ReadTextMT');

To send responses to incoming messages you will use the SendMTResponse method:

require_once('nusoap.php'); $parameters = array( 'Client_ID' => 'my_id', 'Client_Pass' => 'my_pass', 'Client_Ref' => 'my_ref' 'RBID' => 'RBID' 'Body' => 'hello world' ); $nusoapclient = new nusoapclient('http://ws.textanywhere.net/ws_textpremium/TA_WS_RB.asmx?wsdl'); $result = $nusoapclient->call('SendMTResponse',$parameters,'http://ws.textanywhere.net/','http://ws.textanywhere.net/SendMTResponse');

Footer