TextMarks wants to hear from you
You'll find many helpful knowledge base articles here. If you need assistance, please:
- email us at email@example.com
- call us at (800) 696-1393
Recipe: Request / Response with Long Processing or Multiple Responses
This page describes a more advanced way to leverage TextMarks request/response callbacks and API to overcome some of the limitations of a more basic integration. Please review Request / Response Interaction Overview and try to get that working before taking on this more challenging integration.
Limitations of Basic Request / Response
With TextMarks basic request / response interaction, your callback script must execute and respond within 10 seconds or TextMarks will time out and send an error message back to the user. This limitation is in place because of the shared nature of our short code and resources and is designed to maintain instant responsiveness for all customers.
Another limitation of the basic type of request / response interaction is that your response is limited to a single text message.
Both of these limitations may be addressed with a more complicated integration, which is described here.
When a user texts in and your callback is invoked, instead of trying to process the request in the context of the callback script, simply record the request into your database or queue and respond with an empty document. TextMarks will be satisfied that the callback was handled, and the user will receive no response (yet).
With a background daemon running, you can process all entries in
your queue as you wish. Take as long as you want. When you have a
response message, send it to the user using our API call:
If you wish to send multiple responses to the user, simply call
send_one_message multiple times.
In order to invoke
send_one_message, the recipient
must be subscribed to your keyword. There are many ways to
subscribe users, the easiest of which is to simply mark your
keyword as subscribable (the default) in the admin interface.