Create a free account

API Documentation

Campaign Monitor

Subscribers.GetIsSubscribed

Returns True or False as to the existence of the given email address in the list supplied.

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 Subscriber.Unsubscribe method. All of the parameters are required unless otherwise noted.

ApiKey
Your API application key. See here for more details.
ListID
The list you want to check for the subscriber in. See here for more details.
Email
The email address the subscriber you are looking for.

Return Codes

Success

Upon a successful call, this call will reutrn a string value of either True or False.

Error

100: Invalid API Key
The API key passed was not valid or has expired.
101: Invalid ListID
The ListID 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/Subscribers.GetIsSubscribed"

<?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>
    <Subscribers.GetIsSubscribed xmlns="http://app.campaignmonitor.com/api/">
      <ApiKey>string</ApiKey>
      <ListID>int</ListID>
      <Email>string</Email>
    </Subscribers.GetIsSubscribed>
  </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>
    <Subscribers.GetIsSubscribedResponse xmlns="http://app.campaignmonitor.com/api/">
      <Subscribers.GetIsSubscribedResult>string</Subscribers.GetIsSubscribedResult>
    </Subscribers.GetIsSubscribedResponse>
  </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/Subscribers.GetIsSubscribed?ApiKey=string&ListID=string&Email=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"?>
<string xmlns="http://app.campaignmonitor.com/api/">string</string>

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/Subscribers.GetIsSubscribed HTTP/1.1
Host: app.campaignmonitor.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

ApiKey=string&ListID=string&Email=string

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

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

Error Codes

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