v3 SMS HTTP
Example WAP Push and Binary Messages (v3)
Note: If you're new to OpenMarket, then integrate with our Global SMS (version 4) operations.
Customers currently integrated using v3 may continue to use it, although we encourage customers to migrate to v4 in order to take advantage of new features. Please also note that there are no SDKs available for either version of the Global SMS API.
As well as text messages, you can send both WAP Push and binary messages.
WAP Push
The following examples show the XML sent and received during submission of a WAP Push message for delivery to a mobile device. OpenMarket responds with an error code and ticket ID, which your application can use to track the delivery status of the message. Not all carriers support WAP Push.
You must include the WAP Push user data header (UDH) at the start of the message data:
- Byte 1: Indicates the number of bytes used for the UDH in hexadecimal.
- Byte 2: The Element Type byte of the UDH should be set to hexadecimal 05 indicating 16-bit application port addressing.
- Byte 3: Indicates the number of bytes used for the remainder of the Element Type data.
- Byte 4-5: Destination Port - The most common value to use for the destination port bytes for WAP Push is hexadecimal 0b84.
- Bytes 6-7: Source Port - The most common value to use for the source port bytes for WAP Push is hexadecimal 23f0.
To send a WAP Push, your request must include:
- type — set this to "WAP_PUSH"
- url — The URL that you want as a hyperlink
- datacoding — Set to "8BIT"
- data — Use this to specify your message as binary data
- udh — Include if your message has a User Data Header
<request version="3.0" protocol="wmp" type="submit">
<user agent="Java/SMS/1.1.72"/>
<account id="987-543-876-00000" password="password here"/>
<option type="WAP_PUSH" url="http://www.example.com" datacoding="8BIT" charge_type="0" program_id="ABC"/>
<source ton="3" address="11234"/>
<destination carrier="383" ton="1" address="1209871234"/>
<message udhi="true" data="0605040b8423f0000603ae81ea02056a0045c6080c037777772e696e7465726f70746563686e6f6c6f67696573..."/>
</request>
Binary
Binary SMS messages enable you to send rich content rather than an SMS message. These are commonly used for "over the air" installation messages or other information to a specific port or application on the end user's mobile phone.
To send a binary message, your request must include:
- datacoding — Set to "8BIT"
- data — Use this to specify your binary data
- udh — Include if your message has a User Data Header
<?xml version="1.0" ?>
<request version="3.0" protocol="wmp" type="submit">
<user agent="XML/SMS/1.0.0" />
<account id="123-456-789-12345" password="password here" />
<source ton="3" address="12345" />
<destination ton="1" address="1334445555" />
<option datacoding="8BIT" program_id="ABC" />
<message udhi="false" data="01065e1f546170706c6963614d2f" />
</request>