Level 4
Please, forget about it. It was my mistake, I was trying with an email that looks fake or invalid for Mailchimp
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello everybody! I'm trying to subscribe members into a list on Mailchimp with API 3.0 but I don't know what I'm doing wrong because even the response is OK but when I look for the new member through the mailchimp website it doesn't appear on the list. This is how the controller makes the call:
$userData = '{"members": [{
"email_address": "[email protected]",
"status": "subscribed"}],
"update_existing": true}';
$curl_options = array
(
CURLOPT_USERPWD => 'user:' . config('services.mailchimp.secret'),
CURLOPT_VERBOSE => true,
CURLOPT_HTTPHEADER => array('Content-Type: application/json'),
CURLOPT_POSTFIELDS => $userData
);
$client = new Client();
$response = $client->request('POST', config('services.mailchimp.domain') . config('services.mailchimp.list_id'), [
'curl' => $curl_options
]);
dd($response);
The response:
* upload completely sent off: 124 out of 124 bytes
< HTTP/1.1 200 OK
< Server: openresty
< Content-Type: application/json; charset=utf-8
< Content-Length: 644
< X-Request-Id: a62dea73-a1f1-4449-aabd-5c1cb6c632c1
< Link: <https://us13.api.mailchimp.com/schema/3.0/Lists/Instance.json>; rel="describedBy", <https://us13.admin.mailchimp.com/lists/members/?id=88377>; rel="dashboard"
< Content-Encoding: gzip
< Vary: Accept-Encoding
< Date: Wed, 14 Mar 2018 00:40:29 GMT
< Connection: keep-alive
< Set-Cookie: _AVESTA_ENVIRONMENT=prod; path=/
<
* Curl_http_done: called premature == 0
* Connection #0 to host us13.api.mailchimp.com left intact
By the way, I'm using Laravel 5.5 and "guzzlehttp/guzzle": "^6.3"
Any ideas?
Please or to participate in this conversation.