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 !

1
  • 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 } Oct 6, 2014 at 19:52

1 Answer 1

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
);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .