question

Speedway Wireless avatar image
Speedway Wireless asked ·

Can't send SMS with spaces

I can send SMS with no spaces, as soon as I try to make a full sentence or even one space, I receive the error message,

{

"errorCode" : "InvalidJson",

"message" : "Invalid json in section [text]",

"errors" : [ {

"errorCode" : "CMN-131",

"message" : "Invalid json in section [text]",

"section" : "text"

} ],

"section" : "text"

}


Here is my curl post.


"-X POST

-H \"accept: application/json\"

-H \"content-type: application/json\"

-H \"authorization: Bearer "& $token &" \"


--data {\"from\":{\"phoneNumber\":\"xxxxxxxxxx\"},\"to\":[{\"phoneNumber\":\"xxxxxxxxxx\"}],\"text\":\"test test\"}"

Any help would be appreciated.

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 ·

Not sure why your system does not work. This works fine for me

curl -XPOST https://platform.devtest.ringcentral.com/restapi/v1.0/account/[accountid]/extension/[extensionId]/sms -H 'accept: application/json' -H 'content-type: application/json' -H 'authorization: Bearer valid-access-token' --data '{"from":{"phoneNumber":"xxxxxxxxxx"},"to":[{"phoneNumber":"xxxxxxxxxx"}],"text":"test test and test again"}'

Can you try with "test%20test"

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.

I tried the "test%20test" but I received "test%20test" in the SMS message. I am using this in Filemaker if that changes anything.

0 Likes 0 ·
Anirban avatar image
Anirban answered ·

This is something wired ... I never faced this issue.. Just see I am getting the response perfectly

Make sure you using correct Json POST request as below format and structure:

{"from":{"phoneNumber":"your phone number"},"to":[{"phoneNumber":"Your number to send"},{"phoneNumber":"Your number to send"}],"text":"Test message with space"} 

th.jpg (221.9 KiB)
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.

Rahul G avatar image
Rahul G answered ·

Please check the phone numbers as well, it needs to be in E.164 format - Also, what is the error message you are facing? Can you elaborate?

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.

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