Campaign.Create using CMBase.php returns 400 - Bad Request

I'm using CMBase.php from version 1.2.3.

Curl is installed and working correctly.

I tried 2 of my servers, one using Ubuntu with PHP 5.x and one using FreeBSD with PHP 4.x. In both cases it returned a HTTP Status Code 400 error.

I tried nusoap.php instead of CMBase.php, but that results in sending a different XML request to the API. In this case the API said my ClientID was wrong, which can be related to the different-looking XML request. Nusoap.php is easy when there's a WSDL available for the API, but there isn't.

I am under the impression that the SOAP functions aren't working correctly right now, because the REST API is working fine.

Anyone care to comment?

Tinus, 8 years ago

This is my DebugInfo.

CampaignMonitor Object
    [soapAction] =>
    [api] => xxx
    [campaign_id] => 
    [client_id] => xxx
    [list_id] => 
    [method] => soap
    [curl] => 1
    [curlExists] => 1
    [debug_level] => 1
    [debug_request] => 
        March newsletter
        March newsletter
        John Smith

    [debug_response] => 
    [debug_url] =>
    [debug_info] => Array
            [http_code] => 400
            [header_size] => 206
            [request_size] => 1182
            [filetime] => -1
            [ssl_verify_result] => 0
            [redirect_count] => 0
            [total_time] => 0.309189
            [namelookup_time] => 0.060786
            [connect_time] => 0.183386
            [pretransfer_time] => 0.183518
            [size_upload] => 0
            [size_download] => 0
            [speed_download] => 0
            [speed_upload] => 0
            [download_content_length] => 0
            [upload_content_length] => 0
            [starttransfer_time] => 0.309124
            [redirect_time] => 0
            [headers_sent] => Array
                    [0] => User-Agent: CMBase URL Handler 1.5
                    [1] => Content-Type: text/xml; charset=utf-8
                    [2] => SOAPAction: ""


    [show_response_headers] => 0

Note: API keys and ID are replaced with xxx

Tinus, 8 years ago

Please guys, let me know if you're listening!! I have 8 clients waiting for the Campaign.Create feature and you're ignoring my topics and emails. Give me a sign of life.

Phil Phil, 8 years ago

Hi Tinus,

Thanks for your questions, and apologies for the delay in replying.

Firstly you can find the WSDL at:

Secondly if you're going to use NuSOAP, my advice would be to use 0.72 - we have had a lot of customers with 0.73 dramas.

Having said that, it's difficult to say exactly why you'd be getting a 400 error (often the result of malformed XML) without seeing the way you're handling the calling code. I notice you've got a support request open, so we'll try and resolve things through that means. You should hear from me soon.


ben_e, 8 years ago

It's a bit belated, but for the record, i made the mistake of forgetting to encode the urls, resulting in 400 error.

200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free