Send an MMS with Cellcast RESTful API

With our MMS messaging API you can:

  1. Send MMS messages.
  2. Receive real time delivery reports (DLR) for all messages sent.
  3. Receive replies and inbound MMS messages.

MMS stands for Multimedia Messaging Service. Multimedia Messaging Service is an extension of the core SMS protocol, and it was developed to enable the transmission of multimedia content via text message.

MMS messages cost a bit more than SMS messages because it involves the transmission of more data.

In case you're wondering, "Why pay more for MMS?", the answer is pretty easy: MMS campaigns have a 20% higher opt-in rate than SMS campaigns, and MMS messages are 8x more likely to be shared on social media. Pics and gifs are simply much more engaging than plain old text, and that’s why it's worth paying more for MMS.

MMS creates a richer mobile experience for your customers or subscribers. A picture is worth a thousand words.


Our simple REST API allows you to get up and running in minutes, just follow the helpful Quick Start guide. For advanced users, dig deeper into our technology and check our reference guides for more detailed functions and calls. We have a wide range of calls to mirror useful functionality on the site at both user and reseller level. We also offer code samples in order to make your experience using the API suite as clean as possible.

So let's now look at how to use and get the best out of the REST API.



Security

To ensure security & privacy the API only works over HTTPS protocol for all requests. Also, for your own security, If you have a website with a form which sends MMS be sure to send the request from your server and not directly from the browser otherwise you will be giving away your API secret and opening the floodgates to unwanted charges.


Authentication

All API requests require your API credentials, We will provide you APPKEY. For Security API credentials must be passed as HTTP Basic Authentication headers not as CGI parameters.


Throttling

To provide the best service to all our customers we limit the number of API calls.If you exceed this limit we will return two indicators which you can use in your code to detect that you have been throttled. The first is the HTTP status code 429 "Too Many Requests", the second is the error code "OVER_LIMIT" in the error block of the response body.


Pagination

Some responses are too large to be returned in one go so we paginate. To identify which calls use pagination look for the "page" parameters in the parameter descriptions for each API call. These calls include a "page" block in the response with two values, "count" and "number". Count tells you how many pages are available and number indicates the page number you are on. The page parameter is used to request a certain page, it defaults to 1. The max parameter is used to limit the number of results returned per page, the default is 25.


Error Reporting

Always check if your API call was successful or resulted in error. You may check the following

  1. 200 OK response header. It will be 4xx if an error occurred.
  2. error->code structure should equal to 'SUCCESS'Note that some API functions can return custom errors of their own (listed in appropriate document sections). Check the error->description for details, e.g. which field caused an error or which resource you don’t have access to.

We can't wait to see what you build!

send-mms

Base URL:

https://cellcast.com.au/api/v3/send-mms
Method: POST (Form data)

Parameters

Header Parameters Description
APPKEY Please add provided APPKEY. Which is linked to your cellcast account
Content-Type application/json

MMS Data Parameters

Name Example Description
subject MMS subject goes here string - Required field
mms_text MMS text goes here string - Required field
- To add a new line to the message, use "\r\n" in the message string with only double quote
mms_file MMS Image file goes here Only PNG, GIF and JPEG are allowed and Max Image size 380KB.
- Please upload size 300x450px
- Required field
numbers ["+61400000000"] JSON encoded Array - Required field
For multiple MMS send: ["+61400000000","+61400000001"]
You can pass 10000 numbers to send an MMS in one API call
- Required field

Success Responses

Code Status Description
200 SUCCESS "You will get MMS scheduled count and credit deduction count.

Success Responses looks like:

{
    "meta": {
        "code": 200,
        "status": "SUCCESS"
    },
    "msg": "Your MMS is successfully scheduled.",
    "data": {
        "total_numbers": 2,
        "success_number": "2",
        "credits_used": "2"
    }
}

Error Responses

Status Code Description
AUTH_FAILED_NO_DATA 401 You have not provided APPKEY
AUTH_FAILED 401 - APPKEY you have provided is invalid
- You are not a registered user
FIELD_EMPTY 400 Required field is empty
RECIPIENTS_ERROR 400 No valid recipients left after validation or recipient in unsubscribed list.
FIELD_INVALID 400 -You can pass 10000 numbers to send an MMS in one API call
- You do not have enough credit to send MMS.
- You can pass text up to 1000 characters to send an MMS.
- You can pass the subject up to 40 characters to send an MMS.
- Choose image file to upload.
- Upload valid image. Only PNG, GIF and JPEG are allowed.
- Image size exceeds 380KB
- Problem in uploading image files.
BAD_REQUEST 400 Please provide proper data

Error Responses looks like:

{
    "meta": {
        "code": 400,
        "status": "FIELD_INVALID"
    },
    "msg": "You can pass text up to 1000 characters to send an MMS.",
    "data": []
}

PHP Code Example

You can call following function to send MMS.

