Skip to end of metadata
Go to start of metadata

Last Updated: Tuesday, January 8, 2019




The simplest way to send an MMS message is strip it down to just the HTTP POST and use a simple tool like Curl to send it.

You can use the following example files named sampleHeader.txt and sampleBody.txt to help you send an MMS message using Curl. While there are some Curl-specific changes you need to make, it is easier than starting from a programming language.


Caution: Do not just copy and paste Example One: sampleHeader.txt or Example Two: sampleBody.txt as they will lose any full carriage return (/r/n) characters from the example. Please download the Curl examples and do not remove any CRLF characters from it.


Note: Since an MM7 call can get pretty bulky, you should write your header values and post body into separate files and use Curl command line arguments to load them.

Example One: sampleHeader.txt

This example includes an image.

MIME-Version: 1.0
Content-Type: multipart/related; type="text/xml"; start="<rootpart>"; boundary="----=_Part_2_1764018763.1515602889819"
Authorization: Basic <<insert base 64 encoded username:password>>
X-Vibes-CarrierCode: <<insert vibes carrier code>>
Accept-Encoding: gzip,deflate
Accept:
Expect:
SOAPAction: 

You will have to add your customer-specific information in the following two places in this example:

  • Authorization: This header value expects a Basic authorization string which is "Basic" + space + your username:password base 64 encoded.
  • X-Vibes-CarrierCode: Enter a valid Vibes carrier code for the carrier of the phone to which you will be sending the message.


Note: Each new line should be a full carriage return (/r/n).

Example Two: sampleBody.txt

This example includes an image, a text attachment, and a smil file.

------=_Part_1_1764018763.1515602889819
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: <rootpart>

<?xml version="1.0" encoding="utf-16"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>
        <TransactionID xmlns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2">ea92fdc3-44e9-466a-9c40-f51a704a2590</TransactionID>
    </soapenv:Header>
    <soapenv:Body xmlns:ns3="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2">
        <ns3:SubmitReq xmlns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2">
            <ns3:MM7Version>5.3.0</ns3:MM7Version>
            <ns3:SenderIdentification>
                <ns3:SenderAddress>
                    <ns3:ShortCode> <<YOUR SHORTCODE>> </ns3:ShortCode>
                </ns3:SenderAddress>
            </ns3:SenderIdentification>
            <ns3:Recipients>
                <ns3:To>
                    <ns3:Number><<YOUR E164 FORMAT PHONE NUMBER>></ns3:Number>
                </ns3:To>
            </ns3:Recipients>
            <ns3:DeliveryReport>true</ns3:DeliveryReport>
            <ns3:Subject>Vibes Testing</ns3:Subject>
            <ns3:Content href="cid:attachment.cid"/>
        </ns3:SubmitReq>
    </soapenv:Body>
</soapenv:Envelope>
------=_Part_1_1764018763.1515602889819
Content-Type: multipart/related; boundary="----=_Part_1_508319571.1515623980041"; type="image/jpeg; name=icon_market.jpg"; start="<icon_market.jpg>"
Content-Transfer-Encoding: binary
Content-ID: <attachment.cid>

------=_Part_1_508319571.1515623980041
Content-Type: image/jpeg; name=icon_market.jpg
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=icon_market.jpg
Content-ID: <image.cid>

/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwM
DAwMEAwODxAPDgwTExQUExMcGxsbHCAgICAgICAgICD/2wBDAQcHBw0MDRgQEBgaFREVGiAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICD/wAARCAAyADIDAREA
AhEBAxEB/8QAHAAAAgIDAQEAAAAAAAAAAAAABQYABAIDBwEI/8QAMhAAAQMCBQIDBgYDAAAAAAAA
AQIDBAAFBhESEyEiMRRBUQcVMjNxoVJhYpGS4RZC0v/EABkBAQEBAQEBAAAAAAAAAAAAAAABBQQG
A//EACURAQABAwQCAQUBAAAAAAAAAAABAgMRBRIhMQRxYRNRgaHB0f/aAAwDAQACEQMRAD8A+qaD
WiTHWCUOoUB3IUDQIX+V+0a9peuOErbbjZWlrRHVcXHUvy9s6SpnbyQgEgga6A7gXGkfFVrdf8Ou
BcoLyol1trvzI8hHdJ7Zg9waBkoJQSgWcY4ldtbHh2o7hW6nmTpO2gHg9XbVQcxvGK5LTbUa3IQ5
cJRKWtfwIH+y1ZelVA6Pj3GODlRfekhmRh1ag0p6Knb8KVHpJb+Hbz9B/cU52KU1bMR3e/sO7j99
EfxrKtIa1RkFCFoCQMiUnq750D/Y70Lo24rb0FogHI5g5/tQE6CUGK6APPw5YZi9cq3sLdHAd0AO
c/rGSvvQLmIPZBh682uTBDr0NMlso6VbgGfY5LzPB570ARPs3vVtiMRY1wblmO2lordSppStAyz4
3Bzl60RZsOIvdDZju8LWrNX1HFFPdovDc1sKSaApQSgGXW+NW0AOo3HVctpSe49T6Vn+ZqEWO4zI
EsYsdde3VxhtsoOrSsZ5KI56ss6zLeszVVmaeIj7+gZbVFuTAkRV9+/19CPI1u2PIou07qehx/FM
ZxFxIHdEh5tWX5K/qvsH/A0ZxEVJVQONBispHxHKgWcQNtmWJhmhph5raGgFwqA+JPHTlz5mvO6n
RG/fvxTMY459/H7ATftLXy465B/E8rSP4o/6rI+pYp6pmr3P8j/UXLZfXUydk6I0Z4FCtpATpKuA
vPvwfU11eJqExVt4ppq44jGPn8BZmRHXLoqE51PofUp1XfkEjv8AmTXqrEVRbiKu4hXSrHDEeIgZ
eVfUE6CvPgR50csP56D+ElJ7ZeX1qTGYwFp3AIRFcjwri8hCiFoS8A4EqHplo7jis2rS6Nk0x1PP
qQFfwji+N8tLE1PloXoV+y9I+9ZNzRLkdYkC5D1xhnKfb32P1lBKf5DMfeuC54F2nuJQw4YtXi3f
eS+rf6kqPmK9d4UzNmnPeFPCEhKQBXUMqCUEoJQV5AFB7HAyoN9BKD//2Q==
------=_Part_1_508319571.1515623980041--
------=_Part_1_1764018763.1515602889819--

You will have to add your customer-specific information in the following two places in this example:

  • ShortCode: Enter a valid Vibes-provisioned shortcode with MMS enabled.
  • Recipients > Number: Enter a valid E.164 formatted phone number (for US +1XXXYYYZZZZ).

Once both of these files are completed, you can send the message with the following command:

curl -H @sampleHeader.txt --data-binary @sampleBody.txt https://messageapi-mms.vibesapps.com/mms/mm7/submit


Note: The Curl version needed for the Samples must be at least 7.61.0.

Sample Files

You can download the sample files below to make it easier to use them.


Example One - Sending Image


Example Two - Sending Image with Text



  • No labels