Search Results

Send and Receive MMS

Overview

API Interface: HTTPS
URI: /v4/messages
Methods: POST
Response Schemas: JSON (default), XML

An application programming interface for connecting external applications, systems, and devices with the Aerialink Service Gateway for the purpose of sending and/or receiving SMS (Text Messages), MMS (Multimedia Messages), or Data (Binary) content between an application service and a mobile wireless handset or device operating on any approved wireless carrier. This specific API covers MMS messages only.

Response Schema

Aerialink supports both JSON and XML response schemas, however the default response schema is JSON. If you wish to receive your response schema in XML or explicitly set the response schema to JSON, follow these examples as you construct your complete request URL.

/messages
(defaults to JSON automatically)

/messages.json
(explicitly sets the response to a JSON schema, same as default)

/messages.xml
(sets the response to an XML schema)

Method [POST] : Sending an MMS

This method sends an MMS message from your application to the Aerialink Gateway for ultimate delivery to the destination number. The request is initiated by your application.

Note that the below instructions are for sending a single attachment. To send multiple attachments, you will need to use MM4. The specification for this protocol can be found here.

Request

The available request parameters for this resource and method are listed below and should be sent form-post.

Required Parameters

  • source [string(15)]
    The source code for the message. This must match to one of your codes associated with your connection.
  • destination [string(15)]
    The destination number that you want to send the MMS message to. The recommendation for US based numbers is the 11 digit format: “13105551212”.
  • messageText [string(160)]
    The MMS message text that you are sending to the end user handset device. This is limited to the general standard of 160 characters unless concatenation is enabled on your account. In some cases your character limit may be less depending on your specific use case and configuration or a carrier limitation.
  • mmsURL [string(160)]
    The URL for the MMS image which is to be sent to the mobile user. This URL must be publicly accessible.

Optional Parameters

  • destinationFormat [integer]
    Defaults to 0 for “friendly format” which is the default. If this parameter is passed with a value of 1 then Aerialink will expect the destination number in “international format” with the country code (ex. “xXXXxxxXXXX”). This is required for any international messaging.
  • registeredDelivery [integer]
    Defaults to 0. If set to 1, this will request a delivery receipt from the carrier which will be delivered to the URL that you specify in your account configuration.
  • programID [string(25)]
    Use this parameter to specify a program ID that is directly related to an approved and certified program or campaign with the carrier/operators. This value is typically only required for Dedicated Short Codes and will be provided as part of your carrier certification.
  • mmsSubject [string(40)]
    This parameter is the “subject” text of the MMS you are sending to the end-user device. This is limited to the general standard of forty characters, but character limit may be less depending upon the use of case and configuration or carrier limitation.

Response (Synchronous)

Response Properties

The parameters or elements returned in the response to an API request.

  • version : The requested version of the resource
  • resource : The requested resource name
  • method : The method for the request. This will always be one of the following; GET, POST, UPDATE, DELETE
  • type : The request type; Synchronous or Asynchronous
  • transactionGUID : The globally unique transaction ID for the message
  • destination : Operating company directory number

Response Schema

JSON Format(default schema)

{
  "aerialink": {
    "version": "v4",
    "resource": "messages",
    "method": "post",
    "type": "synchronous",
    "transactions": [
      {
        "transaction": {
          "transactionGUID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
          "destination": "12223334444"
        }
      }
    ]
  }
}

XML Format

<?xml version="1.0" encoding="UTF-8"?>
<aerialink>
 <version>v4</version>
 <resource>messages</resource>
 <method>post</method>
 <type>synchronous</type>
 <transactions>
  <transaction>
  <transactionGUID>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</transactionGUID>
  <destination>12223334444</destination>
  </transaction>
 </transactions>
</aerialink>

Python Format

import urllib
import urllib2
import base64
from pprint import pprint

#setup api creds
base64string = base64.encodestring('%s:%s' % ('[YOUR SID]', '[YOUR TOKEN]')).replace('\n', '')

#Aerialink POST
url = 'https://apix.aerialink.net/v4/messages'
values = {'source' : '[YOUR SMS NUMBER]',
          'destination' : '[MOBILE NUMBER]',
          'messageText' : 'Aerialink',
          'mmsURL' : '[YOUR IMAGE URL]' }

data = urllib.urlencode(values)
req = urllib2.Request(url, data)
req.add_header("Authorization", "Basic %s" % base64string)
response = urllib2.urlopen(req)
the_page = response.read()

#output the response
pprint(the_page)

Method [POST] : Receiving an MMS

This method is used by Aerialink to deliver a message from an end-user device to your application. The request is initiated by Aerialink

Request

Send the following request parameters form-post via an HTTP POST to the URL that you have defined in your connection/route. This can be configured or modified within the Aerialink Platform Portal.

Parameters

  • transactionGUID [string(36)]
    The globally unique transaction ID for the message.
  • connectionGUID [string(36)]
    The globally unique identifier for the Aerialink network connection in your account which processed the transaction.
  • source [string(15)]
    The source address for the message. This is the end user mobile phone which sent you the message.
  • sourceCountry [string(255)]
    The registered country name for the number.
  • sourceCountryCode [integer]
    The associated country code for the number.
  • sourceCountryAbbreviation [string(2)]
    The two-letter country abbreviation (ISO 3166-1 alpha-2)
  • destination [string(15)]
    The destination number that the end user sent the message to. This will match with a Short/Long Code configured on your account.
  • messageText [string(160)]
    The MMS message text that the end user sent to your Short/Long Code. This is limited to the general standard of 160 characters unless concatenation is enabled on your account. In some cases your character limit may be less depending on your specific use case and configuration or a carrier limitation.
  • mmsURL [string(160)]
    The URL for the MMS image which is received from the mobile user. This URL must be publicly accessible.
  • mmsSubject [string(40)]
    This parameter is the “subject” text of the MMS received from the end-user device. This is limited to the general standard of forty characters, but character limit may be less depending upon the use of case and configuration or carrier limitation.
  • concatenatedMessage [string(5)]
    true/false
  • attachments
    Returns information about the multimedia content “attached” to the message.

Optional Parameters

  • sourceNational [string(15]
    The source address for the message in national format, excluding the country code. This is the end user mobile phone which sent you the message.
  • udh [string(25)]
    Variable length defined inside the UDH itself
  • concatenatedMessageReference [string(5)]
    string up to five characters
  • concatenatedMessageSegments [integer]
  • concatenatedMessageSegmentNumber [integer]

Response (Synchronous or Aynchronous)

Aerialink will return an HTTP(s) status code in the 200 range upon a successful request along with the following response details. The 200 range could be any of the following values (200, 201, 202, 203, 204, 205, or 206) but in most all cases will be 200. If you do not receive one of these status codes in the response from us, your application should retry the HTTP(s) request at a later date or refer to the specific HTTP status code for more detail.

This page was last updated 1539620611241