updateSubscribers

Description

Update multiple subscribers at once.



Params

Name Type Description
apiKey string API key previously generated.
ids array Array of subscriber ids.
activated boolean Optional parameter to activate/inactive subscribers.
banned boolean Optional parameter to ban subscribers.
deleted boolean Optional parameter set subscribers as deleted.

 

Returned data

Type: boolean

Description: Return true if subscribers were updated.

 

Json sample code

<?php

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

// Set subscribers 1,2 and 3 as not active.
$postData = array(
    'function' => 'updateSubscribers',
    'apiKey' => 'apiKey',
    'ids' => array(
        1,
        2,
        3
    ),
    'activated' => 0
);

$post = http_build_query($postData);

curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
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

bool(true)
Menu Title