Blog Posts
- NickHoldren's blog
- Login or register to post comments
397
Questions
Questions
Recent Blog Posts
New and Revised API Documentation for the week of May...
Tuesday, May 15, 2012 - 11:47
New and Revised API Documentation for the week of May...
Tuesday, May 8, 2012 - 12:34
New and Revised API Documentation for the week of May...
Wednesday, May 2, 2012 - 13:59
Calling ETSOAP API from Salesforce.com (SFDC) Using...
Friday, April 27, 2012 - 11:30
New and Revised API Documentation for the week of...
Tuesday, April 24, 2012 - 15:10
Recent Blog Comments
Hi Nick,Is there a way to
Wednesday, February 29, 2012 - 18:37
Van,The answer sadly is no.
Wednesday, February 15, 2012 - 17:09
Nice, is there a way to do
Wednesday, February 15, 2012 - 02:50
Mauricio, The iframe-based
Thursday, September 29, 2011 - 09:37
--Ian I would love to know
Tuesday, September 27, 2011 - 19:41
Who's online
There are currently 0 users and 13 guests online.



Clearing A Data Extension Using PHP
The following is a short code sample of how to clear a data extension inside of ExactTarget. This is very useful for external applications that need to clear data extensions without the need executing a query or deleting every row one at a time. It should be noted that this only applies to Enterprise 2.0 accounts and will not work elsewhere.
<?php
$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';
$de = new ExactTarget_DataExtension();
$de->CustomerKey = "DataExtensionExternalKey";
$object = new SoapVar($de, SOAP_ENC_OBJECT, 'DataExtension', "http://exacttarget.com/wsdl/partnerAPI");
$request = new ExactTarget_PerformRequestMsg();
$request->Action = "cleardata";
$request->Definitions = array($object);
$results = $client->Perform($request);
print_r($results);
?>