Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MailChimp API v3.0 Campaign Schedule Error

I'm using the MailChimp API v3.0 and trying a schedule a campaign but every time I schedule and then check from my account it is not getting scheduled properly.

Here's the code I have,

        if($camp_content){

            $camp_schedule = $MailChimp->post('campaigns/'. $camp["id"] .'/actions/schedule',array(
                "schedule_time" => "2016-03-31 10:00:00",
                "timewarp" => false

            ));
        }

When I check the output after schedule I get this,

Array ( [title] => MC_API30_ Exception [status] => 406 [detail] => This campaign cannot be scheduled: . [instance] => )

like image 290
Dilhan Nakandala Avatar asked Mar 17 '16 06:03

Dilhan Nakandala


1 Answers

Your request for campaign schedule is 100% correct but the problem is with campaign.

After having 4 hours of debugging, I finally reached to the point. This error comes when your campaign is not ready 100%. For campaign debugging, use checklist url like this :

https://usX.api.mailchimp.com/3.0/campaigns/{campaing_id}/send-checklist?apikey=xxxxxxxxx

It will give you response like this:

http://prntscr.com/odyhaj

My error was the from_email.

Once you get true in this response, you will be able to schedule the cron. Make sure datetime should be multiple of 15 like: 00,15,30,45

like image 197
Maha Dev Avatar answered Nov 05 '22 12:11

Maha Dev