I've tried this:
$url = "https://www.exacttargetapis.com/messaging/v1/messageDefinitionSends/key:ac_alerts/send";
$content = json_encode('"To": {"Address": "example@example.com", "SubscriberKey": "example@example.com"}');
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER,
array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
$json_response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ( $status != 201 ) {
die("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
}
curl_close($curl);
$response = json_decode($json_response, true);
And I've tried this:
require('https://autoconnect.aaa.biz/wp-content/themes/goliath-child/exacttarget_soap_client.php');
$wsdl = 'https://webservice.exacttarget.com/etframework.wsdl';
try{
/* Create the Soap Client */
$client = new ExactTargetSoapClient($wsdl, array('trace'=>1));
/* Set username and password
*
* here */
$client->username = 'Ommitted for privacy!';
$client->password = 'Ommitted for privacy!';
$ts = new ExactTarget_TriggeredSend();
$tsd = new ExactTarget_TriggeredSendDefinition();
$tsd->CustomerKey = "ac_alerts";
$sub = new ExactTarget_Subscriber();
$sub->EmailAddress = "znolette@national.aaa.com";
$sub->SubscriberKey = "znolette@national.aaa.com";
$ts->Subscribers = $sub; $ts->TriggeredSendDefinition = $tsd;
$object = new SoapVar($ts, SOAP_ENC_OBJECT, 'TriggeredSend', "http://exacttarget.com/wsdl/partnerAPI");
var_dump($object);
echo "<br><br>";
$request = new ExactTarget_CreateRequest();
$request->Options = NULL;
$request->Objects = array($object);
$results = $client->Create($request);
var_dump($results);
} catch (SoapFault $e) {
var_dump($e);
}
Neither seems to do ANYTHING. I have no idea where to go from here. Any ideas? Even on just how to output some error code? I'm running these functions after submitting a form on a WordPress site.