Send Message with SMS API or MMS API

The Connective Mobile API allows you to send an SMS or MMS using a REST based Web Service Interface.

Base Url

All URLs referenced in the documentation have the following base:
https://sms.connectivemobile.com/api/2.0/

The API is served over HTTPS. To ensure data privacy, unencrypted HTTP access is not permitted.

Send SMS or MMS

Sending a message is accomplished by POST-ing to the base URL.

https://sms.connectivemobile.com/api/2.0/

POST Parameters

All Parameters are required

To – The message destination phone number. Any valid mobile phone number will work. 10 Digits.

From – The Number (Shortcode) the message will be sent from. 5 or 6 Digits depending on your Shortcode.

Body – The message you want to send. SMS is limited to 160 characters. May be empty

MediaUrl – The URL of the media to be sent with the message. (Must be jpg, png, or gif) May be empty.

API_Key – The API Key associated with your account.

Keyword – The Keyword this message will be sent from.

SMS,MMS API Response

All calls to the SMS,MMS API will return a json encoded array with an error number and error message response.

{"error_number":"0","error_message":"11-1418791791.3425-16420"}

Response numbers and error codes can be looked up on the API Error Codes page.

PHP Example


$params = array();
$params['To'] = 'ENTER 10 DIGIT PHONE NUMBER HERE';
$params['From'] = 'ENTER SHORTCODE HERE';
$params['Body'] = 'ENTER MESSAGE BODY HERE';
$params['MediaUrl'] = 'ENTER MEDIA URL HERE';
$params['Keyword'] = 'ENTER KEYWORD HERE';
$params['API_Key'] = 'ENTER API KEY HERE';
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,'https://sms.connectivemobile.com/api/2.0/');
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$params);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch,CURLOPT_HEADER,0); // DO NOT RETURN HTTP HEADERS
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); // RETURN THE CONTENTS OF THE CALL
$received_data = curl_exec($ch);
if (curl_errno($ch)) {
echo curl_error($ch);
} else {
echo $received_data;
}
curl_close($ch);