Skip to main content
The First Step
October 9, 2020
Question

SMS API filters out curly brackets in MT SMS, but allows them in MO SMS

I'm sending a short JSON-formatted command to my IoT device, but SMS API removes curly brackets "{}" from the message.

When the device sends JSON-formatted SMS - the curly brackets go through.

The only way for me to send curly brackets is to urlencode() the string, but that makes it much longer.

How do I allow curly brackets in MT SMS?

3 replies

PhongVu
Community Manager
Community Manager
October 10, 2020

What is MT SMS and MO SMS?

As long as your text message is a string, it will arrive as a string with "{}"

The First Step
October 10, 2020

MT means mobile-terminated, so when I send sms from RC API To my phone - I lose brackets, but if I send sms From my phone to RC API - brackets go through. same code works fine with Jasper/Cisco, but not with RC

PhongVu
Community Manager
Community Manager
October 10, 2020

It must be your SMS app on the phone or your carrier restriction which strip of the brackets.

Here is the screenshot of what I send from RC API to my cell number.

And this is the code where I call to send the message

async function send_sms(fromNumber){
  try{
    var resp = await platform.post('/restapi/v1.0/account/~/extension/~/sms', {
             from: {phoneNumber: fromNumber},
             to: [{phoneNumber: RECIPIENT}],
             text: '{"key":"value", "array":[{"key1":"value1","key2":1},{"key1":"value1","key2":1}]}'
        })
    var jsonObj = await resp.json()
    console.log("SMS sent. Message status: " + jsonObj.messageStatu
  }catch(e){
    console.log(e.message)
  }
}