• http://www.gongmsgn.com/wp-content/uploads/2012/12/services_banner.jpg

    Blog

http://www.gongmsgn.com/wp-content/themes/flare/images/shadow-1.png

Encode SMS Messages Using GONG Textual Or Binary API Methods

Even though a large portion of professional SMS messaging uses the basic GSM alphabet (which supports all Latin characters, digits and a few special characters), some apps, companies and brands prefer to use their own alphabets when communicating with their audiences over SMS.

What happens if you send an SMS message in Cyrillic, Greek, Arabic, Hebrew or other alphabets with specific characters, without having the Unicode encoding? Recipients will get a message they won’t be able to read because their phone couldn’t recognise that kind of data coding.

To avoid generating such unreadable messages, we are offering you two ways of sending Unicode (UTF-8) messages – with textual or binary “Send SMS” methods.

If you choose to send Unicode messages over textual Send SMS methods, unconverted Unicode text should be inserted in the “text” parameter:

POST /restapi/sms/1/text/single HTTP/1.1
Host: api.gongmsgn.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json

{  
   "from":"DemoSMS",
   "to":"2348056661831",
   "text":"Hello world, Καλημέρα κόσμε, コンニチハ"
}

The Unicode message will be automatically sent to the mobile phone.

On the other hand, if you want to send Unicode with custom data coding over binary Send SMS methods, the message text should be converted into hexadecimal representation. The hexadecimal content should be inserted in the “hex” parameter and also, you should set “dataCoding” parameter to 8 (UTF-8):

POST /restapi/sms/1/binary/single HTTP/1.1
Host: api.gongmsgn.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json

{  
   "from":"DemoSMS",
   "to":"2348056661831",
   "binary":{  
      "hex":"48 65 6c 6c 6f 20 77 6f 72 6c 64 2c 20 ce 9a ce b1 ce bb ce b7 ce bc e1 bd b3 cf 81 ce b1 20 ce ba e1 bd b9 cf 83 ce bc ce b5 2c 20 e3 82 b3 e3 83 b3 e3 83 8b e3 83 81 e3 83 8f",
      "dataCoding":8,
      "esmClass":0
   }
}

Important

When sending messages with one or more non-GSM characters (for example Unicode), the text of the message is limited to 70 characters. Here you can find what characters are included in GSM set.

Make sure your messages are clear and readable in any language or alphabet – use GONG SMS API! Try out our language-specific features – SMS Transliteration and SMS language – to overcome character limitation and optimise your costs.

We’re running a global messaging platform which sends out more than 500,000 SMS on a daily basis, reaching more than 1/3 of the world’s population. With offices in Nigeria and more than 200 direct connections to mobile network operators worldwide, we can’t afford to forget about language specifics!

Share Button

About GONG:

GONG is a global mobile transaction cloud service connecting mobile and IP service providers and enterprises through an in-house developed and operated communication services cloud. Our converged messaging, m-payments, push notifications, voice and unified communication services bring a mobile and IP dimension to any business. Offices in Nigeria and strategic partnerships with major telco groups enable us to provide seamless integration, delivery and user experience. Always looking for innovation and new ideas, fostering a customer-first business philosophy and having the reach to every part of the world makes us the reliable provider for many clients in Nigeria and worldwide.