Resubscribe via API

Torben

New Member
Hello,

I have a problem with resubscribing a subscriber.

I tried to "confirm" a subscriber via Mailwizz API v2, who has been unsubscribed by the api before. But now the "Status" keeps "unsubscribed".

Before, I used API v1 and I could do that with "createUpdate". But with API v2 it does not work. The subscriber is updated correctly, but keeps "unsubscribed".
 
The Code looks like the following:

$response = $endpoint->createUpdate('LIST-ID', [
'EMAIL' => $email,
'COMPANYNAME' => $customerName,
'FNAME' => $contactFirstName,
'LNAME' => $contactLastName,
'FILENAME' => $filename,
'GROUP' => $category,
'SALUTATION' => $salutation,
]);

The subscriber gets updated correctly, but the status keeps unsubscribed. Before, with Api v1 this function changed status to "confirmed".

Unsubscribing via API is done with:
$response = $endpoint->unsubscribeByEmail('LIST-ID', $email);
 
Hello,
Can you please try adding a details key for the payload. Like:
PHP:
$response = $endpoint->createUpdate('LIST-ID', [
'EMAIL' => $email,
'COMPANYNAME' => $customerName,
'FNAME' => $contactFirstName,
'LNAME' => $contactLastName,
'FILENAME' => $filename,
'GROUP' => $category,
'SALUTATION' => $salutation,
'details' => [
    'status' => 'confirmed'
]   
]);
 
Back
Top