Welcome
Login Buy Now Free Gateway Trial Call Sales at 480.515.5200 Please enter a value in the search box

This content requires the Flash Player (version 8 or higher) Please click here to download the latest Flash player. If you already have the latest Flash player, try clicking here
  • Home
  • Products
    • SMS Gateway    
    • Secure SMS
    • Secure Wallet
    • FlightAssist
  • Solutions
    • Mobile Carriers
    • Mobile Banking & Finance        
    • Mobile Marketing
    • Mobile Government
    • Mobile Healthcare
    • Mobile Education
    • Mobile Real Estate
    • Mobile Air Travel
  • Developers
  • Partners
    • Overview
    • Technology Partners
    • Valued Partners
    • Value Added Resellers
    • System Integrators
    • Carriers
    • Handset Manufacturers
  • Services
    • Mobile Strategy Advisory
    • Educational Services
    • Professional Services
  • Media
    • News Room
    • Press Releases
    • Awards
    • In the News
    • Events
    • OPTiN Today Blog
  • Support
    • Support Center
    • Products Support 
      • SMS Gateway
      • SecureSMS
      • SecureWallet
      • FlightAssist
      • CampusReact
    • FAQ & Forums
  • Contact Us
  • About
    • Executive Team
    • Customers
    • CellTrust® Today
    • Brand & Values
    • Milestones
    • Security Focused
    • Social Responsibility
    • Industry Affiliations
    • Careers
    • Investor Relations

CellTrust Secure SMS Gateway API (HTTPS) - Sample Code



You can use HTTPS protocol to connect to the CellTrust SMS Gateway. It supports two way messaging and connects to any application, including static websites with HTML pages. Only one line of HTML code is required to send messages once you register and obtain a username. To receive messages, the CellTrust SMS Gateway will perform a FORM-POST with message content to your web servers.

Sending message via HTTPS - GET (from your servers to mobile devices), PHP sample code


//your username and nickname are GENERALLY the same, when in doubt, try username for both fields
$USERNAME = "YOURUSERNAME";
$PASSWORD = "YOURPASSWORD";
$NICKNAME = "TOURNICKNAME";

//PHONE DESTINATION/NUMBER TO SEND MESSAGE TO (BE SURE TO INCLUDE COUNTRYCODE)
$SMSDESTINATION ="14805551212";

//SPECIFIES WHETHER MESSAGE CAN BE DELIVERED EVEN IF NO AGENT INSTALLED
$ALLOWINSECURE = "TRUE";

//SPECIFIES WE WANT TO RECEIVE READ AND DELIVERY ACK’S FROM AGENT
$READACK = "TRUE";

//URL TO POST TO FOR API – PLEASE DON’T EDIT
$URL = "https://www.primemessage.net/TxTNotify/SecureSMS?";

//PARAMETERS TO BE POSTED TO URL USED IN API
$DATA = "Username=".$USERNAME."&Password=".$PASSWORD."&Nickname="
.$NICKNAME."&SMSDestination=".$SMSDESTINATION.
"&Message="Test+message"."&AllowInsecure=".$ALLOWINSECURE;

//CALL FUNCTION, AND PRINT OUT SERVERS RESPONSE
echo do_post_request($URL, $DATA);

//should work in PHP 4 and 5
function do_post_request($url, $data, $optional_headers = null) {
   $start = strpos($url,'//')+2;
   $end = strpos($url,'/',$start);
   $host = substr($url, $start, $end-$start);
   $domain = substr($url,$end);
   $fp = pfsockopen($host, 80);
   if(!$fp) return null;
   fputs ($fp,"POST $domain HTTP/1.1\n");
   fputs ($fp,"Host: $host\n");
   if ($optional_headers) {
      fputs($fp, $optional_headers);
   }
   fputs ($fp,"Content-type: application/x-www-form-urlencoded\n");
   fputs ($fp,"Content-length: ".strlen($data)."\n\n");
   fputs ($fp,"$data\n\n");
   $response = "";
   while(!feof($fp)) {
      $response .= fgets($fp, 1024);
   }
   fclose ($fp);
   return $response;
}
?>

SecureSMS
SecureSMS Micro Client
SecureSMS Gateway
SecureSMS SDK
Implementation Models
White Label



Micro Client Installation

Download Now
Supported Phones
Installation Guide
Web Installation
PC Installation
Flash Memory Card Installation



Take a Tour
Development Kit
SecureSMS Brochure
  SecureSMS Forums





SecureSMS Support Page
HTTPS Sample Code


Privacy Policy    Terms of Use    Anti Spam Policy    Industry Affiliations    Partner Options    RSS Feeds

Sitemap    © Copyright 2008 CellTrust® Corporation, All Rights Reserved