function sendMms($subject, $mms_text, $mms_file, $phone_number) {
    try {
        $url = 'https://cellcast.com.au/api/v3/send-mms'; //API URL
        $fields = array(
            'subject' => $subject,          
            'mms_text' => $mms_text, //here goes your MMS text
            'mms_file' => $mms_file,
            'numbers' => $phone_number // here goes your numbers array
        );
        $headers = array(
            'APPKEY: <<APPKEY>>',
            'Accept: application/json',
            'Content-Type: application/json',
        );

        $ch = curl_init(); //open connection
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, count($fields));
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        if (!$result = curl_exec($ch)) {
            $response_error = json_decode(curl_error($ch));
            return json_encode(array("status" => 400, "msg" => "Something went to wrong, please try again", "result" => $response_error));
        }
        curl_close($ch);
        return json_encode(array("status" => 200, "msg" => "Successfully send mms", "result" => json_decode($result)));
    } catch (\Exception $e) {
        return json_encode(array("status" => 400, "msg" => "Something went to wrong, please try again.", "result" => array()));
    }
}
                                

Call Function

//Set value of MMS
$subject = 'Subject here';
$mms_text = 'MMS text here';
$mms_file = '<<VALID IMAGE URL>>';
$numbers = array("<<Number1>>","<<Number2>>","<<Number3>>");

//Call function to send MMS
sendMms($subject,$mms_text,$mms_file,$numbers);
                                

get-responses

Base URL:

https://cellcast.com.au/api/v3/get-responses?page=<<page_number>>&type=mms;
Method: GET

Parameters

Header Parameters Description
APPKEY Please add provided APPKEY. Which is linked to your cellcast account
Content-Type application/json

API Parameters

Name Example Description
page Page number Pass page number.Default value is 1
type Response of MMS pass 'mms' value to get only responses of sent MMS

Success Responses

Code Status Description
200 SUCCESS You have <<Total Responses>> response(s)
Response Description
from Recipient Mobile Number that sent the reply message.
body Inbound message body.
received_at Received date and time.
original_body Original outgoing MMS message body.
original_message_id Original MMS message ID. Returned when originally sending the message.
message_id The Message ID for the inbound message.

Success Responses looks like:

{
    "meta": {
        "code": 200,
        "status": "SUCCESS"
    },
    "msg": "You have 1 response(s)",
    "data": {
        "page": {
            "count": 1,
            "number": 1
        },
        "total": "1",
        "responses": [
            {
                "from": "+614NNNNNNNN",
                "body": "Received ",
                "received_at": "2019-04-08 17:37:49",
                "original_body": "Please reply Thank You",
                "original_message_id": "4455438", // Outbound ID
                "message_id": "dba864ec-e486-4647-82c4-d0b94771080b", // Response Message ID(inbound_id)
                "subaccount_id": "" // Sub account email address
            }
        ]
    }
}

Error Responses

Status Code Description
AUTH_FAILED 400 You are not a registered user
NOT_FOUND 400 No Response are available!

Error Responses looks like:

{
    "meta": {
        "code": 401,
        "status": "AUTH_FAILED"
    },
    "msg": "APPKEY you have provided is invalid",
    "data": []
}

PHP Code Example

You can call following function to get MMS responses.

function getMmsResponses($page = 1) {
    try {
        $url = 'https://cellcast.com.au/api/v3/get-responses?page=' .$page .'&type=mms'; //API URL
        $headers = array(
            'APPKEY: <<APPKEY>>',
            'Accept: application/json',
            'Content-Type: application/json',
        );

        $ch = curl_init(); //open connection
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_TIMEOUT, 4);
        if (!$result = curl_exec($ch)) {
            $response_error = json_decode(curl_error($ch));
            return json_encode(array("status" => 400, "msg" => "Something went to wrong, please try again", "result" => $response_error));
        }
        curl_close($ch);
        return json_encode(array("status" => 200, "msg" => "Successfully received", "result" => json_decode($result)));

    } catch (\Exception $e) {
        return json_encode(array("status" => 400, "msg" => "Something went to wrong, please try again.", "result" => array()));
    }
}
                                

Call Function

//Call function to get mms status function
$response_status = getMmsResponses(<<page_number>>);
                                

inbound-read

Base URL:

https://cellcast.com.au/api/v3/inbound-read
Method: POST

Parameters

Header Parameters Description
APPKEY Please add provided APPKEY. Which is linked to your cellcast account
Content-Type application/json

API Parameters

Name Example Description
message_id Response of Message ID The Message ID for the inbound message. We are consider first "message_id" parameter.
date_before Date timestamp An optional timestamp - mark all as read before this timestamp. If not given, all messages will be marked as read.

You can use one parameter at a time. If you want to change status using message_id then you just need to pass message_id. If you want to mark all as read before given timestamp then you can pass only "date_before" parameter.

You can set the status of inbound messages of your account.


Success Responses

Code Status Description
200 SUCCESS You have <<Total Responses>> response(s)

Success Responses looks like:

{
    "meta": {
        "code": 200,
        "status": "SUCCESS"
    },
    "msg": "Inbound messages have been marked as read.",
    "data": []
}

Error Responses

Status Code Description
AUTH_FAILED 400 You are not a registered user

