Connection to the SMS-gateway, API

You can connect to our SMS-gateway free of charge, no prior activation is needed. SMS-gateway allows to launch automatic SMS delivery and integrate SMS mailing with any project.


SMPP-gateway

The gateway corresponds to all standards of SMPP v3.4. protocol. If you want to test the gateway, please contact our managers.


HTTP-gateway

The connection with service is achieved through sending HTTP-query to an indicated service address via HTTP protocol (GET/POST methods). Content check and encoding validity are not available.

Each query may consist of the delivered messages and/or status requests.

Sending SMS messages

    Service address:
  • https://gate.smsclub.mobi/token/

You can send messages by setting the parameters below (they are the same for SMPP and HTTP):

  • username – login of your user account;
  • token – token of your user account (you can find it in profile);
  • from – A-name, identifying the sender's id (11 Latin characters, numbers, space);
  • to – a list of recipients, separated with «;» (this symbol is not used after the last recipient);
  • text – a message written in Windows-1251 encoding, it is decoded into Base64 before being sent;
  • lifetime – setting a SMS life expectancy (in min).

Limitations:

  • for printed symbols (ASCII 0x01-0x7E) total length should not exceed 1071 characters;
  • the maximum length for symbols beyond that range is 469 characters.

Reports

For a received query the service returns either an error-report in Russian language or a text of similar type:

=IDS START=
000002
000003
=IDS END=
=IDS START=, =IDS END= - there will be a list of messages' IDs between these two codes, each ID in a new line (separated by the tag <br/>).

The list order corresponds to the order of recipients. If the message consists of several parts, the ID list would show SMS-parts that are sent consecutively to one recipient, then ID list of SMS-parts for the next recipient etc.

Query for SMS status

  • GET, POST methods: https://gate.smsclub.mobi/b/state.php

SMS statuses contain information about current delivery situation. They are updated regularly, and the query for SMS status can be sent any time. You can send query by setting the parameters below (they are the same for both methods):

  • username – login of your user account;
  • token – token of your user account;
  • smscid – a list of IDs, separated with «;» (this symbol is not used after the last ID).

For a received query the service returns either an error-report in Russian language or a text of similar type:

=IDS START=
ID_1: STATE
ID_2: STATE
…
ID_N: STATE
=IDS END=

=IDS START=, =IDS END= - there will be a list of messages' IDs and corresponding statuses (after a symbol ":") between these two codes, each ID in a new line (separated by the tag <br/>).

Codes of SMS statuses

The following codes are used to inform about SMS statuses:

  • ENROUTE – message accepted;
  • DELIVRD – message delivered;
  • FAILED – unable to deliver a message;
  • EXPIRED – the storage time of a message has expired;
  • UNDELIV – undeliverable message (the phone number might be turned off, connection failure or the number is added to a black list);
  • NOREPORT – delivery report is pending;
  • REJECTD - отклонено.

Examples of Get-query about SMS sending:

https://gate.smsclub.mobi/token/?username=user&token=user_token&from=SMS CLUB&to=380675126767&text=Hello from SMS CLUB

Examples of Get-query about SMS delivery:

https://gate.smsclub.mobi/token/state.php?username=user&token=user_token&smscid=000000

Online check of balance account

This method allows you to check current balance account and customer credit limit.

Examples of Get-request about balance account.

https://gate.smsclub.mobi/token/httpgetbalance.php?username=user&token=user_token

Example of code for a balance account check:

<?php
    $ch = curl_init();
    $login = '380501234567';
    $token = '123456';
    $url = "https://gate.smsclub.mobi/http/httpgetbalance.php?username=$login&token=$token";
    //or via POST
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_URL,$url);
    $result = curl_exec($ch);
    echo $result;
?>


XML-gateway

The connection with service is achieved through sending XML-query in UTF-8 encoding to an indicated service address via HTTP protocol (POST method). Content check and encoding validity are not available.

Each query may consist of the delivered messages and/or status requests.

SMS mailing (single and bulk)

Service address:
https://gate.smsclub.mobi/xml/

SMS mailing is provided using the XML-structure below. All data in tags is framed with the following tag: <![CDATA[]]>:

<?xml version='1.0' encoding='utf-8'?>
<request_sendsms>
      <username><![CDATA[username]]></username>
      <password><![CDATA[password]]></password>
      <from><![CDATA[XML]]></from>
      <to><![CDATA[380501111111;380502222222]]></to>
      <text><![CDATA[Пример русского ЮТФ-8 текста]]></text>
</request_sendsms>
  • username – login of your user account;
  • password – password of your user account;
  • from – A-name, identifying the sender's id (11 Latin characters, numbers, space);
  • to – a list of recipients, separated with «;» (this symbol is not used after the last recipient);
  • text – a message written in UTF-8 encoding.

Limitations:

  • for printed symbols (ASCII 0x01-0x7E) total length should not exceed 1071 characters;
  • the maximum length for symbols beyond that range is 469 characters;
  • if you send a XML structure to the server of www.gate.smsclub.mobi, then it must contain no spaces or enter signs!!!

For a received query the service returns a XML-structure of similar type:

<?xml version="1.0" encoding="utf-8"?>
<response>
       <status>STATUS</status>
       <text>RESULT_TEXT</text>
       <ids>
       <mess>ID_1</mess>
       <mess>ID_2</mess>
         …
       <mess>ID_N</mess>
       </ids>
</response>
  • status – OK (successful operation) / ERROR (an error has occured);
  • text – text message about the result of the operation;
    You will see No. of SMS and parts if a status is OK.
    You will see the explanation in case of an ERROR status (Example: "login/password do not match").
  • ids – contains IDs of messages, assigned by SMSC;
    The list order corresponds to the order of recipients. If the message consists of several parts, the ID list would show consecutively sent SMS-parts to one recipient, then ID list of SMS-parts for the next recipient etc.
  • mess – contains IDs of messages/parts of messages.

