SMS length when using the API?

Hi,

For a couple of years I’ve been using the POST/GET function to send SMS programmatically. From RUTOS 7.14 I had to change this and instead use the api (/api/messages/actions/send). When I changed this I found that some messages I used to send are now too long. Now I get an error message saying:

{
    "success":false,
    "errors":[
        {
            "source":"Message sending",
            "code":9,
            "error":"Max SMS count is 3 messages",
            "section":"send"
        }
    ]
}

I believe it is messages including emojis that are affected. I have done some testing and it seems like if I include an emoji I can only send messages have the size compared to if I don’t include an emoji.

Could this have anything to do with how the api encode the content, UTF-8/UTF-16? Or did the “Max SMS count” used to be larger than 3 in the POST/GET function?

Is there any way I can continue to send my messages including emojis even when using the api?

Br,
Henrik

Hello,

The API SMS messages sending should indeed allow you to include emojis in your messages. I’ve tested sending longer messages with emojis (using characters from sources like 👉 😚 💯 😹 👀 Emoticons Smiley Face Symbols) and haven’t encountered the same limitation you’ve described.

Based on the error message you received, it seems like the issue might be related to the total number of SMS parts generated by your message. Could you provide a message example that you use to send?

Moreover, including emojis in a message changes the encoding to UTF-16, which reduces the maximum character count per message part. As a result, messages containing emojis can quickly exceed the 3-part (concatenated SMS) limit.

Best regards,

I can also use a rest API

Best regards

Thank you for your reply :folded_hands:

Yes, maybe the problem is that my RUTX11 can only send 3 SMS parts when using the API. Should it be possible for the router to send messages with more than 3 SMS parts?

Here are some examples of OK/Not OK messages I tried:

This is ok (1 emoji + 199 characters):
😊123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmno

This is not ok (1 emoji + 200 characters):
😊123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnop

This is ok (459 characters):
123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz1234

This is not ok (460 characters):
123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz123456789abcdefghijklmnopqrstuvwxyz12345

Hi again @Martynas

Have you had time to look into this problem any further?

Do you know why there is a 3-part limit when using the API but not when using the old POST/GET function?

Br,
Henrik

Hello @henrik1,

Apologies for the delay in getting back to you on this. Our R&D team took a deeper look into the issue, and at the moment there’s no documented reason why the API SMS limit was set to 3 parts, while the older POST/GET function didn’t enforce this restriction.

That said, good news: this limit is planned to be increased to 8 parts with the upcoming 7.16 firmware release.

Appreciate your patience on this one.

Best regards,