Send and receive MMS messages using the JSON API.
Sinch Messaging and Content APIs | Sinch (2.0)
MMS
This API sends, saves, or sends a saved MMS defined in the JSON to a single mobile number. The sent or saved MMS may contain slides embedded with text, images, videos, audios, and/or other objects. Calls to the API are made in the form of HTTP requests using the POST request method with UTF-8 encoded JSON data passed inside the request body. All requests are expected to include a content-type HTTP header (for example, Content-Type: application/json; charset=utf-8).
Important:
Sinch will send an HTTP GET request to the server that is specified in the JSON slide of the embedded images, videos, audios, and/or other object URIs to retrieve the contents of the media file. The HTTP response header Sinch receives from the server MUST contain the Content-Length field indicating the size of the resource. Otherwise, the API request will fail. Customers using CDNs that employ chunked transfer encoding may run into problems in which the server returns a Transfer-Encoding field with a value of "chunked" specified in the HTTP GET response, rather than the server returning Content-Length. If a Transfer-Encoding field with a value of "chunked" is specified in an HTTP, the API request will be rejected.
Important:
All media files are expected to serve a valid content-type header (for example, text/plain, image/gif, audio/mp3, video/mp4, etc.). If a file server serves a file using the application/octet-stream content-type header instead, it may be rejected if the MIME type cannot be determined by other means.
This request is used to send, save, or send a saved MMS message.
The action for this API request. In this case, to send an MMS.
| Value | Description |
|---|---|
| sendmms | Send an MMS |
Slide content node which contains the content URL. Must contain at least one slide object. A maximum of 8 slides may be specified for a single MMS message. Acceptable slide content includes:
image(cannot be used withvideo,contact,calendar, orpdf)audio(cannot be used withvideo,contact,calendar, orpdf)video(cannot be used withimage,audio,contact,calendar, orpdf)contact(cannot be used withimage,audio, orvideo)calendar(cannot be used withimage,audio, orvideo)pdf(cannot be used withimage,audio, orvideo)message-text(maximum of 5000 characters)
Note that you cannot include multiple files of the same MIME type on the same slide. Also note that, if transcoding is ON for the account, the API shall reformat the content when necessary, so it can be delivered to the end-users handset in the best possible way.
- image
- audio
- video
- contact
- calendar
Supports .jpg (image/jpg, image/jpeg), .png (image/png), and .gif (image/gif).
Only carriers in certain countries allow Alphanumeric senders. Not supported in the USA.
MMS subject text. Limit to 40 characters for best deliverability. Maximum of 80 characters.
Must be included if disable-fallback-sms is set to false. Text to be included when SMS sent as a fallback. For best deliverability, limit string to 110 characters.
Set to true to prevent a link to the MMS content from being included in the SMS fallback message.
Expiration for the SMS fallback link. If not populated, defaults to 1 year from the time and date at which the API request was made. Maximum of 1 year. Accepts ISO8601 Date format. Only applies to fallback SMS messages.
MMS delivery attempts will stop after the date and time specified in this field. If the MMS is already delivered to the device, it will remain in the device's inbox. If not populated, the expiration value defaults to 3 days from the time and date at which the API request was made. Maximum of 3 days. Accepts ISO8601 Date format.
Customer transaction ID of the request. Passed back in all postbacks for this transaction. Maximum length of 64 characters.
- https://api.ci.mblox.com/ep/v2
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://api.ci.mblox.com/ep/v2/ \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-d '{
"action": "sendmms",
"service-id": "YOUR_CAMPAIGN_ID",
"to": "RECIPIENT_PHONE_NUMBER_WITH_COUNTRY_CODE",
"from": "YOUR_PHONE_NUMBER",
"from-mask": "YOUR_MASK",
"message-subject": "YOUR_SUBJECT_TEXT",
"fallback-sms-text": "TEXT_OF_FALLBACK_SMS",
"disable-fallback-sms-link": false,
"disable-fallback-sms": false,
"fallback-sms-link-expiration": "EXPIRATION_DATE_UTC",
"mms-expiry-timestamp": "ISO8601_DATE_FORMAT",
"client-reference": "CLIENT_SUPPLIED_IDENTIFIER",
"cache-content": true,
"slide": [
{
"image": {
"url": "{Image URL}"
},
"message-text": "{Slide message text}"
},
{
"audio": {
"url": "{Audio URL}"
},
"message-text": "{Slide message text}"
},
{
"video": {
"url": "{Video URL}"
},
"message-text": "{Slide message text}"
},
{
"contact": {
"url": "{Contact URL}"
},
"message-text": "{Slide message text}"
},
{
"calendar": {
"url": "{PDF URL}"
},
"message-text": "{Slide message text}"
},
{
"pdf": {
"url": "{PDF URL}"
},
"message-text": "{Slide message text}"
}
]
}'Response
Indicates the status of the action. Either success or failure.
| Enum Value | Description |
|---|---|
| success | A response indicating success. |
| failure | A response indicating failure. |
More details about the status of the action. Returned with success status for any action.
Transaction ID for the request. Used for identifying postbacks received for this API request. Returned with success status for any action.
Destination phone number with country code. Returned when sendmms or sendsavedmms have a success status.
Shortcode or Toll Free/10DLC number with country code that will be used to send a saved MMS. Returned when sendsavedmms has a success status.
Code that identifies the specific error that was encountered. Returned with failure status for any action.
{ "status": "success", "to": "DESTINATION_PHONE_NUMBER", "tracking-id": "UNIQUE-TRANSACTION-ID", "status-details": "MMS request accepted and queued for processing and delivery." }