API create campaign

So first item is when I try to create a campaign I get "Unprocessable Entry" back (see below for code).

The second item, I want to know "send_at" is required in the API. Is their a way to create a draft this way?

Code:
"create_campaign" => Response {#324 ▼
    +url: "http://mailwizz.dev/api/index.php/campaigns"
    +headers: null
    +contentType: "application/json; charset=UTF-8"
    +httpMessage: "Unprocessable Entity"
    +curlCode: 0
    +curlMessage: ""
    +storeCurlInfo: false
    +curlInfo: null
    +body: Params {#322 ▶}
    +request: null
    -_httpCode: 422
  }

Based on the following:
Code:
$response_data['create_campaign'] = $campaigns->create(array(
            'name'          => 'My API Campaign', // required
            'from_name'     => 'John Doe', // required
            'from_email'    => 'john.doe@doe.com', // required
            'subject'       => 'Hey, i am testing the campaigns via API', // required
            'reply_to'      => 'john.doe@doe.com', // required
            'send_at'       => date('Y-m-d H:i:s', strtotime('+10 hours')), // required, this will use the timezone which customer selected
            'list_uid'      => 'bj933ph62k7e5', // required

            // optional block, defaults are shown
            'options' => array(
                'url_tracking'      => 'no', // yes | no
                'json_feed'         => 'no', // yes | no
                'xml_feed'          => 'no', // yes | no
                'plain_text_email'  => 'yes',// yes | no
                'email_stats'       => null, // a valid email address where we should send the stats after campaign done
            ),

            // required block, archive or template_uid or content => required.
            'template' => array(
                //'archive'         => file_get_contents(dirname(__FILE__) . '/template-example.zip'),
                //'template_uid'    => 'TEMPLATE-UNIQUE-ID',
                'content'           => 'tets',
                'inline_css'        => 'no', // yes | no
                'plain_text'        => null, // leave empty to auto generate
                'auto_plain_text'   => 'yes', // yes | no
            ),
        ));
 
So first item is when I try to create a campaign I get "Unprocessable Entry" back (see below for code).

The second item, I want to know "send_at" is required in the API. Is their a way to create a draft this way?

Code:
"create_campaign" => Response {#324 ▼
    +url: "http://mailwizz.dev/api/index.php/campaigns"
    +headers: null
    +contentType: "application/json; charset=UTF-8"
    +httpMessage: "Unprocessable Entity"
    +curlCode: 0
    +curlMessage: ""
    +storeCurlInfo: false
    +curlInfo: null
    +body: Params {#322 ▶}
    +request: null
    -_httpCode: 422
  }

Based on the following:
Code:
$response_data['create_campaign'] = $campaigns->create(array(
            'name'          => 'My API Campaign', // required
            'from_name'     => 'John Doe', // required
            'from_email'    => 'john.doe@doe.com', // required
            'subject'       => 'Hey, i am testing the campaigns via API', // required
            'reply_to'      => 'john.doe@doe.com', // required
            'send_at'       => date('Y-m-d H:i:s', strtotime('+10 hours')), // required, this will use the timezone which customer selected
            'list_uid'      => 'bj933ph62k7e5', // required

            // optional block, defaults are shown
            'options' => array(
                'url_tracking'      => 'no', // yes | no
                'json_feed'         => 'no', // yes | no
                'xml_feed'          => 'no', // yes | no
                'plain_text_email'  => 'yes',// yes | no
                'email_stats'       => null, // a valid email address where we should send the stats after campaign done
            ),

            // required block, archive or template_uid or content => required.
            'template' => array(
                //'archive'         => file_get_contents(dirname(__FILE__) . '/template-example.zip'),
                //'template_uid'    => 'TEMPLATE-UNIQUE-ID',
                'content'           => 'tets',
                'inline_css'        => 'no', // yes | no
                'plain_text'        => null, // leave empty to auto generate
                'auto_plain_text'   => 'yes', // yes | no
            ),
        ));


crm+mwz?

perhaps the folks of zapier/IFTTT/etc (or others: http://alternativeto.net/software/zapier/)
can help (as this is their biz)?
 
Last edited:
This is a custom piece I am writing so probably not, I just am stuck because I am not getting an error back that I can test off of. I need to be able to save a campaign from this spot.
 
This is a custom piece I am writing so probably not, I just am stuck because I am not getting an error back that I can test off of. I need to be able to save a campaign from this spot.

put some traceable action in-between
or
see all logs of app, account, server, etc
 
Back
Top