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 which can be made by each account to 15 calls per sec. For heavy users we can increase your throttling speed, but please contact us to discuss your requirements. 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. 25 responses will be returned per page.


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 - linked to your Cellcast account.
Content-Type application/json

MMS Data Parameters

Name Example Description
subject MMS subject goes here string - Optional 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 1000 numbers to send an MMS in one API call
- Required field

Successful Responses

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

Successful Responses look like:

{
    "meta": {
        "code": 200,
        "status": "SUCCESS"
    },
    "msg": "Queued",
    "data": {
        "messages": [
            {
                "message_id": "A21741CB-9B8E-3956-A1CE-NNNNNNNNNN",
                "to": "+614NNNNNNNN",
                "subject": "MMS subject here",
                "body": "MMS body here",
                "date": "2019-06-24 21:24:32",
                "direction": "out"
            }
        ],
        "total_numbers": 2,
        "success_number": "2",
        "credits_used": "2"
    }
}

Error Response

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 look 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 // Your numbers array goes here
        );
        $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" => "MMS sent successfully", "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 - 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

Successful 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.

Successful Responses look 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": "A21741CB-9B8E-3956-A1CE-NNNNNNNNNN", // Outbound ID
                "message_id": "dba864ec-e486-4647-82c4-d0b94771080b", // Response Message ID(inbound_id)
                "subaccount_id": "" // Sub account email address
            }
        ]
    }
}

Error Response

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

Error Responses look 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 - 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.


Successful Responses

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

Successful Responses look like:

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

Error Response

Status Code Description
AUTH_FAILED 400 You are not a registered user

Error Responses look 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>>);
                                

Get Optout

Base URL:

https://cellcast.com.au/api/v3/get-optout
Method: GET

Parameters

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

How do I activate the opt-out list via API?

- Select 'Settings' on the left menu, then select 'Inbound sms settings'.

- Select 'Active' from 'Opt-out for API' dropdown.



Successful Responses

Code Status Description
200 SUCCESS You have <<Total>> optout contact(s)

Successful Responses look like:

{
    "meta": {
        "code": 200,
        "status": "SUCCESS"
    },
    "msg": "You have 1 optout contact(s)",
    "data": {
        "page": {
            "count": 1,
            "number": 1
        },
        "total": "3",
        "responses": [
            {
                "number": "+61NNNNNNNNN",
                "first_name": "Peter",
                "last_name": "berg",
                "gender": "Male",
                "post_code": "6688",
                "dob": "2010-11-12",
                "created_at": null
            }
        ]
    }
}

Error Response

Status Code Description
AUTH_FAILED 400 You are not a registered user

Error Responses look 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 SMS responses.

function getOptoutList() {
    try {
        $url = 'https://cellcast.com.au/api/v3/get-optout'; //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 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 opt out list function
$response_status = getOptoutList();
                                

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

MMS Image Specification

  • Your image layout should be vertical as most mobile devices display vertically.
  • Media file types accepted - .jpg, .gif, .png, .mp4, .mp3, .pkpass, .vcf
  • File size of images should not exceed 380kb.
  • Best image dimensions are 327 pixels (height) and 400 pixels (width).
  • Image resolution should be 72 pixels.
  • Subject line is 40 characters – use it wisely!
  • Keep additional text to less than 500 words for better readability. (up to 1000 available)
  • Use .GIF format for animated images.
  • File size for GIF formats should be below 380kb.

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

Postman Collection

Importing data into Postman

You can import Cellcast collections specifications directly into Postman

To import your data into Postman:
1. Select Import in the left navigation menu.
2. Select Cellcast Collection JSON file.
3. Select Import to bring your data into Postman

Cellcast V3 Collection: Download

Help

Contact us

Email: info@cellcast.com
Melbourne Office:
Level 2, 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