question

Pavel Lebedev avatar image
Pavel Lebedev asked ·

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?

apismsapi sms
1 |1500 characters needed characters left characters exceeded

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 |1500 characters needed characters left characters exceeded

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 ·

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 |1500 characters needed characters left characters exceeded

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

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 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

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