Sending an SMS text message that exceeds 160 characters requires to fragment the message into multiple SMS. This fragmentation is performed automatically and is transparent for the user. Depending on the message content, if extended characters such as emojis are present in the message, the fragmentation is even greater as only 70 characters per SMS are allowed due to the use of extended characters set. Additional information about encoding and fragmentation can be found here.
In this context, when we need to send large messages that could lead to many fragments, the use of MMS can be a better option in terms of proficiency of processing these moderate to large text message, as the MMS processing model does not fragment the message.
This document provides information on how to take advantage of the MMS message processing, even if the use case does not include a media file or attachment in it, using MMS processing to send larger than usual text messages in just one fragment. Here we describe how SCG provides a way to force an MMS message without media attachment.
SMS in /Messages API
In this example we are sending a 350 characters message, this message is fragmented in 3 SMS. In SCG we can get the message information including the fragments details:
Message in SCG:
{ "application_id": XXXXX,
"company_id": XXXXXX,
"created_date": 1706129662842,
"last_updated_date": 1706129663087,
"version_number": 4,
"id": "s6XLzSkaiNC3p9Nul38U74",
"message_request_id": "s6XLzSkaiNC3p9Nul38U74",
"direction": "MT",
"customer_sender_id": "KYehkeGuj4jIN2wiXXXXXX",
"from_address": "1833650XXXX",
"to_address": "+1346787XXXX",
"state": "SENT",
"sent_date": 1706129662808,
"type": "SMS",
"destination_country": "USA",
"sender_id_alias": "KYehkeGuj4jIN2wiXXXXXX",
"fragments_info": [
{
"fragment_id": "s6XLzSkaiNC3p9Nul38U74F1",
"fragment_state": "SENT",
"charge": 0,
"external_id": "202420075831704454658861",
"delivery_report_reference": "s6XLzSkaiNC3p9Nul38U74F1"
},
{
"fragment_id": "s6XLzSkaiNC3p9Nul38U74F2",
"fragment_state": "SENT",
"charge": 0,
"external_id": "102430106821704423754493",
"delivery_report_reference": "s6XLzSkaiNC3p9Nul38U74F2"
},
{
"fragment_id": "s6XLzSkaiNC3p9Nul38U74F3",
"fragment_state": "SENT",
"charge": 0,
"external_id": "102420207421704433822631",
"delivery_report_reference": "s6XLzSkaiNC3p9Nul38U74F3"
}],
"consent_requirement": "NONE",
"shortcode_address_type": "STANDARD",
"standalone": true,
"from": "sender_id:KYehkeGuj4jIN2wiXXXXXX",
"to": "+1346787XXXX",
"request_start_time": 1706129662717,
"fragmentMessageType": "SMS_FRAGMENT_WITH_UDH"
}
Force MMS in /Messages API
To force the MMS message with the same example, the mms: prefix can be used in the payload recipient field as follow: this example with a message with 350 characters would be sent as SMS with 3 fragments. Instead, we can send it as an MMS with one fragment:
curl -L -X POST \
https://api.syniverse.com/scg-external-api/api/v1/messaging/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer [TOKEN]" \
-d '{"from":"sender_id:KYehkeGuj4jIN2wiXXXXXX",
"to":"mms:+1346787XXXX",
"body": "Test message using 350 character long text message Test message using 350 character long text messageTest message using 350 character long text messageTest message using 350 character long text messageTest message using 350 character long text messageTest message using 350 character long text messageTest message using 350 character long text message"}}'
The resulting message will be:
{
"application_id": XXXXX,
"company_id": XXXXXX,
"created_date": 1706050001580,
"last_updated_date": 1706050001920,
"id": "OlL9meooD3zHWNFV2VJCC7",
"direction": "MT",
"customer_sender_id": "KYehkeGuj4jIN2wiXXXXXX",
"from_address": "1833650XXXX",
"to_address": "+1346787XXXX",
"state": "SENT",
"sent_date": 1706050001820,
"type": "MMS",
"destination_country": "USA",
"sender_id_alias": "KYehkeGuj4jIN2wiXXXXXX",
"fragments_info": [
{
"fragment_id": "OlL9meooD3zHWNFV2VJCC7F1",
"fragment_state": "SENT",
"external_id": "OlL9meooD3zHWNFV2VJCC7",
"delivery_report_reference": "OlL9meooD3zHWNFV2VJCC7"
}],
"consent_requirement": "NONE",
"shortcode_address_type": "STANDARD",
"standalone": true,
"from": "sender_id:KYehkeGuj4jIN2wiXXXXXX",
"to": "mms:+1346787XXXX",
"request_start_time": 1706050001534
}
0 Comments