SMS Post

From MobileHacking.org

Jump to: navigation, search

This page is a work-in-progress, capturing the SPOMC (SMS Open Mobile Blah Blah Protocol) as it is implemented. The protocol is built upon HTTP, and exposes a basic set of functionality for clients to send and receive SMS messages.

Servers may optionally implement access-control (via Basic Authentication) and/or encrypted (via HTTPS), for secure communication with client applications over the internet, but we expect most client/server communication to be via localhost.

Current Version: SPOMC/0.91

Contents

Sending

Path

/send

Required Fields

body: (type=text, eg="Hello World")
destination: (type=intl_phone_number, eg="1347000111")
version: (type=version, eg="SPOMC/0.91")

Optional Fields

uuid: (type=uuid, eg="6ba7b810-9dad-11d1-80b4-00c04fd430c8")
receipt: (type=bool, eg="yes")

This returns standard http responses:

200 for success
403 for forbidden 
500 for fail

Polling

/poll

If the GSM server does not have incoming connectivity, it can issue an empty HTTP POST request to /send/poll, which the client/webserver can respond a with a response in the same format as above. If more than one messages are waiting to be sent, the oldest is returned.

Receiving

to receive a SMS, you do a http post to

/receive/poll

Care should be taken by the library author to not destory the message until it has been received by the client.

Required

version:
source: using standard uri
timestamp: uses http timestamp
uuid:
type:(n) receipt,error

Receipts

to deal with receipts

/receive/poll/status

Required

version:
source: using standard uri
timestamp: uses http timestamp
uuid:
body: more info (ft)

Subscription

Path

/receive/subscribe

Required Fields

uri: (type=uri, eg="http://sms.whatever.org:6000/receiver")

Instructs the SMS server to send an HTTP POST request to uri each time an SMS is received. The POST data arrives in the format:

version: (type=version, eg="SPOMC/0.91")
source: (type=intl_phone_number, eg="1347000111")
timestamp: (type=http-timestamp, eg="01/01/2009 09:30:00")
body: (type=text, eg="Hello World)
uuid: ????

Response 200: If the subscription is accepted, a UUID is returned in plain text, which must be stored by the client application until it wishes to unsubscribe.

Unsubscribe

Path

/receive/unsubscribe

Required Fields

uuid: (type=uuid, eg=6ba7b810-9dad-11d1-80b4-00c04fd430c8)

Instructs the SMS server to stop notifying the URI linked to uuid (as returned by the /subscribe request) when an SMS is received.

Responses 200: The UUID+URI was unsubscribed. 404: The UUID was not subscribed.

Personal tools