(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.data-privacy-src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-TT9ZP96');

Knowledge Base

Unsubscribe API

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 Parameters

TermMandatory/OptionalDescription
ACTIONMandatoryThis is the name of the function you want to execute with the API.
API_KEYMandatoryThe API key that is assigned to your account that is used for authentication. You can find this key on the API Settings page.
CAMPAIGNREFMandatory This is the identifier of the Campaign you would like to unsubscribe the number to. You generated the campaignRef when you created the Campaign.
MOBILEMandatoryA Phone Number to unsubscribe to a campaign.
NotifyOptional A mobile owner will be notified about being unsubscribed via a confirmation SMS (yes/no).

Response Parameters

Param NamePresenceDescription
STATUSAlways“Success” or “Failure”.
CAMPAIGNREFSuccess Response OnlyThis is the identifier of the Campaign you would like to unsubscribe the number to. You generated the campaignRef when you created the Campaign.
MOBILESuccess Response Only A Phone Number to unsubscribe to a campaign.
ERRORCODEError response onlyError code associated with the error.
ERRORINFOError response onlyError message explaining the error code.

Request Example: XML

<REQUEST>
    <ACTION>unsubscribe</ACTION>
    <API_KEY>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</API_KEY>
    <CAMPAIGNREF>1116</CAMPAIGNREF>
    <MOBILE>11111111111</MOBILE>
    <NOTIFY>no</NOTIFY>
</REQUEST>

Response Example: Success

<RESPONSE>
    <STATUS>Success</STATUS>
    <CAMPAIGNREF>1116</CAMPAIGNREF>
    <MOBILE>11111111111</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.
E905Could not unsubscribe this number.
Go to Top