Can't add user to a group using MailChimp API 3.0
You are passing Interest grouping in the wrong array.you need to pass the interest group id in interests
array with value as true
.
$json = json_encode(array( 'email_address' => 'test@example.com', 'status' => 'subscribed', 'merge_fields' => array( 'FNAME' => 'FirstName', 'LNAME' => 'LastName', ), 'interests' => array( '9143cf3bd1' => true, '789cf3bds1' => true ),));
You will get the id of interest groups [9143cf3bd1,789cf3bds1
in above example] of the list by requesting to this URL
/lists/{list_id}/interest-categories
If you want to remove the subscriber from the group, you need to set its value to false
in your update request.