Just as in the case of SMS, one needs to make a POST request to https://sms.telnyx.com/send. The request must have the following structure:

  • Request header: x-profile-secret - same as in the case of SMS
  • Request fields: must be provided as a JSON object
  • from: the source number, in e164 format. This number must be attached to a messaging profile.
  • to: The destination number, in e164 format.
  • body: a JSON object describing the multimedia content (see below).

Note that the main feature distinguishing an MMS request from an SMS request is the type of body. If body is a string, then an SMS will be sent. If body is a JSON object, then an MMS will be sent.

The body must have one of the following forms:

1.

"body": {
"subject": "",
"media_urls": [
{"": ""}, {"": ""}, ...
]
}]] >

2.

"body": {
"subject": "",
"smil": ""
}]] >

3.

"body": {
"subject": "",
"text": ""
}]] >

In the first case the user must prepare publicly accessible URLs with multimedia. Then the list of the multimedia URLs will go into "media_urls" list. Example:


"body": {
"subject": "Cat Pictures",
"media_urls": [
{"img": "http://www.test.com/path/to/cat/picture1.jpg"},
{"img": "http://www.test.com/path/to/cat/picture2.jpg"}
]
}]] >

The above will send an MMS containing two images. Note that in each media_url object, the type of multimedia must be specified ("img" in the above example). Other allowable types are: "text", "audio", and "video".

In the second case, the body object contains a "smil" field whose value should be a SMIL description of the multimedia message. Just like in the first case all media URLs in the SMIL description must be publicly accessible.

The third case will create a text-only MMS (note that a text-only MMS is different than SMS!).

Sample request:

curl -X POST -H 'Content-Type: application/json'
-H 'x-profile-secret:'
-d '{"from": "+15555555555", "to": "+15556666666", "body": { "subject": "Cat", "media_urls" : [{"img": "http://www.test.com/cat/picture.jpg"}] }}'
https://sms.telnyx.com/send]] >

Receiving MMS

In order to receive MMS you must be whitelisted on the Telnyx platform. Please reach out to our 24x7 support team by contacting us via live chat, email support@telnyx.com or calling our support line at either +1.888.980.9750 or +1.312.945.7420. 

Upon review you will be notified by a team member once the whitelist has been applied to your account. You should then be able to receive MMS.

Please note that currently it is up to the user to distinguish MMS and SMS messages arriving at the webhook. One way to distinguish them is to check the Content-Type header (it will be multipart/form-data for MMS).

Did this answer your question?