500 error with valid request

I am using the php wrapper and attempting to create a campaign with the following code:
$result = $wrap->create(922739720599a5259020cf1f49ac9da6, array(
            'Subject' => 'Test Campaign',
            'Name' => 'Test CompanyTest Campaign',
            'FromName' => 'Test Company',
            'FromEmail' => 'valid email',
            'ReplyTo' => 'valid email',
            'HtmlUrl' => 'valid url to an html file',
            'TextUrl' => 'valid url to a text file,
            'ListIDs' => array('2d4f34e6a9cb11350671df5e9bae5c69')
        ));

I keep getting a 500 error and I'm not sure where to look next. Any help would be greatly appreciated.

tobyb tobyb, 5 years ago

Hi Saleem,

There's currently a bug with the API code which is causing this issue, currently all campaign create calls with the segments undefined will run into this problem. The bug will be fixed in the next release (in the coming weeks).

As a workaround you can just send an empty array for the SegmentIDs parameter, e.g

$result = $wrap->create(922739720599a5259020cf1f49ac9da6, array(
            'Subject' => 'Test Campaign',
            'Name' => 'Test CompanyTest Campaign',
            'FromName' => 'Test Company',
            'FromEmail' => 'valid email',
            'ReplyTo' => 'valid email',
            'HtmlUrl' => 'valid url to an html file',
            'TextUrl' => 'valid url to a text file,
            'ListIDs' => array('2d4f34e6a9cb11350671df5e9bae5c69'),
            'SegmentIDs' => array()
        ));

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098