SMS API for webdevelopers (HTTP Server)

Ozeki Message Server 6 has a built in HTTP server. This means, that simply using HTTP client requests you can send / receive SMS messages and you can control the SMS server. This guide explains the basic HTTP interface elements.

I. How to check the number of credits

Note:

  • The number of credits determine how many SMS messages can be sent by the user. If this number is -1 it means unlimited.
  • The action parameter specifies the command you are executing. In this case the command is getCredits
  • The ozmsUserInfo parameter specifies the user. You can put the user information in plain text, or you can use the md5 checksum of the password, which would give you a little more protection.

II. How to send an SMS message

HTTP Request:


http://127.0.0.1:9333/ozeki?action=sendMessage&
ozmsUserInfo=admin:abc123&recepient=06203105366& messageData=hello+world"> http://127.0.0.1:9333/ozeki?action=sendMessage&ozmsUserInfo
=admin:abc123&recepient=06203105366& messageData=hello+world

HTTP Response:

<Response>
<Action>sendMessage</Action>
<Data>[ACCEPTREPORT]</Data>
</Response>

ACCEPTREPORT:
<AcceptReport>
<StatusCode>0</StatusCode>
<StatusText></StatusText>
<MessageID>1737016</MessageID>
</AcceptReport>

Note:

  • When you send a message you must specify the recepient and the messageData fields. The values must be urlencoded.
  • The action parameter specifies the command you are executing. In this case the command is sendMessage
  • The ozmsUserInfo parameter specifies the user information.
  • If the message is accepted for delivery you receive an AcceptReport containing a StatusCode of zero (0) and a message id string
  • If the message is not accepted for delivery the StatusCode is greater than zero and the StatusText contains the error message
  • If this user name and password is invalid, the server returns an HTML page containing a login prompt.

More information