Messaging.sendTextSend a text message to an individual subscriber. OverviewSend a single text message to a subscriber of one of your TextMarks. See Sending Text Messages for more information on subscribers. Also places TextMark in recipients' context to allow short contextual responses. Parameters
ResponseResult code (TMResponse.TMHead.ResCode) of 0 indicates success. Errors (non-zero result) will be described in TMResponse.TMHead.ResMsg. SubscribersThe addressed user (to) must be a subscriber of your TextMark (tm). See Sending Text Messages for more information on subscribers. If you attempt to address a message to a user who is not an active subscriber of your TextMark, you will get an error indicating so. You should remove the user from your database (as they most likely recently unsubscribed). Note that you may keep track of subscriptions and unsubscriptions automatically using a Sub/Unsub Callback. Asking Users QuestionsSending a message to a user puts your TextMark in that user's context. Short contextual responses (e.g. 1, 2, B, CA, etc.) will be automatically directed to your keyword. You may therefore ask users questions via alerts and receive answers in your TextMark processing script. Recommended language to ask for response is: "Rply 1 to (option1), 2 to (option2), ..." See Receiving Text Messages for details. ExamplesExample 1: HTTP Request (whitespace added for clarity):
http://dev1.api.textmarks.com/Messaging/sendText/?
&apik=MyAPIKey_12345 &auth_user=mytmuser &auth_pass=mytmpass &tm=MYKEYWORD &msg=This+is+a+test+message &to=4155551212 Example 1: XML Response: <?xml version="1.0" ?> <TMResponse v="1.0"> <TMHead> <APIVersion>2.42a-BETA</APIVersion> <ResCode>0</ResCode> <ResMsg>Success</ResMsg> <APIKey>MyAPIKey_12345</APIKey> <RefNum>R1001-8904321863</RefNum> </TMHead> <TMBody> <TextSent key="123456" keyword="MYKEYWORD"> <TextMark>MYKEYWORD</TextMark> <Phone>+14155551212</Phone> </TextSent> </TMBody> </TMResponse> |