I am just starting out with the activecampaign / php API. I need to add multiple users to a list, and I was wondering if there is a way to add an array of users instead a single user.
According to https://www.activecampaign.com/api/example.php?call=contact_add I can update a list with 1 user per API call.
$contact = array(
"email" => "test@example.com",
"first_name" => "Test",
"last_name" => "Test",
"p[{$list_id}]" => $list_id,
"status[{$list_id}]" => 1, // "Active" status
);
$contact_sync = $ac->api("contact/sync", $contact);
Looping this does not seem optimal - it would seem much better if I could simply pass an array of users when I connect to the API.
Any help or hints would be much appreciated!