Messaging.subscribeRequest to subscribe a user by phone# to one of your TextMarks. User gets "Rply Y to subscribe..." SMS to confirm. OverviewRequests to subscribe a user by phone# to one of your TextMarks. If the user is already subscribed, nothing happens. Otherwise an SMS is sent to the user's phone prompting them to "Reply Y to subscribe to KEYWORD...". Once they confirm by replying Y (by text), they will be subscribed to your TextMark, and you will be able to broadcast alerts and send texts to them. See Sending Text Messages for more information on subscribers and other ways for users to subscribe. Parameters
ResponseResult code (TMResponse.TMHead.ResCode) of 0 indicates success. Errors (non-zero result) will be described in TMResponse.TMHead.ResMsg. Subscription CallbacksTo determine if a user actually subscribes (since they may not reply Y or the phone# may not even be valid), you may take advantage of your TextMark's Subscription Callback. See Developer Extension for more information. Additional Info / TroubleshootingIf a user has recently (within 24hr) received a "Rply Y to subscribe" type message from your TextMark as a result of this API call or (or widget), and that user has not yet replied Y, then the Messaging.subscribe API call will return success, but NO ADDITIONAL MESSAGE will be sent to the user. This may appear to make developing and troubleshooting more difficult, but it is an important safeguard to prevent abuse and mobile SPAM. TextMarks remains dedicated to providing a powerful and safe platform for users and developers. To get around this during development, you may use additional phone#s for testing, or simply reset the pending subscription request on a specific phone# by making a Messaging.subscribe call with an alternate keyword or by typing your phone# into a subscription widget for another keyword. ExamplesExample 1: HTTP Request (whitespace added for clarity):
http://dev1.api.textmarks.com/Messaging/subscribe/?
&apik=MyAPIKey_12345 &auth_user=mytmuser &auth_pass=mytmpass &tm=MYKEYWORD &phone=4155551212 Example 1: XML Response: <?xml version="1.0" ?> <TMResponse v="1.0"> <TMHead> <APIVersion>2.41a-BETA</APIVersion> <ResCode>0</ResCode> <ResMsg>Success</ResMsg> <APIKey>MyAPIKey_12345</APIKey> <RefNum>R1001-8904321863</RefNum> </TMHead> <TMBody> <SubscriptionPending key="123456" keyword="MYKEYWORD"> <TextMark>MYKEYWORD</TextMark> <Phone>+14155551212</Phone> </SubscriptionPending> </TMBody> </TMResponse> |