Unsubscribe API

Table of Contents



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

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

Request: GET

&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 Example: GET


Response Example: Success


Response Example: Failure

    <ERRORINFO>Invalid campaignref</ERRORINFO>

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:

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.
E718The ‘campaignref’ is required
E721Invalid campaignref
E901The ‘mobile’ is required.
E902The ‘campaignid’ is required.
E903Invalid ‘campaignid’.
E905Could not unsubscribe this number.

Key Term Definitions:

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).