Jump to content

DeleteSubscriber()

Permanently delete a subscriber, and all associated activity data, from a list. To unsubscribe a user from a list, use the Unsubscribe method; this will leave them and their history in the system, but change their status so they no longer receive e-mail.

Parameters

ApiKey (Required)
    Your application authentication key. Click here to find out more.
ListID (Required)
    The ID number of the list to which the subscriber should be added. Click here to find out more.
Email (Required)
    The email address of the subscriber you would like to permanently delete.

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
20 - Invalid ListID
    The ListID provided does not correspond to a known list
100 - Invalid API Key
    The API key is not valid or has expired

SOAP Sample Request


    
    
        
            
                STRING
                INT
                STRING
            
        
    

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');

$result = $eConnectEmailApi->DeleteSubscriber(LIST_ID, 'EMAIL_ADDRESS');

// 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
            EmailParams emailParams = new EmailParams();
            emailParams.ApiKey = txtApiKey.Text;
            emailParams.ListID = int.Parse(txtDeleteSubListID.Text);
            emailParams.Email = txtDeleteSubEmail.Text;

            // Invoke method and store result
            CodeReturnValues deleteSubReturn = api.DeleteSubscriber(emailParams);

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