Closed OrangePixelLtd closed 7 months ago
Hi @OrangePixelLtd
The unlinkListIds
method is supported in this route (https://developers.brevo.com/reference/updatecontact).
Please refer to the sample example below to see how you can utilize it: -
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$config = Brevo\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
$apiInstance = new Brevo\Client\Api\ContactsApi(
new GuzzleHttp\Client(),
$config
);
$identifier = 'example2@example2.com';
$updateContact = new \Brevo\Client\Model\UpdateContact();
$updateContact['attributes'] = array('EMAIL'=>'example@domain.com', 'FIRSTNAME'=>'John Doe');
$updateContact['unlinkListIds'] = array(9);
try {
$apiInstance->updateContact($identifier, $updateContact);
} catch (Exception $e) {
echo 'Exception when calling ContactsApi->updateContact: ', $e->getMessage(), PHP_EOL;
}
?>
If you encounter any further issues, please feel free to inform me, and I will investigate further to assist you.
Thank you for your cooperation and understanding!
For removal of contact from List(s) during updateContact() API call.
What type of PR is this? (select all that apply)
🐛 Bug Fix
As shown in the API documentation https://developers.brevo.com/reference/updatecontact the method accepts 'unlinkListIds' (an array of int64s).
I was working on a project where this was needed and found a bug where it wasn't being accepted. I updated the Model and it all seems to be working now.
Example: