API.updateSubscriber

This action allows you to modify the information about a subscriber to one of your publications

Request

api_key Use your API key
login Use the e-mail address of an account profile that has access to the APIs.
md5_pwd Use the password from the profile, encrypted in MD5 format.
subscription_code Use the API code supplied in the “Your subcriptions” page, or recovered by the getAccountSubscriptions API
subscriber_login Login of the subscriber
subscriber Table that contains the changes. The order is of no importance. All fields are optional, only the fields present will be updated, the rest of the information about your subscriber will remain unchanged:
  • Login: New login of the subscriber
  • FirstName: New first name of the subscriber
  • LastName: New last name of the subscriber
  • Email: New email address of the subscriber
  • IsActive: New status of the subscriber: 1 (active) or 0 (inactive).
  • Extras: VARCHAR field of up to 255 freely usable characters
  • Language (optional): New language of the subscriber, using a two-letter code.

Response

This request sends the character string “ok” if successful.

An error message is sent back in case of problems.

Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Subscriber update</title>
</head>

<body>
<?php

    include_once('nusoap.php');
    
    $client = new soapclient('http://api.calameo.com/?wsdl', true);

    $err = $client->getError();
	
    if ($err) {
       // Display the errors
       echo 'SOAP Error: ' . $err;
       // If an error occurs, it's useless to continue
       die('An error has occurred!');
    }

    $message = 'API.updateSubscriber';

    $updated_subscriber = array (
		    'Login'		=> 'nouvel_identifiant_de_l_abonné',
		    'FirstName'		=> 'nouveau_prénom',
		    'LastName'		=> 'nouveau_nom',
		    'Email'		=> 'son_nouvel_e-mail',
		    'IsActive'		=> '1',
		    'Extras'		=> 'Nouveau Commentaire de 255 caractères maximum',
		    'Language'		=> 'en',
		    );

    $params = array (
		    'api_key'		=> '123346544abdefbca1546854',
		    'login'		=> 'email@moncompte.com',
		    'md5_pwd'		=> 'd4f7ccab36fbfedc5f53e09d20d6973a',
		    'subscription_code'	=> '05511df55155d5a5bc5',
		    'subscriber_login'	=> 'ancien_login',
		    'subscriber'	=> $updated_subscriber,
		    );

    $result = $client->call($message, $params);

    if ($client->fault) {
        // An error has occurred
        die('An error has occurred!');
    } else {
        // Verify if a SOAP error wasn’t sent back
        $err = $client->getError();
        if ($err) {
            // Display the error
	    echo 'SOAP Error: ' . $err ;
        } else {
	    // All went well, you can process the result => $result
            echo '<pre>';
            echo 'Subscriber successfully updated!';
            echo '</pre>';
        }
    }

?>
</body>
</html>
Customer service discussions
Loading...