Jump to content

CampaignBounces()

Returns a list of subscribers who have bounced for the provided campaign

Parameters

ApiKey (Required)
    Your application authentication key. Click here to find out more.
CampaignReportID (Required)
    The ID number of the sent email campaign, as seen in the Reports tab.  Note: in API version 1, this parameter was named EmailID.  Click here to find out more.

Return Value

On success, this method returns two values:

  • Hard Bounces - the number of bounces caused by a "hard" failure, such as a non-existent e-mail address
  • Soft Bounces - the number of bounces caused by a "soft" failure, such as a full mailbox

On failure, a SOAP fault exception is thrown with one of the fault codes below.

Usage Notes

Note that CampaignReportID values are not the same as CampaignID values. CampaignReportIDs are retrieved from the Reports tab, as explained here.

Fault Codes

200 - Invalid CampaignReportID
    The Associated Campaign Report is not valid

100 - Invalid API Key
    The API key is not valid or expired

SOAP Sample Request


    
    
        
            
                STRING
                INT
            
        
    

SOAP Sample Response


    
    
        
            
                INT
                INT
            
        
    

Code Sample - PHP

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

$eConnectEmailApi = TheKeyMakerClient('YOUR_API_KEY');

$result = $eConnectEmailApi->CampaignBounces(CAMPAIGN_REPORT_ID);

// 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
            CampaignParams campaignParams = new CampaignParams();
            campaignParams.ApiKey = txtApiKey.Text;
            campaignParams.CampaignReportID = int.Parse(txtCBCampaignReportID.Text);

            // Invoke method and store result
            CampaignBouncesReturn campaignBounces = api.CampaignBounces(campaignParams);

            // Display results
            lblResult.Text = FormatValue("Hard Bounces", campaignBounces.HardBounces.ToString())
                + FormatValue("Soft Bounces", campaignBounces.SoftBounces.ToString());