News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
SMS API filters out curly brackets in MT SMS, but allows them in MO SMS
Tags: rest api, sms and text messaging
Oct 9, 2020 at 8:29am   •   2 replies  •  0 likes
Pavel Lebedev

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?

2 Answers
answered on Oct 9, 2020 at 5:14pm  

What is MT SMS and MO SMS?

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


 0
answered on Oct 9, 2020 at 5:29pm  

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


 0
on Oct 9, 2020 at 8:24pm   •  0 likes

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




A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us