Although having the ability to wrap the entire SOAP API would be nice I found it nearly impossible. However, I’ve made a simplified version that allows one to act on ExactTarget objects. It allows for Create, Update, Delete, Retrieve, and Upsert of an object. Again, it is simple but it will save in writing a [...]
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 [...]
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 [...]
{ $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->Name = “Test Query”; $query->CustomerKey = “TestQuery”; $query->Description = “Test Query Description”; $query->TargetUpdateType = “Overwrite”; $query->TargetType = “DE”; $query->QueryText = “SELECT * FROM table”; //Set the targeted data extension $ibo = new [...]
try{ $wsdl = ‘https://on.exacttarget.com/etframework.wsdl’; //Create the Soap Client $client = new ExactTargetSoapClient($wsdl, array(‘trace’=>1)); //Set the username and password $client->username = ‘username’; $client->password = ‘password’; //First find the parent folder $filter = new ExactTarget_SimpleFilterPart(); $filter->Property = “Name”; $filter->SimpleOperator = ExactTarget_SimpleOperators::equals; $filter->Value = array(‘Data Extensions’); //Other possibilities include Emails, or any other folder name //Encode the filter [...]
[pre] try { $wsdl = ‘https://on.exacttarget.com/etframework.wsdl’; $client = new ExactTargetSoapClient($wsdl, array(‘trace’=>1)); $client->username = ‘username’; $client->password = ‘password’; $content_area = new ExactTarget_ContentArea(); $content_area->Name = ‘My Example Content Area’; $content_area->Content = ‘Hello World’; $content_area = new SoapVar($content_area, SOAP_ENC_OBJECT, ‘ContentArea’, “http://exacttarget.com/wsdl/partnerAPI”); //Setup and execute the request $request = new ExactTarget_CreateRequest(); $request->Objects = $content_area; $request->Options = NULL; $results = [...]
[pre] $wsdl = ‘https://webservice.exacttarget.com/etframework.wsdl’; /* Create the Soap Client */ $client = new ExactTargetSoapClient($wsdl, array(‘trace’=>1)); /* Set username and password here */ $client->username = ‘username’; $client->password = ‘password’; $rr = new ExactTarget_RetrieveRequest(); $rr->ObjectType = “DataExtensionObject[ExampleDE]“; // ExampleDE is the name of the data extension $rr->Properties = array(); $rr->Properties[] = “SubscriberKey”;//Field you would like to return [...]
try{ $wsdl = ‘https://on.exacttarget.com/etframework.wsdl’; //Create the Soap Client $client = new ExactTargetSoapClient($wsdl, array(‘trace’=>1)); //Set the username and password $client->username = ‘username’; $client->password = ‘password’; $folder = new ExactTarget_Folder(); $folder->Name = ‘My New Folder’; $folder->CustomerKey = ‘My New Folder’; $folder->Description = ‘An Example of a folder created through the API’; $folder->IsActive = true; $folder->IsEditable = true; [...]
Sometimes it is nice to create custom views/reports of data that are not given within the ExactTarget environment. The following script retrieves tracking summary data for a given business unit. You can then use the data however you like, whether it is for data warehousing, custom graphs, or custom reports. <!–?php </p–> //API Endpoint $wsdl [...]
This code snippet performs an upsert of data into an ExactTarget data extension. This command has been somewhat of a unicorn for me and isn’t documented well at all within the ExactTarget wiki. I’ve taken the sample code written in .NET and ported it over into PHP. I would like to note that you can [...]