2

I'm having a hard time updating subscriber's attribute with this piece of code :

$client = new \ET_Client();

$subscribers = new \ET_Subscriber();
$subscribers->authStub = $client;
$subscribers->filter = array('Property' => 'SubscriberKey','SimpleOperator' => 'equals','Value' => $subscriberEmail);

$subscriber = $subscribers->get();

$subscriber->results[0]->Attributes[43]->Value = false;

$update = $subscriber->patch();

With this I'm getting this error : Exception occurred during [UpdateSubscriber] ErrorID: 227429849

I'm used to update with the SOAP API without problem usually.

Does someone can help me please ?

Thank you !

  • Here's the full answer : ET_Patch object { status => (bool) false code => (int) 200 message => null results => array(1) ( [0] => stdClass object { StatusCode => (string) Error StatusMessage => (string) Exception occurred during [UpdateSubscriber] ErrorID: 227429849 OrdinalID => (int) 0 ErrorCode => (int) 2 Object => stdClass object { } } ) request_id => null moreResults => null } – Daniel Lusignan Oct 6 '14 at 19:52
0

Based on what I just learned through trial and error based on error messages:

The attributes need to be an array in the form of 'Name', 'Value' entries like so:

$subscriber->results[0]->Attributes = array(
     'Name' => 43,
     'Value' => false
);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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