sendCampaign

Description

This function allows you to send a campaign to the groups that are assigned to them.

It will return an mailing list id. You can use this id to control mailing list with its respective functions like and or get statistics.



Params

NameTypeDescription
apiKeystringAPI key previously generated.
idintegerId of the campaign that you want to send.
datestringOptional parameter to specify a date that campaign will be sent. If not set, it will use the current date.

It should follow this format: YYYY-MM-DD HH:MM
vmtaintegerId of the vmta that should be used for this send.
notificationUrlstringSet an URL that will be notified when the send finishes successfully.

 

Returned data

Type: integer

Description: Return integer with mailing list id.

 

Json sample code

<?php

$curl = curl_init('https://your_address/ccm/admin/api/version/2/&type=json');

$postData = array(
    'function' => 'sendCampaign',
    'apiKey' => 'apiKey',
    'id' => 5,
);

curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$json = curl_exec($curl);
if ($json === false) {
    die('Request failed with error: '. curl_error($curl));
}

$result = json_decode($json);
if ($result->status == 0) {
    die('Bad status returned. Error: '. $result->error);
}

var_dump($result->data);

 

Result of API call

int(24)