HTTPS Specification

Using HQSMS HTTPS API interface you will be able to inegrate most of on-line applications.

HTTPS specification 3.0 (pdf version)

  • 1. Examples of sending SMS in PHP.

    Example 1 - Sending SMS using GET method.
    <?php
    $params 
    = array(
        
    'username' => 'username',          //username used in HQSMS
        
    'password' => md5('password'),     
        
    'to'       => '44123123123',       //destination number
        
    'from'     => "sender",            //sender name have to be activated
        
    'message'  => "content of message",
    );
    if (
    $username && $password && $to && $message) {
        
    $data '?'.http_build_query($params);
        
    $file fopen('https://ssl.hqsms.com/api/sms.do'.$data,'r');
        
    $result fread($file,1024);
        
    fclose($file);
        echo 
    $result;
    }
    ?>

    Example 2 - Sending SMS using POST method.
    <?php
    $username 
    'login';                      //username used in HQSMS
    $password md5('password');               
    $to '44123123123';                      //destination number
    $from urlencode("HQSMS");                //sender name have to be activated
    $message urlencode("Message content");  
    $url 'https://ssl.hqsms.com/api/sms.do';
    $c curl_init();
        
    curl_setopt($cCURLOPT_URL$url);
        
    curl_setopt($cCURLOPT_POSTtrue);
        
    curl_setopt($cCURLOPT_POSTFIELDS'username='.$username.'&password='.$password.'&from='.$from.'&to='.$to.'&message='.$message);
        
    curl_setopt($cCURLOPT_RETURNTRANSFERtrue); 
        
    $content curl_exec ($c);
        
    curl_close ($c); 
    echo 
    $content;
    ?>
  • 2. Sending WAP PUSH messages.

    In order to send WAP PUSH message you should add UDH and datacoding parameter &udh=0605040b8423f0, &datacoding=bin and content should be converted to binary. You can use our Tools to convert WAP PUSH message.
    Example:
    <?php
    $params 
    = array(
        
    'username' => 'username'//username used in HQSMS
        
    'password' => md5('password'),     
        
    'to' => '44123123123'//destination number
        
    'from' => "sender"//sender name have to be activated
        
    'udh' => '0605040b8423f0'//UDH header of WAP Push message
        
    'datacoding' => 'bin'//switching message to binary
        //Binary message:
        
    'message' => '60601ae02056a0045c60c037777772E736D736170692E7
        06C000701035A61707261737A616D7920646F20736D734150492E706C000101'
    ,
    );
    if (
    $username && $password && $to && $message) {
        
    $data '?'.http_build_query($params);
        
    $file fopen('https://ssl.hqsms.com/api/sms.do'.$data,'r');
        
    $result fread($file,1024);
        
    fclose($file);
        echo 
    $result;
    }
    ?>
  • 3. Sending vCard messages.

    In order to send vCard message you should add UDH and datacoding parameter &udh=06050423f40000, &datacoding=bin and content should be converted to binary. You can use our Tools to convert vCard message.
    Example:
    <?php
    $params 
    = array(
        
    'username' => 'username'//username used in HQSMS
        
    'password' => md5('password'),     
        
    'to' => '44123123123'//destination number
        
    'from' => "sender"//sender name have to be activated
        
    'udh' => '06050423f40000'//UDH header of vCard message
        
    'datacoding' => 'bin'//switching message to binary
        //Binary message:
        
    'message' => '424547494E3A56434152440D0A56455253494F4E3A322E310D0A464E3A4851534D53205
        36572766963650D0A4E3A536572766963653B4851534D533B3B3B0D0A54454C3B505245463B43454C4C3A343
        8203332203732302036392031300D0A454D41494C3B494E5445524E45543A737570706F7274406871736D732
        E636F6D0D0A55524C3A7777772E6871736D732E636F6D0D0A454E443A5643415244'
    ,
    );
    $data '?'.http_build_query($params);
    $plik fopen('https://ssl.hqsms.com/api/sms.do'.$data,'r');
    $wynik fread($plik,1024);
    fclose($plik);
    echo 
    $wynik;
    ?>
  • 4. Sending scheduled messages.

    In order to send message with schedlued time you need to use &date=unixtime parameter, date should be convertet to unixtime. You can use generator on our Tools page or use strtotime() PHP function. Messages can be scheduled up to 3 month from now.
    Example:
    <?php
    $params 
    = array(
        
    'username' => 'username'//username used in HQSMS
        
    'password' => md5('password'),     
        
    'to' => '44123123123'//destination number
        
    'from' => "sender"//sender name have to be activated
        
    'message' => "content of message",
        
    'date' => strtotime('2012-03-25 11:00'), //Date when message should be sent
    );
    if (
    $username && $password && $to && $message) {
        
    $data '?'.http_build_query($params);
        
    $file fopen('https://ssl.hqsms.com/api/sms.do'.$data,'r');
        
    $result fread($file,1024);
        
    fclose($file);
        echo 
    $result;
    }
    ?>