Tag Archive for API

Creating A User-Initiated Send in ExactTarget via the SOAP API in PHP

The following example shows how to create a User-Initiated Send Definition in your ExactTarget account using the SOAP API and PHP. More specifically it shows how to create a send definition with a Data Extension as opposed to List. Additional options are available for exclusion lists, but I didn’t use them in this code sample. $wsdl = ‘https://webservice.exacttarget.com/etframework.wsdl’; /* Create…

Delete Subscriber From List in ExactTarget

$wsdl = ‘https://webservice.s6.exacttarget.com/etframework.wsdl’; $client = new ExactTargetSoapClient($wsdl, array(‘trace’ => 1)); $client->username = ‘username’; $client->password = ‘password’; $sub = new ExactTarget_Subscriber(); $sub->EmailAddress = ‘bill@msn.com’; $subList = new ExactTarget_SubscriberList(); $subList->ID = 11902; $subList->Status = ExactTarget_SubscriberStatus::Active; $subList->Action = “delete”; $sub->Lists = array($subList); $object = new SoapVar($sub, SOAP_ENC_OBJECT, ‘Subscriber’, “http://exacttarget.com/wsdl/partnerAPI”); $request = new ExactTarget_UpdateRequest(); $request->Options = NULL; $request->Objects = array($object); $results = $client->Update($request);

Execute A Triggered Send With Additional Attributes Via SOAP API In ExactTarget Using PHP

This is an example of how to execute a triggered send within the ExactTarget platform. $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 = ‘username’; $client->password = ‘password’; //Define the subscriber $subscriber = new ExactTarget_Subscriber(); $subscriber->EmailAddress = ‘test@test.com’; $subscriber->SubscriberKey = ‘test@test.com’; //Define the attribute $company = new ExactTarget_Attribute();…

Update A Query Activity In ExactTarget Via SOAP API In ExactTarget

try { $wsdl = ‘https://on.exacttarget.com/etframework.wsdl’; $client = new ExactTargetSoapClient($wsdl, array(‘trace’=>1)); $client->username = ‘username’; $client->password = ‘password’; //Define the query definition $query = new ExactTarget_QueryDefinition(); $query->ObjectID = ‘QueryID’; $sql = “SELECT TOP 10 FROM table”; $query->QueryText = $sql; //Set the targeted data extension $ibo = new ExactTarget_InteractionBaseObject(); $ibo->CustomerKey = ‘Target DE’; $ibo->Name = “Test Send”; $query->DataExtensionTarget = $ibo; $query = new…