Mailchimp api 3.0 error: "Schema describes object, array found instead" is the code or on mailchimp's end?
I had a similar error.Hope it's still relevant for future users.
The main problem is the mailchimp documentation.
$operations = [];foreach ($customers as $customer){ if ($customer->hasEmail()) { $operations['operations'][] = (object) [ 'method' => 'post', 'path' => '/lists/' . $settings['list_id'] . '/members', 'body' => json_encode([ 'email_address' => $customer->email, 'status' => 'subscribed', 'merge_fields' => (object) [], ]) ]; }}try{ $response = $mailchimp->batches->start($operations); print_r($response);}catch (\Exception $e){ // var_dump($e->getMessage()); print_r($e->getResponse()->getBody()->getContents());}
I had a similar issue, the message was "Schema describes string, boolean found instead". It seems that json_encode() has a problem with special characters
I solved it using this code, maybe it will work for you:utf8_encode($row['FNAME']) or you could try using (string). I hope this can help somebody. I used POST instead of PUTExample:
$stringData = array( 'apikey' => $api_key, 'email_address' => $row['email'], 'status' => 'subscribed', 'merge_fields' => array( 'FNAME' => utf8_encode($row['FNAME']), 'LNAME' => utf8_encode($row['LNAME']) ) );