Guidelines for Sending Messages
The following guidelines must be followed while using XML API for sending the messages.
Receiver Phone Number
- For national and international messaging, the mobile number should be prefixed with the appropriate country code e.g. 91 in case of an Indian number.
- No special character like "-", "(",")" or anything similar is allowed in the phone number, e.g., 91-9812345678 is disallowed.
Character Set Support
ValueFirst XML API support sending messages in GSM Character set, and for Unicode using Unicode16 Big-Ending and UTF-8 Format.
Message Length
If a message is sent whose length is longer than permitted characters limit, it shall be counted as multiple messages, however will be delivered on handset as a single message.
For standard Latin character set 160 characters per SMS is supported. If SMS text is longer than 160 characters, messages shall be calculated in multiples of 153 characters. For Unicode messaging (non-English) only 70 characters per SMS is supported. If Unicode SMS text is longer than 70 characters, messages shall be calculated in multiples of 67 characters. For Binary messaging 140 characters including UDH is supported. If Binary SMS is longer than 140 characters, messages shall be calculated in multiples of 134 characters.
Sender ID
As per DOT and TRAI guideline, all alpha sender IDs and short-code sender ID will be prefixed by operator and circle code. For sending SMS in India, alpha sender IDs of 6 characters only is allowed for transactional SMS and numeric sender ID of 6 digits is allowed for promotional SMS. This has been done to make NCPR (National Do Not Call) compliance easier. The details of operator/circle and corresponding prefixes are mentioned at the end of the document.
For international mobile numbers, alpha numeric sender ID up to 16 characters is allowed.
Encoding Procedure
ValueFirst Server accepts all content in XML. As your message is an XML packet, special characters in message text needs to be converted XML encoded. As a rule of thumb all string data should be XML encoded as shown below:
Note: This is only required if you are posting data through a client application. Web browsers can automatically convert the text to HTML encoded format. The encoding for sending message through ValueFirst Pace Server requires two steps.
Step 1
The following table displays the codes that have to be replaced.
Code | Replace with |
#39 (single quote) | |
#32 (space) | |
#34 (double quote) | |
> | |
< | |
#13 (Line feed) | |
#10(form feed) | |
#9(Tab) |
Step 2
ValueFirst Server accepts all data as a form post. Therefore, it is required that all XML content needs to be URL encoded before hitting ValueFirst Server
Rules for encoding XML content to URL format:
- Select for each character in messages.
- If the ASCII value of the character is greater than 128 or smaller than 32 or the character is „*‟, „#‟, „%‟, „<‟, „>‟ or „+‟, replace it with its corresponding hexadecimal (hereinafter Hex) value (2 digits with leading zero) proceeded by a „%‟ character, e.g., space is encoded into %20.
- * is encoded into %2A
- # is encoded into %23
- % is encoded into %25
- < is encoded into %3C
- > is encoded into %3E
- + is encoded into %2B
- enter key (#13#10) is encoded into %0D%0A
Reference Links For XML encoding
https://coderstoolbox.net/string/#!encoding=xml&action=encode&charset=iso_8859_1 For URL encoding
https://meyerweb.com/eric/tools/dencoder/