Jump to content

ModifySubscriber()

Modify a subscriber's email address or contact list status

Parameters

ApiKey (Required)
    Your application authentication key. Click here to find out more.
ListID (Required)
    The list you would like to add the subscriber to. Click here to find out more.
Email (Required)
    The email address of the subscriber you would like to modify.
NewEmail (Required)
    The new email address. (If you would not like to change the email address pass the current email address here.)
Confirmed (Required)
    Allows you to change the confirmed status of the subscriber. (1 for confirmed, 0 for unconfirmed)
Status (Required)
    The status of the subscriber. Acceptable values: 'active', 'bounced', 'unsubscribed', ''(If you pass it an empty string no change will occur.). Click here to find out more.

Return Value

On success, this method returns a "success" response (code 0). On failure, a SOAP fault exception is thrown with one of the fault codes below.

Usage Notes

none

Fault Codes

1 - Invalid Email Address
    The email value is malformed or invalid
3 - Subscriber Does Not Exist
    The email does not exist in the specified list
4 - Invalid New Email Address
    The new email value is malformed or invalid
5 - A subscriber already exists with the new email address
    The new email address you provided is already in use by another subscriber on that list.
20 - Invalid ListID
    The Associated List is not valid
100 - Invalid API Key
    The API key is not valid or expired
500 - The Email Address Could Not Be Changed
    The new email address could not be applied due to api communications
600 - The subscrier could not be updated
    An error occured when atempting to submit the status modifications.

SOAP Sample Request


    
    
        
            
                STRING
                INT
                STRING
                STRING
                STRING
                INT
            
        
    

SOAP Sample Response


    
    
        
            
                INT
                STRING
            
        
    

Code Sample - PHP

// Import the eConnect Email API Toolkit
require_once('eConnectEmail_API_Toolkit.php');

$eConnectEmailApi = TheKeyMakerClient('YOUR_API_KEY');

// Status accepts: active, bounced, unsubscribed or 
// an empty string to prevent change.
$result = $eConnectEmailApi->ModifySubscriber(LIST_ID, 'EMAIL_ADDRESS', 
                                             'NEW_EMAIL', CONFIRMED, 
                                             'STATUS');

// Show the results
print 'Response: <pre>';
print_r($result);
print '</pre>';

Code Sample - ASP.NET C#

            TheKeyMaker_v20 api = new TheKeyMaker_v20();
            // Set up input parameters
            ModifySubscriber modifySubParams = new ModifySubscriber();
            modifySubParams.ApiKey = txtApiKey.Text;
            modifySubParams.ListID = int.Parse(txtModifySubListID.Text);
            modifySubParams.Email = txtModifySubEmail.Text;
            modifySubParams.NewEmail = txtModifySubNewEmail.Text;
            modifySubParams.Confirmed = chkModifySubConfirmed.Checked ? 1 : 0;
            modifySubParams.Status = txtModifySubStatus.Text;

            // Invoke method and store result
            CodeReturnValues modifysubReturn = api.ModifySubscriber(modifySubParams);

            // Display results
            lblResult.Text = FormatValue("Code", modifysubReturn.Code.ToString())
                + FormatValue("Response", modifysubReturn.Response);