|
SMSServer_HTTPServer_Interface
SMSServer HTTP Server Interface
SMSServer - HTTPServer InterfaceIntroductionThis interface enables SMSServer to act as a mini web server, accepting HTTP requests as remote commands. SMSServer uses the Jetty web server as its embedded server. The following operations are currently supported:
The HTTPServer interface implements a REST-like calling scheme, where each supported call gets a number of parameters and response with an XML document. The functionality of each call is described below. InstallationStarting from v3.4, the HTTPServer Interface class file has been pulled out of the main source directory. In order to install and use it, please do the following:
FunctionalitySMSServer StatusDisplays the status of the SMSServer application. This method returns an HTML document and is meant to be called from a web browser. To see the status, point your browser to: http://smsserver-ip:port, where
For example: http://192.168.10.15:8080 You will get a simple web page where you can see:
Send a messageYou can request SMSServer to send a specific message. The message details are given using parameters to the base URL. The minimum parameters are recipient and text. URL: http://smsserver-ip/send Parameters
Examples: http://smsserver/send?password=1111&recipient=3012341234&text=Hello World! http://smsserver/send?password=1111&recipient=3012341234&text=Hello World!&gateway=mySpecificGateway http://smsserver/send?password=1111&recipient=3012341234&text=Hello World!&priority=-100 Read messagesYou can request SMSServer to read and return to you the messages received from its gateways. What you do is that you call a specific URL and you get an XML document with all messages read. By default (i.e. if no parameters are given) SMSServer will read messages from all the gateways. You can customize the message query by using one or more of the supported parameters. URL: http://smsserver-ip/read Parameters
Returns an XML structure like the following, which contains all messages read: <?xml version='1.0' encoding='UTF-8'?> <messages> <message> <message_type>Inbound</message_type> <message_date>2008-09-15T20:23:05+03:00</message_date> <originator>306974xxxx</originator> <text>Test</text> <encoding>ENC7BIT</encoding> <gateway>modem1</gateway> </message> ... </messages> Examples: http://smsserver/read?password=0000 http://smsserver/read?password=0000&gateway=myModem Configuration FileThis interface requires the following configuration settings:
Example: interface.0=httpServer, HttpServer httpServer.port=8080 httpServer.password.read=0000 httpServer.password.send=1111 |
Sign in to add a comment