Is it possible to enable the campaign stats and set the password via the API?

Rob Bruce

New Member
Is it possible to enable the campaign stats and set the password via the API?

If not can anyone hint towards how to create the API endpoint to do this?

Thank you.
 
Happy new year!
I'm going to give this a bump because I posted just before the holiday started.

To give more detail I have created a custom event system that will use mailwizz for sending out mail. Once the event is over I want the system to send the statistics links for the campaign automatically to specific person. I would need some way to enable and set the statistics password automatically via the API. Is this possible? I've got some basic experience extending the API so any hints would be welcome.

Thank you.
 
Thanks...

The API examples you provided on github make me think it should be as easy as adding the attributes to the options array in bold below?

// UPDATE CAMPAIGN
$response = $endpoint->update('CAMPAIGN-UNIQUE-ID', array(
'name' => 'My API Campaign UPDATED', // optional at update
'from_name' => 'John Doe', // optional at update
'from_email' => 'john.doe@doe.com', // optional at update
'subject' => 'Hey, i am testing the campaigns via API', // optional at update
'reply_to' => 'john.doe@doe.com', // optional at update
'send_at' => date('Y-m-d H:i:s', strtotime('+1 hour')), //optional at update, this will use the timezone which customer selected
'list_uid' => 'LIST-UNIQUE-ID', // optional at update
'segment_uid' => 'SEGMENT-UNIQUE-ID',// optional, only to narrow down
// 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
'share_reports_enabled' => yes,
'share_reports_password' => 'thepassword',
'share_reports_mask_email_addresses' => yes



),
// optional block at update, archive or template_uid or content => required.
'template' => array(
//'archive' => file_get_contents(dirname(__FILE__) . '/template-example.zip'),
//'template_uid' => 'TEMPLATE-UNIQUE-ID',
'content' => file_get_contents(dirname(__FILE__) . '/template-example.html'),
'inline_css' => 'no', // yes | no
'plain_text' => null, // leave empty to auto generate
'auto_plain_text' => 'yes', // yes | no
),
));
 
Yes, I can set the stats password and activate them during the creation of a new campaign via the API and that is enough for my use. I can not add the password and enable the statistics URL if the campaign has already been sent, it returns an error that the "This campaign is not ediable"

Thanks.
 
Back
Top