Create a free account

API Documentation

Campaign Monitor

Campaign.GetBounces

Gets a list of all subscribers who bounced for a given campaign, and the type of bounce (H=Hard Bounce, S=Soft Bounce).

Samples

While we don't have any samples for this particular method, we do have a number of samples in .NET, PHP, Classic ASP, Flash, Perl and Cold Fusion that can be easily adapted to use this method.

Parameters and required information

Here's a list of all the parameters you'll need to pass to the Campaign.GetBounces method. All of the parameters are required unless otherwise noted.

ApiKey
Your API application key. See here for more details.
CampaignID
The ID of the campaign that you want the data for. You can get the ID via the Client.GetCampaigns method.

Return Codes

Success

Upon a successful call, this method will return a collection of SubscriberBounce objects, each of which consists of the subscribers email address, the list they belong to, and the type of bounce they experienced, whether hard or soft.

Error

100: Invalid API Key
The API key passed was not valid or has expired.
301: Invalid CampaignID
The CampaignID value passed in was not valid.

SOAP 1.1

The following is a sample SOAP request and response. The placeholders shown need to be replaced with actual values.

POST /api/api.asmx HTTP/1.1
Host: app.campaignmonitor.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://app.campaignmonitor.com/api/Campaign.GetBounces"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Campaign.GetBounces xmlns="http://app.campaignmonitor.com/api/">
      <ApiKey>string</ApiKey>

      <CampaignID>int</CampaignID>
    </Campaign.GetBounces>
  </soap:Body>
</soap:Envelope>

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Campaign.GetBouncesResponse xmlns="http://app.campaignmonitor.com/api/">

      <Campaign.GetBouncesResult>
        <SubscriberBounce>
          <EmailAddress>string</EmailAddress>
          <ListID>int</ListID>
          <BounceType>string</BounceType>

        </SubscriberBounce>
        <SubscriberBounce>
          <EmailAddress>string</EmailAddress>
          <ListID>int</ListID>
          <BounceType>string</BounceType>

        </SubscriberBounce>
      </Campaign.GetBouncesResult>
    </Campaign.GetBouncesResponse>
  </soap:Body>
</soap:Envelope>

HTTP GET

The following is a sample HTTP GET request and response. The placeholders shown need to be replaced with actual values.

GET /api/api.asmx/Campaign.GetBounces?ApiKey=string&CampaignID=string HTTP/1.1
Host: app.campaignmonitor.com


HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfSubscriberBounce xmlns="http://app.campaignmonitor.com/api/">

  <SubscriberBounce>
    <EmailAddress>string</EmailAddress>
    <ListID>int</ListID>
    <BounceType>string</BounceType>

  </SubscriberBounce>
  <SubscriberBounce>
    <EmailAddress>string</EmailAddress>
    <ListID>int</ListID>
    <BounceType>string</BounceType>

  </SubscriberBounce>
</ArrayOfSubscriberBounce>

HTTP POST

The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.

POST /api/api.asmx/Campaign.GetBounces HTTP/1.1
Host: app.campaignmonitor.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

ApiKey=string&CampaignID=string

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfSubscriberBounce xmlns="http://app.campaignmonitor.com/api/">
  <SubscriberBounce>
    <EmailAddress>string</EmailAddress>

    <ListID>int</ListID>
    <BounceType>string</BounceType>
  </SubscriberBounce>
  <SubscriberBounce>
    <EmailAddress>string</EmailAddress>

    <ListID>int</ListID>
    <BounceType>string</BounceType>
  </SubscriberBounce>
</ArrayOfSubscriberBounce>

HTTP GET

100: Invalid API Key
The API key passed was not valid or has expired.
301: Invalid CampaignID
The CampaignID value passed in was not valid.