HTTP API specifications

Navigation:  Reference > Connector properties > Web connector >

HTTP API specifications

Previous pageReturn to chapter overviewNext page

HTTP commands


HTTP commands can be sent with both GET or POST methods. In this manual the GET method is used for all examples.

 

send-message

Send one or more messages.

 

parameters

username

optional

The name of the user, if omitted the guest account is used

password

optional

The password of the user

to

required

One or more phone/pager numbers, separated by semicolons

contact-name

required

One or more contact names and/or groups from the user's contact list, separated by semicolons

from

optional

Sender id

message

optional

Message text

message-type

optional

Message type to indicate if the message is text, Unicode, flash etc.

gateway

optional

One or more gateway names, separated by semicolons, that may be used to send the message

 

returns

OK: message-id

or

ERROR:error-code error-message

 

If multiple messages are sent this command returns one response line per message in the order at which the numbers are located in the to field.

 

The to field or contact-name field is required, if both are present only the to field is used.

 

example

http://localhost:9710/http/send-message?username=admin&password=&to=%2B44xxxxxxxx&message-type=sms.automatic&message=Message+Text

 

request-status-update

Get the status of a previously sent message.

 

parameters

username

optional

The name of the user, if omitted the guest account is used

password

optional

The password of the user

message-id

mandatory

Message id of the previously sent message

 

returns

STATUS:status-code status-message

or

ERROR:error-code error-message

 

example

http://localhost:9710/http/request-status-update?username=admin&password=&message-id=c3b0c20a-b63e-4bbf-919f-3d4251a8b9c0

 

request-server-status

Get the status of the Diafaan SMS Server and all the Gateways and Connectors statistics.

 

parameters

username

optional

The name of the user, if omitted the guest account is used

password

optional

The password of the user

 

returns

An XML file with the status and statistics of Diafaan SMS Server.

or

ERROR:error-code error-message

 

example

http://localhost:9710/http/request-server-status?username=admin&password=

 

request-received-messages

Get a list of received messages in the inbox.

 

parameters

username

optional

The name of the user, if omitted the guest account is used

password

optional

The password of the user

limit

optional

The maximum number of messages returned

remove

optional

Set to "1" to remove the returned messages from the database

order

optional

Set to "newest" to get newest messages first, otherwise oldest messages are displayed first.

 

returns

An XML file with a list of the requested messages.

or

ERROR:error-code error-message

 

example

http://localhost:9710/http/request-received-messages?username=admin&password=&limit=10&order=newest

 

<?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>