This endpoint allows you to send an MMS, or multimedia message to a recipient. MMS messages extend SMS messages by allowing various multimedia components like images, short video clips and audio recordings. Similar to an SMS message, a MMS message needs the following paramaters for it to be delivered to a recipient.
It must be from a valid phone number on your account.
It must be sent to a valid recipient’s phone number.
It must contain at a minimum, a short message.
It can optionally have one or more multimedia components. If no multimedia is specified, the message will be sent as a regular SMS instead.
How We Determine the From Number on an Outgoing MMS
If you specify a user_id or pin value of a user on your account, we will attempt to use that user’s associated phone number if they have communication abilities enabled. This essentially means we’re sending a SMS out on behalf of this user.
If you specify the from_number directly, we will attempt to use that as long as it matches a valid and active line on your account.
If no from_number is specified, or no user_id/pin is specified, or the specified user has no number AND no caller id, we will attempt to use the account-wide text from number setting.
If we cannot determine a from number, we return an error response to you.
How we Associate an Outgoing Text With a User
Texts sent using this endpoint can be associated with a user on your account. This means that we record the user’s id value with the call data record so that the text shows up in the user’s individual history, and in your reports. In order to associate the text with a user, you must specify the user_id or pin value below.
Specify the account id explicitly to send the text using this account. Optional for users. Required for integrators.
user_id
integer
Optional
Associate the message with this user and attempt to use the user’s number as the text from number.
pin
integer
Optional
Alternatively, specify the user with the PIN instead of user_id.
from_number
string
Optional
Specify the form number directly. This must be an active line on your account.
extra
object
Optional
A JSON string containing any key:value pairs that you want to get sent back to you via the Push or RealTime API. See notes for extra data.
Multimedia Request Parameters
Here is how you include multimedia contents with your message. The following shows a hypothetical scenario where two images were included with a MMS message. The parameter name is free form. We used “image1” and “image2”, but you could use your own names here. The content type of each sub-part of your POST should be specified so we know what kind of content is being sent to us (image, video, etc). It sounds compliated, but it’s well supported by most HTTP client libraries.
Parameter
Type
Content-Type
Description
image1
binary
image/jpeg
The image data will be encoded and passed to us. We send it along to the recipient.
image2
binary
image/jpeg
The second image data will be encoded in this sub-part. We send this along too.