question

Pavel Lebedev avatar image
Pavel Lebedev asked Phong Vu commented

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?

rest apisms and text messaging
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered

What is MT SMS and MO SMS?

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

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Pavel Lebedev avatar image
Pavel Lebedev answered Phong Vu commented

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

1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image Phong Vu ♦♦ commented ·

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)
  }
}


0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys