Unsubscribe API

Table of Contents

unsubscribe

Synopsis:

This API will unsubscribe users to a particular campaign. Once a user is subscribed to a campaign they will receive all auto responders and scheduled messages for that campaign until they are unsubscribed through the API or through normal STOP or STOP ALL SMS request. You may not import someone who has unsubscribed themselves from a campaign however may re-subscribe someone who has unsubscribed through the Subscribe API.

Request: XML

<REQUEST>
    <ACTION>unsubscribe</ACTION>
    <API_KEY>apiKey</API_KEY>
    <CAMPAIGNREF>Campaign Reference ID</CAMPAIGNREF>
    <MOBILE>Number to unsubscribe</MOBILE>
    <NOTIFY>'yes/no' on whether to notify user on opt-out</NOTIFY>
</REQUEST>

Request: GET

API_URL?action=unsubscribe
&api_key=API key
&campaignref=campaign reference ID
&mobile=number to unsubscribe
&notify='yes/no' on whether to notify user on opt-out

Request Parameters:

Mandatory: action, api_key, campaignRef, mobile
Optional: notify

Response Parameters:

status, campaignRef, mobile, errorCode, errorInfo

Request Example: XML

<REQUEST>
    <ACTION>unsubscribe</ACTION>
    <API_KEY>qTFkykO9JTfahCOqJ0V2Wf5Cg1t8iWlZ</API_KEY>
    <CAMPAIGNREF>1116</CAMPAIGNREF>
    <MOBILE>16502426055</MOBILE>
    <NOTIFY>no</NOTIFY>
</REQUEST>

Request Example: GET

https://secure.skycore.com/API/wxml/1.3/index.php?action=unsubscribe
&api_key=qTFkykO9JTfahCOqJ0V2Wf5Cg1t8iWlZ
&campaignref=1116
&mobile=16502426055
&notify=no

Response Example: Success

<RESPONSE>
    <STATUS>Success</STATUS>
    <CAMPAIGNREF>1116</CAMPAIGNREF>
    <MOBILE>16502426055</MOBILE>
</RESPONSE>

Response Example: Failure

<RESPONSE>
    <STATUS>Failure</STATUS>
    <ERRORCODE>E721</ERRORCODE>
    <ERRORINFO>Invalid campaignref</ERRORINFO>
</RESPONSE>

Postback Notification:

Upon unsubscribing a number the system will generate a notification. For more details please visit the Mobile Unsubscribe section of the Opt-in Status Postback documentation.

General Error Codes:

CodeDescription
E100Invalid request. Make a valid request via GET/POST/XML with all the required variables.
E104User Authentication Failed.
E105This account has no API rights.
E106You can call API every X seconds.
E107This account has no rights to use this action.
E108XML Parse error: $error.
E109API not activated.
E112IP was not whitelisted. API call rejected.
E113Set throughput exceeded for this API action. API call rejected.
E114Phone number is blacklisted. API call rejected.
E120Account has reached the API request limit.
E503Internal error.
CodeDescription
E718The ‘campaignref’ is required
E721Invalid campaignref
E901The ‘mobile’ is required.
E902The ‘campaignid’ is required.
E903Invalid ‘campaignid’.
E905Could not unsubscribe this number.

Key Term Definitions:

TermDescription
ACTIONThis is the name of the function you want to execute with the API.
API_KEYRandom 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.
CAMPAIGNIDThe ID(integer) of the campaign to which the user will be subscribed.
CAMPAIGNREFDepending on your API settings, you may be required to subscribe users into a campaign first before sending them messages. If you are required to subscribe a user first, then a valid Campaign Reference is required. This would be the campaign reference ID (string) to which the user is subscribed.
MOBILEA Phone Number used inside the ‘subscribe’/’unsubscribe’ function.
NOTIFYA mobile owner will be notified about being subscribed/unsubscribed via a confirmation SMS (yes/no).