Sending personalized massages (single and bulk)

Service address:
https://gate.smsclub.mobi/xml/individual.php

Personalized mailout means sending SMS messages with an individual text for each recipient. Personalized SMS mailing is provided using the XML-structure below. All data in tags is framed with the following tag . Each separate SMS is a sequence of data in tags <to> and <text>:

SMS mailing is provided using the XML-structure below. All data in tags is framed with the following tag:

<?xml version='1.0' encoding='utf-8'?>
<request_sendsms>
      <username><![CDATA[username]]></username>
      <password><![CDATA[password]]></password>
      <from><![CDATA[XML]]></from>
      <to><![CDATA[380675126767]]></to>
      <text><![CDATA[Пример русского текста ЮТФ-8]]></text>
      ...
      <to><![CDATA[380997777662]]></to>
      <text><![CDATA[Example of text in UTF-8]]></text>
</request_sendsms>
  • username – login of your user account;
  • password – password of your user account;
  • from – A-name, identifying the sender's id (11 Latin characters, numbers, space);
  • to – recipient's phone number;
  • text – a message tag written in UTF-8 encoding.

Limitations:

  • for printed symbols (ASCII 0x01-0x7E) total length should not exceed 1071 characters;
  • the maximum length for symbols beyond that range is 469 characters;
  • if you send a XML-structure to the server of www.gate.smsclub.mobi, then it must contain no spaces or enter signs!!!

For a received query the service returns a XML-structure of similar type:

<?xml version="1.0" encoding="utf-8"?>
<response>
       <status>STATUS</status>
       <text>RESULT_TEXT</text>
       <ids>
       <mess>ID_1</mess>
       <mess>ID_2</mess>
         …
       <mess>ID_N</mess>
       </ids>
</response>
  • status – OK (successful operation) / ERROR (an error has occurred);
  • text – text message about the result of the operation;
    You will see No. of SMS and parts if a status is OK.
    You will see the explanation in case of an ERROR status (Example: "login/password do not match").
  • ids – contains IDs of messages, assigned by SMSC;
    The list order corresponds to the order of recipients. If the message consists of several parts, the ID list would show consecutively sent SMS-parts to one recipient, then ID list of SMS-parts for the next recipient etc.
  • mess – contains IDs of messages/parts of messages.

Query for SMS statuses

Service address:
https://gate.smsclub.mobi/xml/state.php

SMS statuses contain information about current delivery situation. They are updated regularly, and the query for SMS status can be sent any time. The status query is provided using the XML-structure below. All data in tags is framed with the following tag :

<?xml version="1.0" encoding="utf-8"?>
<request_getstate>
            <username><![CDATA[user]]></username>
            <password><![CDATA[pass]]></password>
            <smscid><![CDATA[000000;000001;000002;000003]]></smscid>
</request_getstate>
  • username – login of user account;
  • password – password of user account;
  • smscid – a list of IDs, separated with «;» (this symbol is not used after the last ID).

The service sends back a XML-structure containing statuses of the requested messages or error codes of similar type:

    <?xml version="1.0" encoding="utf-8"?>
        <response>
        <status>OK</status>
        <text></text>
        <entries>
                 <entry>
                         <smscid>ID_1</smscid>
                         <state>STATE</state>
                 </entry>
                 <entry>
                         <smscid>ID_2</smscid>
                         <state>STATE</state>
                 </entry>
                 …
                <entry>
                        <smscid>ID_N</smscid>
                        <state>неверно указан id</state>
                </entry>
         </entries>
</response>
  • status – OK (successful operation) / ERROR (an error has occured);
  • text – text message about the result of the operation;
    You will see No. of SMS and parts if a status is OK.
    You will see the explanation in case of an ERROR status (Example: "login/password do not match").
  • entries – contains IDs of messages, assigned by SMSC, and their corresponding statuses;
    Might be absent in case of an error.
  • entry – contains ID of a single messages and its status.
  • smscid – a list of IDs, separated with «;» (this symbol is not used after the last ID).
  • state – corresponding status.

Codes for SMS statuses.

The following codes are used to inform about SMS statuses:

  • ENROUTE – message delivered;
  • DELIVRD – unable to deliver a message;
  • EXPIRED – the storage time of a message has expired;
  • UNDELIV – undeliverable message (the phone number might be turned off, connection failure or the number is added to a black list);
  • NOREPORT - delivery report is pending;
  • REJECTD - a message has been rejected by mobile provider.

An example of XML-query code.

This code has been tested so we guarantee positive result. There is no information about using other codes.

PHP-version:

    <?php
      $xml = "
      <?xml version='1.0' encoding='utf-8'?>
      <request_sendsms>
            <username><![CDATA[username]]></username>
            <password><![CDATA[password]]></password>
            <from><![CDATA[XML]]></from>
            <to><![CDATA[380675126767]]></to>
            <text><![CDATA[Пример русского ЮТФ-8 текста]]></text>
      </request_sendsms>";
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_POST, true);
      curl_setopt($ch, CURLOPT_POSTFIELDS, array("xmlrequest" => $xml));
      curl_setopt($ch, CURLOPT_URL, 'https://gate.smsclub.mobi/xml/');
      $result = curl_exec($ch);
      echo $result;
    ?>


Download scripts

Here you can download examples of scripts for a particular gateway

Method HTTP XML
Single       java pearl
Bulk
Individual
Balance account
Reports
TOP