subscribeEmail

Synopsis:

‘subscribeEmail’ API will subscribe the email address to a particular campaign. Email address is referenced by ‘EMAIL’ and the campaign is referenced by ‘CAMPAIGNID’ in the API request. After the email address is subscribed to a campaign they will receive all auto responders and scheduled messages for that campaign until they are unsubscribed through the ‘unsubscribeEmail’ API or UI.

Request: XML

<REQUEST>
    <ACTION>subscribeEmail</ACTION>
    <API_KEY>apiKey</API_KEY>
    <EMAIL>Email address to subscribe</EMAIL>
    <CAMPAIGNID>Campaign ID</CAMPAIGNID>
    <DATA>
        <FIRST_NAME>First Name</FIRST_NAME>
        <LAST_NAME>Last Name</LAST_NAME>
        <GENDER>Gender</GENDER>
        ...
    </DATA>   
    <NOTIFY>'yes/no' on whether to notify user on successful opt in</NOTIFY>
</REQUEST>

Request: GET

API_URL?action=subscribeemail
&api_key=API key
&email=email address to subscribe
&campaignid=campaign ID
&data_first_name=first name
&data_last_name=last name
&data_gender=gender
&notify='yes/no' on whether to notify user on successful opt in

Request Parameters:

Mandatory: action, api_key, campaignId, email
Optional: data, notify

Response Parameters:

status, campaignId, email, errorCode, errorInfo

Request Example: XML

<REQUEST>
    <ACTION>subscribeEmail</ACTION>
    <API_KEY>qTFkykO9JTfahCOqJ0V2Wf5Cg1t8iWlZ</API_KEY>
    <EMAIL>john@email.com</EMAIL>
    <CAMPAIGNID>1116</CAMPAIGNID>
    <DATA>
        <FIRST_NAME>John</FIRST_NAME>
        <LAST_NAME>Smith</LAST_NAME>
        <AGE>30</AGE>
        <PET>Dog</PET>
    </DATA>   
    <NOTIFY>yes</NOTIFY>
</REQUEST>

Request Example: GET

https://secure.skycore.com/API/wxml/1.3/index.php?action=subscribeemail
&api_key=qTFkykO9JTfahCOqJ0V2Wf5Cg1t8iWlZ
&email=john@email.com
&campaignid=1116
&data_first_name=John
&data_last_name=Smith
&data_age=30
&data_pet=Dog
&notify=yes

Response Example: Success

<RESPONSE>
    <STATUS>Success</STATUS>
    <CAMPAIGNID>1116</CAMPAIGNID>
    <EMAIL>john@email.com</EMAIL>
</RESPONSE>

Response Example: Failure

<RESPONSE>
    <STATUS>Failure</STATUS>
    <ERRORCODE>E912</ERRORCODE>
    <ERRORINFO>Invalid CAMPAIGNID</ERRORINFO>
</RESPONSE>

Postback Notification:

Upon subscribing an email the system will generate a notification. For more details please visit the Email Subscribe section of the Email Opt-in Status Postback documentation.


General Error Codes:

Code Description
E100 Invalid request. Make a valid request via GET/POST/XML with all the required variables.
E104 User Authentication Failed.
E105 This account has no API rights.
E106 You can call API every X seconds.
E107 This account has no rights to use this action.
E108 XML Parse error: $error.
E109 API not activated.
E112 IP was not whitelisted. API call rejected.
E113 Set throughput exceeded for this API action. API call rejected.
E114 Phone number is blacklisted. API call rejected.
E120 Account has reached the API request limit.
E503 Internal error.


Code Description
E911 The ‘email’ is required.
E912 Invalid ‘campaignid’.
E913 Could not subscribe this ‘email’.


Key Term Definitions:

Term Description
ACTION This is the name of the function you want to execute with the API.
API_KEY Random key that is assigned to an account that can be used for authorization instead of USER/PASS. You can find and regenerate this key on the ‘API Settings’ page.
CAMPAIGNID The ID(integer) of the campaign to which the user will be subscribed.
EMAIL A valid email address.
NOTIFY An email owner will be notified about being subscribed via a confirmation email (yes/no).