Create subscriber: set values for multiselect and checkbox

Konvert AG

New Member
Hi,

I need to set multiple values for a multiselect- and a checkbox-field when creating a new subscriber via API.
In the Docs I can only find the following as an example:

$response = $endpoint->create('LIST-UNIQUE-ID', array(
'EMAIL' => 'john.doe@doe.com',
'FNAME' => 'John',
'LNAME' => 'Doe'
));


Can anyone tell me where to find examples for other input types or explain how to populate fields with multiple values?

Thanks in advance.

Best regards,
Sybille
 
Did you mean something like this?

PHP:
// ADD SUBSCRIBERS IN BULK (since MailWizz 1.8.1)
$response = $endpoint->createBulk('LIST-UNIQUE-ID', array(
    array(
        'EMAIL'    => 'john.doe-1@doe.com',
        'FNAME'    => 'John',
        'LNAME'    => 'Doe'
    ),
    array(
        'EMAIL'    => 'john.doe-2@doe.com',
        'FNAME'    => 'John',
        'LNAME'    => 'Doe'
    ),
    array(
        'EMAIL'    => 'john.doe-3@doe.com',
        'FNAME'    => 'John',
        'LNAME'    => 'Doe'
    )
));
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
 
Hi ghimes,

thank you for your answer.
Thats not quite it, I'd like to have only one subscriber but a field with multiple values. A multiselect for example. I tried something like this, but it didn't work:

PHP:
        'EMAIL'    => 'john.doe-1@doe.com',
        'FNAME'    => 'John',
        'LNAME'    => 'Doe',
        'ANIMAL'    => array('dog', 'cat')
 
@Konvert AG - i think i can answer this, right now the API is not able to accept multiple values, but we'll be working to add this functionality for the near future.
 
Just a heads up, it appears you can provide an array of multiselect values now.
To remove a value, you must select all values except the one you want to remove. So to remove "dog" you have to submit:
PHP:
'ANIMAL'    => array('cat')
 
Back
Top