Auto reply from nowsms to the sender of sms

Auto reply from nowsms to the sender of sms SearchSearch
Author Message
naveen kumar
New member
Username: Alice77

Post Number: 2
Registered: 11-2003
Posted on Friday, November 28, 2003 - 08:25 am:   

i have an midlet which sends an sms to nowsms which inturn invokes a jsp. i want to send the output of this jsp as a sms back to the sender through nowsms how can i do it programatically.


Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1262
Registered: 10-2002
Posted on Sunday, November 30, 2003 - 02:01 am:   

There are three different approaches for how to do this.

1.) If the midlet will always return a response, and the response will always be a text message, then when you define your JSP URL in the "2-way" command table, check the "Command returns response text" field. It is then expected that your JSP will return an HTTP response with the MIME content type set as "text/plain", and the response being the message that you want to reply back with.

2.) Assuming that "Command returns response text" is not checked, your script can issue a new HTTP request to the NowSMS server, telling NowSMS to send a message. In this instance, your script makes a new HTTP connection to the NowSMS server, and issues an HTTP request with the URL parameters set to send the message that you want to send.

3.) As an alternative to approach #2, instead of making a new HTTP connection from your script, you can instead return a redirect response back from your script. The redirect response sends a new HTTP command back to NowSMS which has the parameters set to send the message that you want to send. This approach is described in the following document:

http://www.nowsms.com/support/bulletins/tb-nowsms-003.htm