| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/usa_sites/usafundingapplications.org/lib/ |
Upload File : |
<?php
function send_text($phone, $message) {
/*
send $message to $phone as a text
returns object:
stdClass Object
(
[custom_ticket] =>
[error_code] => 0
[message] => Message request received.
[result] => 1
[transaction_ticket] => B718D91D-0D2B-2853-573B-B7B37D0846B3-668338
)
result is 1 or 0 if it was successful
transaction_ticket is a unique id to check on the status
*/
$wsdl = 'https://api.txtwire.com/webservices/?version=2.0.0&wsdl';
$soap = new SoapClient($wsdl);
//create an authentication object
$auth = array();
$auth['username'] = 'synergy';
$auth['password'] = 'password123!';
$auth['api_key'] = 'eea2ebc6bdc5fb5535c9ac162b68bb59474d6973';
$auth['code'] = '4355621177';
$auth['keyword'] = 'WCQP5F';
$recipient = array();
$recipient['recipients'][] = array(
'sendTo' => ((strlen($phone)==10) ? '1'.$phone : $phone),
'type' => 1, //SMS
'carrier' => '',
'country' => 'US',
'locale' => 'EN-US',
'message' => '',
'customfields' => array()
);
try {
//mail('jeremy@synergytpsreports.com,hanskirchhausen@gmail.com','txtwire debug',print_r($auth,true).print_r($message,true).print_r($recipient,true),"From:noreply@surfcrm.com\r\n");
$results = $soap->sendMessageSpecifyLocale($auth, $message, $recipient, '', 'https://surfcrm.com/bin/ajax/insert_text_sent_status.php?account=usa');
} catch (Exception $e) {
$results = false;
}
return $results;
}
function fetch_responses($start_time, $end_time) {
/*
grabs all texts sent to us between $start_time and $end_time
returns object:
stdClass Object
(
[error_code] => 0
[message] => Successfully retrieved inbound messages report.
[response] => stdClass Object
(
[messagelist] => Array
(
[0] => stdClass Object
(
[code] => 8019803888
[group] => ATM Title Loans > API Division (DO NOT DELETE) > API Group
[message] => I have just $80 I know its not all of it but I can do the rest next week here is my new card 5311 0832 5264 8414 1218 code on back of card is 968
[phone] => 14357725043
[timestamp] => 01/14/2015 2:10 PM
)
[1] => stdClass Object
(
[code] => 8019803888
[group] => ATM Title Loans > API Division (DO NOT DELETE) > API Group
[message] => Will you take $1000 and call it paid in full if I brought you $1000 today?
[phone] => 14357737543
[timestamp] => 01/15/2015 1:07 PM
)
)
)
[result] => 1
)
result is 1 or 0 if it was successful
*/
$wsdl = 'https://api.txtwire.com/webservices/?version=2.0.0&wsdl';
$soap = new SoapClient($wsdl, array('trace'=>1));
//create an authentication object
$auth = array();
$auth['username'] = 'synergy';
$auth['password'] = 'password123!';
$auth['api_key'] = 'eea2ebc6bdc5fb5535c9ac162b68bb59474d6973';
$auth['code'] = '4355621177';
$auth['keyword'] = 'WCQP5F';
$start_date = date('m/d/Y H:i:s',strtotime($start_time));
$end_date = date('m/d/Y H:i:s',strtotime($end_time));
$timezone = 'MST';
try {
$results = $soap->inboundMessages($auth,$start_date,$end_date,$timezone);
/*if(!empty($results->response->messagelist)) {
mail('jeremy@synergytpsreports.com,hanskirchhausen@gmail.com','txtwire import debug',print_r($auth,true).print_r($results,true),"From:noreply@surfcrm.com\r\n");
}*/
} catch (Exception $e) {
$results = array();
print_r($e);
print_r($soap->__getLastResponse());
}
return $results;
}