# The `savemms` action This action creates an MMS template, transcodes the content, and stores it for later use. The MMS may contain slides embedded with text, video, audio, images, contact, calendar, and PDF. Once the MMS is saved, an `mms-id` is returned enabling it to be utilized in the future by other API functions such as the `sendsavedmms` action. The slides are stored based on the order given in the API call. Please note that not all devices will honor the exact order directed in the MMS message. Important: Sinch will send an HTTP `GET` request to the server that is specified in the XML 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. br 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. ## Fallback SMS considerations If the MMS message is too large to be delivered or the carrier does not support MMS delivery, the API has an option to facilitate MMS delivery as fallback SMS. The fallback SMS consists of two parts: the **fallback SMS text** and the **fallback SMS link**. ### The fallback SMS text The fallback SMS text is the SMS text that will be sent instead of the MMS. The fallback SMS link, used to view the MMS content, is also sent. You can dynamically change the fallback SMS text by populating the `fallback-sms-text` field. If `disable-fallback-sms` is set node is set to `true`, then the fallback SMS text is not required. By default, the fallback SMS is enabled. If the MMS was attempted to be sent as SMS and the fallback SMS is disabled, the message sending will fail. ### The fallback SMS link The fallback SMS link is the link that hosts the MMS content. The fallback SMS link may be disabled by setting `disable-fallback-sms-link` to `true`; in this case only the fallback SMS text is sent. By default, we always send the fallback SMS link along with the fallback SMS text. The fallback SMS link expiration defines how long the MMS sent as SMS using this `mms-id` is valid and viewable on the mobile browser. By default, it is set to one year if no value is passed. The maximum expiration duration cannot be more than one year. ## Content transcoding Every MMS created using the JSON API will be transcoded for the destination handset based on your Account Settings. Additionally, any MMS which triggers an SMS Fallback containing a link to the MMS content hosted on a web page is optimized for the mobile web browser. To transcode a binary MMS, we must know what type of handset the user has. We are able to obtain this handset type information from delivery receipts, and we store the record in a handset cache for later use. We have a database of attributes which we manually match to every new handset in the cache, allowing us to adapt the content during MMS delivery. ## Special considerations - Each MMS message must include at least one slide. That slide may containt text and an image, video, audio, or other supported object. A maximum of eight slides per submission is supported. - Line breaks are supported in the slide texts of the MMS. - Provided URLs must contain the full path to the content files. - Always set the proper file MIME type headers and extensions. Extensions are optional in the filename as long as the proper MIME type is set in the headers for that content. It is always recommended to use the proper file extension AND set the MIME type header. Query strings are supported for files. - Delivery success takes precedence over audio and video content quality. Occasionally, the picture quality will be reduced to fit handset message size requirements. - Video content may be reduced in quality to fit delivery limitations and, if it still does not fit, will be delivered as a fallback SMS. - If transcoding is `ON` for the account, MMS containing audio/video can be used only when the audio/video encoding is completed. - After message submission, you will not be given a successful acknowledgement of audio/video encoding. - The status of audio/video encoding will be sent to your Postback URL after it has been completed. - Content validation rules: - Supported MIME TYPE and Supported Extension SHALL pass at validation and transcoding. - Supported MIME TYPE and Invalid Extension SHALL pass at validation and transcoding. - Supported MIME TYPE and No Extension SHALL pass at validation and transcoding. - "Octet-stream" MIME TYPE and Supported Extension SHALL pass at validation and transcoding assuming the content is what the extension claims. Otherwise, it SHALL fail at transcoding. - "Octet-stream" MIME TYPE and Invalid Extension SHALL fail at validation. - "Octet-stream" MIME TYPE and No Extension SHALL fail at validation. - On an IOS device, `contact`, `calendar`, and `pdf` objects are delivered as binary attachments in the MMS. On an Android device, only `contact` is delivered as binary attachment in the MMS and `calendar`/`pdf` are delivered as downloadable web links in the MMS. All other devices, `contact`, `calendar`, and `pdf` are delivered as downloadable web links in the MMS. If the handset is unknown, `contact` is delivered as binary attachment and `calendar`/`pdf` are delivered as downloadable web links by default. - Each supported source file has a maximum file size. See your API settings to see the current maximum file size value. - MMS messages are delivered in B64 encoding. To estimate the final size of Base64 encoded binary data, multiply the file size by 1.37 times the original data size + 814 bytes (for headers). - The following content is never transcoded: `contact`, `calendar`, `pdf` - Unicode characters may not be supported in the subject of an MMS message. Unsupported Unicode characters will be stripped out of the MMS subject. - Slides with text shall support Unicode characters, including emoji or emoticon. However, note that the destination devices may have limited Unicode capabilities. The preferred encoding is UTF-8. ## URL Handling and HTTP Status Code Compliance The API accepts URLs and retrieves data based on the provided HTTP status codes and Content MIME Types. In the case of HTTP Status Codes, the API follows specific rules for handling redirections. Accepted Status Codes are `200`, `301`, `302`, `303`, `307` and `308`. For codes in the 3xx range (`301`, `302`, `303`, `307`, `308`), the API allows a maximum of 1 redirection i.e., if a URL returns a 3xx status code and requires redirection, the API will follow the redirection only once. More info on HTTP Status Codes below: - `200 OK`: The request was successful, and the data is returned. - `301 Moved Permanently`: The requested URL has been permanently moved. - `302 Found`: The requested URL has been temporarily moved. - `303 See Other`: The response to the request can be found at another URL. - `307 Temporary Redirect`: The requested URL has been temporarily moved, and the same method should be used to request the new URL. - `308 Permanent Redirect`: The requested URL has been permanently moved, and the same method should be used to request the new URL. ## Sample payload and response ## Request schema ### Response schema ## Postback notifications Once an MMS is saved using the `savemms` action, it can be used by other functions through the `mms-id` returned from the `N003` postback response. When an MMS is saved and transcoded successfully, the system will generate a postback notification and unlock the MMS template for further use. If an MMS contains audio/video, the postback will be sent when the encoding of the MMS audio/video is finished. Otherwise, the postback notification will be sent instantly after image and other content is transcoded in real-time and stored. In the postback you will receive the `mms-id` for the MMS created and the tracking-id that was originally received as the API Request Acknowledgement.