Send an MMS with Basic Authentication

In this building block you will see how to send an MMS using the Messages API.

IMPORTANT: Only US Short codes are currently supported.


Ensure the following variables are set to your required values using any convenient method:

Key Description
US_SHORT_CODE The US Short Code you are sending the message from.
TO_NUMBER The phone number you are sending the message to.
IMG_URL The URL of the media you want to send

NOTE: Don't use a leading + or 00 when entering a phone number, start with the country code, for example 447700900000.


Create an application

Write the code

Add the following to

Copy to Clipboard
curl -X POST \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{ 
        "type": "mms",    
        "number": '$US_SHORT_CODE'
        "type": "mms",
        "number": '$TO_NUMBER'
          "type": "image",
          "image": {
              "url": '$IMG_URL'

View full source 

Run your code

Save this file to your machine and run it:

$ bash

Try it out

When you run the code an MMS message will be sent to the destination number.