Web Service SMS Gateway
The built-in HTTP web service in Diafaan SMS Server makes it easy to add two-way SMS or pager text messaging to your application.
Just add a Web Connector to Diafaan SMS Server and start sending HTTP requests from your program or from a generic web browser.
Send a message
The most important HTTP command is to send a message to a mobile phone or pager:
http://localhost:9710/http/send-message?to=%2B4400000000&message-type=sms.automatic&message=Message+Text returns OK: message-id or ERROR:error-code error-message
Request the message status
After sending the message you can check if the message was accepted, rejected or delivered to the handset:
http://localhost:9710/http/request-status-update?message-id=c3b0c20a-b63e-4bbf-919f-3d4251a8b9c0 returns STATUS:status-code status-message or ERROR:error-code error-message
Get the received messages
With the HTTP API you can also get a list of all received messages:
http://localhost:9710/http/request-received-messages?username=admin&password=&limit=10&order=newest
returns:
<?xml version='1.0' encoding='UTF-8'?> <MessageList Count="2"> <Message> <From>+44xxxxxx</From> <To /> <MessageText>Message text 1</MessageText> <MessageType>sms.text</MessageType> <MessageId>ae97a8b7-5336-445a-ae67-e658aa8f6aed</MessageId> <MessagePart>-1</MessagePart> <ReceivedMessageParts>1</ReceivedMessageParts> <TotalMessageParts>1</TotalMessageParts> <SendTime>20100219200855</SendTime> <ReceiveTime>20100219200848</ReceiveTime> <Gateway>GSM Modem Gateway</Gateway> <SMSC>+44xxxxxxxxx</SMSC> <PDU>079458560488019539B53F50000012091028055400DD47719649987CD25D87506</PDU> <IsRemoved>0</IsRemoved> </Message> <Message> <From>+33xxxxxxxx</From> <To /> <MessageText>Message text 2</MessageText> <MessageType>sms.text</MessageType> <MessageId>ae97a8b7-5336-445a-ae67-e658aa8f6aed</MessageId> <MessagePart>-1</MessagePart> <ReceivedMessageParts>1</ReceivedMessageParts> <TotalMessageParts>1</TotalMessageParts> <SendTime>20100219200855</SendTime> <ReceiveTime>20100219200848</ReceiveTime> <Gateway>GSM Modem Gateway</Gateway> <SMSC>+33xxxxxxxxx</SMSC> <PDU>07474523460488019539B53F50000012091028055400DD47719649987CD25D87506</PDU> <IsRemoved>0</IsRemoved> </Message> </MessageList>