Subscriber.Add
Use this method to easily add a subscriber to an existing list.
Arguments
The parameters you need to pass in are:
ApiKey(Required)- Your API application key. See here for more details.
ListID(Required)- The list you want to add the subscriber to. See here for more details.
Email(Required)- The email address of the new subscriber.
Name(Required)- The name of the new subscriber. If the name is unknown, an empty string can be passed in.
SOAP
The following is a sample SOAP request to add a subscriber. The placeholders shown need to be replaced with actual values.
POST http://yoursitename.createsend.com/api/api.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://api.createsend.com/api/Subscriber.Add"
<?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>
<Subscriber.Add xmlns="http://api.createsend.com/api/">
<ApiKey>string</ApiKey>
<ListID>string</ListID>
<Email>string</Email>
<Name>string</Name>
</Subscriber.Add>
</soap:Body>
</soap:Envelope>
Here is the response you will receive.
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
<?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>
<Subscriber.AddResponse xmlns="http://api.createsend.com/api/">
<Subscriber.AddResult>
<Code>int</Code>
<Message>string</Message>
</Subscriber.AddResult>
</Subscriber.AddResponse>
</soap:Body>
</soap:Envelope>
Error Codes
1: Invalid email address- The email value passed in was an invalid email address.
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.