0

I don't see a method built in the existing php sdk to add or remove subscriber from the auto suppression list, can somebody please share the same if you have it developed

  • An Auto suppression list is just a DE, so you would use the same method to remove records from a DE – EazyE Jan 8 at 15:35
  • Thanks EazyE, i was able to add and delete subscriber using the DataExtension Object – Ashish Jan 8 at 19:37
0


print_r("Get all Data Extensions \n");
$getDE = new ET_DataExtension();
$getDE->authStub = $myclient;
$getDE->props = array("CustomerKey", "Name");
$getDE->filter = array('Property' => 'CustomerKey','SimpleOperator' => 'equals','Value' => $customerKey);
$getResult = $getDE->get();
print_r('Get Status: '.($getResult->status ? 'true' : 'false')."\n");
print 'Code: '.$getResult->code."\n";
print 'Message: '.$getResult->message."\n";
print_r('More Results: '.($getResult->moreResults ? 'true' : 'false')."\n");
print 'Result Count: '.count($getResult->results)."\n";
print 'Results: '."\n";
print_r($getResult->results);
print "\n---------------\n";


//Get all Data Extensions Columns filter by specific DE
print_r("Get all Data Extensions Columns filter by specific DE \n");
$getDEColumns = new ET_DataExtension_Column();
$getDEColumns->authStub = $myclient;
$getDEColumns->props = array("CustomerKey", "Name");
$getDEColumns->filter = array('Property' => 'CustomerKey','SimpleOperator' => 'equals','Value' => $customerKey);
$getResult = $getDEColumns->get();
print_r('Get Status: '.($getResult->status ? 'true' : 'false')."\n");
print 'Code: '.$getResult->code."\n";
print 'Message: '.$getResult->message."\n";
print_r('More Results: '.($getResult->moreResults ? 'true' : 'false')."\n");
print 'Result Count: '.count($getResult->results)."\n";
print 'Results: '."\n";
print_r($getResult->results);
print "\n---------------\n";



// Add a row to a DataExtension (Specify CustomerKey instead of Name)
print_r("Add a row to a DataExtension (Specify CustomerKey instead of Name)  \n");
$postDRRow = new ET_DataExtension_Row();
$postDRRow->authStub = $myclient;
$postDRRow->props = array("Email Address" => "email@example.com");
$postDRRow->CustomerKey = $customerKey;
$postResult = $postDRRow->post();
print_r('Post Status: '.($postResult->status ? 'true' : 'false')."\n");
print 'Code: '.$postResult->code."\n";
print 'Message: '.$postResult->message."\n";
print 'Result Count: '.count($postResult->results)."\n";
print 'Results: '."\n";
print_r($postResult->results);
print "\n---------------\n";

//Get all Data Extensions Rows (By CustomerKey)
print_r("Get all Data Extensions Rows (By CustomerKey) \n");
$getDERows = new ET_DataExtension_Row();
$getDERows->authStub = $myclient;
$getDERows->props = array("Email Address", "Date Added");
$getDERows->CustomerKey = $customerKey;
$getResult = $getDERows->get();
print_r('Get Status: '.($getResult->status ? 'true' : 'false')."\n");
print 'Code: '.$getResult->code."\n";
print 'Message: '.$getResult->message."\n";
print_r('More Results: '.($getResult->moreResults ? 'true' : 'false')."\n");
print 'Result Count: '.count($getResult->results)."\n";
print 'Results: '."\n";
print_r($getResult->results);
print "\n---------------\n";

// Delete a row from a DataExtension
print_r("Delete a row from a DataExtension   \n");
$deleteDRRow = new ET_DataExtension_Row();
$deleteDRRow->authStub = $myclient;
$deleteDRRow->props = array("Email Address" => "email@example.com");
$deleteDRRow->CustomerKey = $customerKey;
$deleteResult = $deleteDRRow->delete();
print_r('Delete Status: '.($deleteResult->status ? 'true' : 'false')."\n");
print 'Code: '.$deleteResult->code."\n";
print 'Message: '.$deleteResult->message."\n";
print 'Result Count: '.count($deleteResult->results)."\n";
print 'Results: '."\n";
print_r($deleteResult->results);
print "\n---------------\n";

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.