Mailchimp API: How do I retrieve list of campaigns with the campaign ids?

37 Views Asked by At

I'm using the PHP Mailchimp Library and I have a list of campaign ids. How can I retrieve the information for all those campaigns in one call?

I'm trying the SearchCampaigns endpoint but the result is always empty.

$mailchimp = new \MailchimpMarketing\ApiClient();
$mailchimp->setConfig([
    'apiKey' => env('MAILCHIMP_MARKETING_API_KEY'),
    'server' => env('MAILCHIMP_SERVER_PREFIX'),
]);


$campaign_ids = ['111aaaa','yyyyyy'];
$response = $mailchimp->searchCampaigns->search([
    'query' => NOT SURE HOW TO WRITE THE QUERY HERE,
]);
0

There are 0 best solutions below