Error Responses looks like:

{
    "meta": {
        "code": 401,
        "status": "AUTH_FAILED"
    },
    "msg": "APPKEY you have provided is invalid",
    "data": []
}

PHP Code Example

You can call following function to get MMS responses.

function setMmsInboundStatus($message_id) {
    try {
        $url = 'https://cellcast.com.au/api/v3/inbound-read'; //API URL
        $fields = array(
            'message_id' => $message_id, //here goes your inbound message ID
        );

        // If you want to mark all inbound message as read optionally before a certain date.
        //$fields = array(
        //    'date_before' => $date_before, //here goes your inbound message ID
        //);

        $headers = array(
            'APPKEY: <<APPKEY>>',
            'Accept: application/json',
            'Content-Type: application/json',
        );

        $ch = curl_init(); //open connection
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, count($fields));
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        if (!$result = curl_exec($ch)) {
            $response_error = json_decode(curl_error($ch));
            return json_encode(array("status" => 400, "msg" => "Something went to wrong, please try again", "result" => $response_error));
        }
        curl_close($ch);
        return json_encode(array("status" => 200, "msg" => "Successfully set status", "result" => json_decode($result)));
    } catch (\Exception $e) {
        return json_encode(array("status" => 400, "msg" => "Something went to wrong, please try again.", "result" => array()));
    }
}
                                

Call Function

//Call function to get mms status function
$response_status = setMmsInboundStatus(<<message_id>>);
                                

MMS character count

What is the structure of an MMS?

  • Subject Line: 40 characters max
  • Creative: Image, gif
  • Message Copy: 1000 characters max

When sending text and pictures in the same message, a message can contain up to 1 image and 1000 characters.

You can send the maximum subject length of 40 characters.

Please note, some special characters(Unicode charset) count for more than 1 character in a text message, which can affect character count (and therefore, size) in messages


What characters are part of the Unicode charset?

The Unicode character list contains symbols from the Cyrillic, Chinese, Arabic, Korean and Hangul alphabets. It also contains several special symbols (such as emoticons, emoji and kanji).

Unicode character list: here


GSM Charset: The GSM 03.38 charset is the standard character set for text messaging on GSM-based cell phones. All GSM handsets and network elements support the GSM 7-bit alphabet. The basic GSM charset contains the letters A to Z (uppercase and lowercase), numbers, special symbols and several symbols from the Greek alphabet.

@	Δ	SP	0	¡	P	¿	p
£	_	!	1	A	Q	a	q
$	Φ	"	2	B	R	b	r
¥	Γ	#	3	C	S	c	s
è	Λ	¤	4	D	T	d	t
é	Ω	%	5	E	U	e	u
ù	Π	&	6	F	V	f	v
ì	Ψ	'	7	G	W	g	w
ò	Σ	(	8	H	X	h	x
Ç	Θ	)	9	I	Y	i	y
LF	Ξ	*	:	J	Z	j	z
Ø	ESC	+	;	K	Ä	k	ä
ø	Æ	,	<	L	Ö	l	ö

Escape Characters: Some characters in the GSM 03.38 extension table can only be used at the cost of two characters. The GSM charset uses 7-bit alphabet encoding, but the escape characters require 14 bits to encode, thus taking up two characters. These symbols are:  |, ^, {, }, €, [, ~, ] and \.

Unicode Symbols: Unicode is a standard for encoding, handling and representing the text expressed in many of the world’s writing systems. The latest list of Unicode symbols contains over 120,000 characters from multiple symbol sets and 129 historic and modern scripts.

Unicode Encoding: Compared to the GSM charset, Unicode encoding supports a huge range of languages and symbols. However, if your text message contains a symbol that isn’t in the 7-bit alphabet, UCS-2 encoding must be used. This type of encoding takes up a lot of space, thus reducing the number of characters allowed in a message to 70.

MMS Image requirements

Supported media types for MMS

MMS on Cellcast offers full support for common image file types: png, jpeg, and gif.

For sending MMS messages, please review Cellcast's Accepted Content Types for Media for fully supported media file support.

Total message size must be under 380kb. An API request with media and Content larger than 380kb will fail with an error.

For the following media file types, please contact your account manager: mpg4, mp3


The following types of content are fully supported by Cellcast for Media. This content will be formatted for delivery on destination devices.

  1. image/jpeg
  2. image/gif
  3. image/png
  4. vcf
  5. mid

NOTE : Please pass the media URL(mms_file) accessible / downloadable. If you have not received the correct MMS with the media, please check your media URL file permission / server security in your server.

Mobile format

Australian Mobile format

You can send an MMS to any Australian Mobile number.

Allocation for numbers in the range 04xy z00 000 – 04xy z99 999


Valid Mobile Numbers format:

  1. +614NNNNNNNN
  2. 04NNNNNNNN

Help

Contact us

Email: info@cellcast.com.au
Melbourne Head Office:
40 Porter St, Prahran, VIC 3181, Australia
Australia & NZ: +61 (03) 8560 7025


Get in touch, send us a message to arrange a coffee catch-up