There is quite a bit of documentation for the ExactTarget SOAP API that includes lots of code samples. But unfortunately the PHP code samples are not quite as plentiful as the .NET and Java ones. After lots of searching and lot of trial and error I finally got my upsert working. An upsert is a SOAP method in the ExactTarget SOAP API that will either update or insert a record depending on whether it is already present or not.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Where $deoSo is a DataExtension Object that has been converted to a SoapVar and $soapClient is an ExactTarget soap client instance. The way you get the upsert behavior is to set the saveaction to ExactTarget_SaveAction::UpdateAdd.
If you are looking for a minimal wrapper library that includes the above method take a look at this library on gitub. This library gleans quite a few things from the Doctrine ORM, so if you are familiar with that you should feel right at home.