NAV Navbar
shell php

documentation

  • 1. Introduction
  • 2. Single SMS
  • 3. Bulk SMS
  • 4. SMS templates
  • 5. mail2sms
  • 6. Account balance
  • 7. Delivery confirmation
  • 8. HLR Lookup
  • 9. User accounts administration
  • 10. Sender names
  • 11. Price list
  • 12. Special characters
  • Delivery statuses
  • Error codes
  • 7-bit GSM alphabet
  • Encoding
  • Integrations
  • 1. Introduction

    SMSAPI is a high quality SMS platform which enables you to integrate any of your applications with our SMS message sending and receiving system. The main advantage of our system is its simplicity of implementation. The SMS message may have your company name or any phone number that you own as sender name. Every message sent from our system has its own unique id which allows you to receive its delivery confirmation

    1.1 How to start

    To start using SMSAPI you need to create an account on our website SMSAPI . Registration is completely free of charge. Your account is ready to use just after registration, but we recommend you to verify at least one sender name or number. Every message sent before validation has the „INFO“ as a default name.

    1.2 IP filter for API interface

    In order to improve interface API protection you may set list of IP addresses which will be whitelisted. You may do it in webside IP addresses filter . It will be possible to send messages only from these whitelisted IP addresses (attempts of sending from other IPs will result in responding: ERROR:105). IP addresses should be separated by semicolon.

    1.3 Authentication

    Example:

    POST /sms.do HTTP/1.1
    Host: api.smsapi.com
    Authorization: Bearer <access_token>
    

    We recommend OAuth 2.0 authentication. To use OAuth please generate new token with selected scopes in our customer panel OAuth Tokens .

    New header will be necessary in request to our API .

    If your environment doesn't support headers modification please add to request parameter access_token with it's value. Please note that this is not recommended authorization alternative and less secure.

    1.4 Libraries

    Using SMSAPI libraries prepared and developed by our programmers allows for much faster and easier integration. All available libraries are hosted at GitHub.

    Programming language Github link:
    PHP PHP library
    C# .net C# library
    Bash Bash library
    Python Python library
    JavaScript (node.js) JavaScript (node.js) library
    Java Java library

    2. Single SMS

    Example request:

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sms.do?\
    from=sender_name&\
    to=44123456789&\
    message=message_content&\
    format=json"
    
    <?php
    $params = array(
        'access_token'  => 'token_smsapi',          //sms api access token
        'to'            => '4412334445566',         //destination number  
        'from'          => 'SMSAPI',                //sender name has to be active  
        'message'       => 'content of message',    //message content
    );
    if ($params['access_token']&&$params['to']&&$params['message']&&$params['from']) {
        $date = '?'.http_build_query($params);
        $file = fopen('https://api.smsapi.com/sms.do'.$date,'r');
        $result = fread($file,1024);
        fclose($file);
        echo $result;
    }
    ?>
    

    I. Examples of responses when &format = json parameter used:

    a) in case of success:

    
    {
        "count":1,
        "list": [
        {
            "id":"1460969715572091219",       //message id
            "points":0.16,                    //price of delivery
            "number":"44123456789",           //recipient number with country prefix
            "date_sent":1460969712,           //send date
            "submitted_number":"44123456789", //phone number in request
            "status":"QUEUE"                  //message status
        }
      ]
    }
    
    

    b) in case of failure:

    
     {
    "invalid_numbers":[
        {
        "number":"44123456789",             //recipient number with country prefix
        "submitted_number":"44123456789",   //phone number in request
        "message":"Invalid phone number"    //error description
        }
      ],
      "error":13,                           //error code
      "message":"No correct phone numbers"  //error description
    }
    
    

    II. Examples of responses without &format parameter:

    a) in case of success:

    OK:<ID>:<POINTS>
    OK:17101000090360359:0.165
    
    

    b)

    ERROR:<ERR>
    ERROR:102
    

    Messages should be sent as a HTTP GET or POST request to our system:

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    to Recipient's mobile phone number (i.e. 44123456789 ).
    group Name of the group from the contacts database to which message should be sent.
    message The message text. Content of one message is normally 160 characters per single SMS or 70 in case of using at least one special character (polish characters are considered to be special characters). The maximal message is set to 918 normal characters or 402 if special chars are used and it is being sent as one block of 6 messages joined together and charged as six messages Detailed information about special characters are given in chapter 9.
    from Name of the sender. As a default the sender name is set to „INFO”. Only verified names are being accepted (&from=active_name). Sender name may be set after logging into web panel on https://ssl.smsapi.com/ in SETTINGS → SENDER NAMES.
    encoding This parameter describes the encoding of the message text. UTF-8 is set as default. If another encoding is needed parameter encoding should have following value: for iso-8859-2 (latin2) – it should be &encoding=iso-8859-2 for Windows-1250 – it should be &encoding=windows-1250
    flash Sending a message in flash mode can be activated by setting this parameter to „1”. Flash SMS are automatically presented on the mobile screen and have to be manually saved to be stored in inbox. (&flash=1)
    test When parameter test is set to „1” message won't be sent but response will be displayed, there is no charge for such test messages. (&test=1)
    details When details parameter is set to „1” more details in response will be displayed (message length and sms count). (&details=1)
    date Date in UNIX timestamp (&date=1287734110) or in ISO 8601 (&date=2012-05-10T08:40:27+00:00) when message will be sent (&date=1287734110). Setting a past date will result in sending message instantly.
    date_validate When parameter date_validate is set to „1” checks if date if given in proper format. Returns ERROR:54 if not.
    datacoding This parameter allows to send binary messages. (&datacoding=bin) Parameters udh and message should be given as HEX (for example message=616263 if you want to send abc).
    udh UDH header required when parameter &datacoding=bin is used, for WAP PUSH messages udh should have value &udh=0605040b8423f0
    allow_duplicates When parameter allow_duplicates is set to „1” allows to send message to duplicated numbers in one request (useful i.e. for parametrized message contents)
    idx Optional custom value sent with SMS and sent back in CALLBACK (i.e. &idx=123).
    check_idx When parameter check_idx is set to „1” prevents from sending more than one message with the same idx in last 24h. When this parameter is set and message with the same idx was already sent error 53 is returned.
    max_parts Defines maximum message parts allowed, maximum value allowed is 6. ERROR:12 will be returned when the message has more parts than defined. Default value can be set in customers panel.
    nounicode When parameter nounicode is set to „1” prevents from sending messages containing special characters. ERROR: 11 will be returned when the message contains special characters.
    normalize When parameter normalize is set to „1” special chars in message will be replaced with their equivalents (ê-e, ñ-n, ý-y ...).
    fast Setting this parameter to „1” will result in sending message with the highest priority which ensures the quickest possible time of delivery. Fast messages costs 50% more than normal message. Attention! Mass and marketing messages must not be sent with fast parameter.
    expiration_date Message expiration date (in UNIX timestamp or in ISO 8601) is a date after which message won't be delivered if it wasn't delivered yet. The difference between date sent and expiration date shouldn't be less than 15 minutes and more than 72 hours (we recommend using minimum 1 hour and maximum 12 hours difference). Time will be set with tolerance +/- 5 minutes.
    notify_url Parameter allows to set CALLBACK URL for message from request. This parameter may be used when there is no default CALLBACK URL for this user or when it should be different than default one (notify_url has higher priority than default callback).
    format Parameter &format=json causes, that response is sending in JSON format.

    required fields

    ID Message unique ID. You will need it for delivery confirmation. Length of this parameter in each request may vary, but it won't be more than 32 characters long.
    POINTS Amount of used credits (i.e. Text sent in 3 messages will return 3xSMS amount)
    ERR Error code (check the error code list Error Codes)

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com

    2.1 Fast messages (with highest priority)

    Example request :

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sms.do?\
    from=sender_name&\
    to=44123456789&\
    fast=1&message=Fast_message_content&\
    format=json"
    
    <?php
    $params = array(
        'username' => 'your_username',          //username from SMSAPI
        'password' => 'md-password',            //or 'password' => md5('open-text-password'),
        'to'       => '4412334445566',          //destination number  
        'from'     => 'SMSAPI',                 //sender name has to be active  
        'fast'     => '1',                      //fast sms 1 = true
        'message'  => 'content of message',     //message content
    );
    if ($params['username']&&$params['password']&&$params['to']&&$params['message']) {
        $date = '?'.http_build_query($params);
        $file = fopen('https://api.smsapi.com/sms.do'.$date,'r');
        $result = fread($file,1024);
        fclose($file);
        echo $result;
    }
    ?>
    

    Example correct response

    OK:<ID>:<POINTS>
    OK:17101000090360359:0.70
    

    Example response when error occur

    ERROR:<ERR>
    ERROR:102
    
    ID Message unique ID. You will need it for delivery confirmation.Length of this parameter in each request may vary, but it won't be more than 32 characters long.
    POINTS Amount of used credits (i.e. Text sent in 3 messages will return 3xSMS amount)
    ERR Error code (check the error code list Error Codes)

    Setting parameter fast to „1” (&fast=1) will result in sending message with the highest priority which ensures the quickest possible time of delivery. Fast messages costs 50% more than normal message.

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    2.2 Scheduled SMS

    Example request :

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sms.do?\
    to=44123456789&\
    date=1577878200&\
    message=scheduled_message_content&\
    format=json"
    
    <?php
    $params = array(
        'username' => 'your_username',          //username from SMSAPI
        'password' => 'md-password',            //or 'password' => md5('open-text-password'),
        'to'       => '4412334445566',          //destination number  
        'from'     => 'SMSAPI',                 //sender name has to be active  
        'date'     => '1577878200&',            //date in UNIX timestamp
        'message'  => 'content of message',     //message content
    );
    if ($params['username']&&$params['password']&&$params['to']&&$params['message']&&$params['date']) {
        $date = '?'.http_build_query($params);
        $file = fopen('https://api.smsapi.com/sms.do'.$date,'r');
        $result = fread($file,1024);
        fclose($file);
        echo $result;
    }
    ?>
    

    Response when correct

    OK:<ID>:<POINTS>
    

    Response when error occur

    ERROR:<ERR>
    

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    To send message at specified date and hour parameter date has to be used. This parameter should be in UNIX timestamp format.

    2.3 Deleting single scheduled messages

    Example request :

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sms.do?\
    sch_del=09040616088106874&\
    format=json"
    
    <?php
    $params = array(
        'username' => 'your_username',          //username from SMSAPI
        'password' => 'md-password',            //or 'password' => md5('open-text-password'),
        'sch_del'  => '09040616088106874'       //message id
    );
    if ($params['username']&&$params['password']&&$params['sch_del']) {
        $date = '?'.http_build_query($params);
        $file = fopen('https://api.smsapi.com/sms.do'.$date,'r');
        $result = fread($file,1024);
        fclose($file);
        echo $result;
    }
    ?>
    

    I. Examples of responses when &format=json parameter used :

    a) in case of success:

        {
            "count": 1,                          //quantity of messages to delete
            "list": [
                {
                    "id":"1462974172199599210"   //message id to delete
                }
            ]
        }
    

    b) in case failure:

        {
            "error": 301,                       //error code
            "messages": "Not "                  //error description
        }
    
    Parameter Description
    access_token OAuth token used to authenticate in our system.
    sch_del ID of message to delete (returned after sending one), for message to be deleted separate IDs with a comma.

    3. Bulk SMS

    Example request

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sms.do?\
    from=sender_name&\
    to=48500500500,48501501501,48502502502&\
    message=message&format=json\
    format=json"
    
    <?php
    $params = array(
        'username' => 'your_username',                                  //username from SMSAPI
        'password' => 'md-password',                                    //or 'password' => md5('open-text-password'),
        'to'       => '48500500500,48501501501,48502502502',            //destination number  
        'from'     => 'SMSAPI',                                         //sender name has to be active  
        'message'  => 'content of message',                             //message content
    );
    if ($params['username']&&$params['password']&&$params['to']&&$params['message']) {
        $date = '?'.http_build_query($params);
        $file = fopen('https://api.smsapi.com/sms.do'.$date,'r');
        $result = fread($file,1024);
        fclose($file);
        echo $result;
    }
    ?>
    

    I. Examples of responses when &format=json parameter used:

    a) in case of success:

        {
            "count": 3,
            "list": [
                {
                    "id":"1460978572913968440",
                    "points":0.16,
                    "number":"48500500500",
                    "date_sent":1460978579,
                    "submitted_number":"48500500500",
                    "status":"QUEUE"
                },
                {
                    "id":"1460978572913968450",
                    "points":0.16,
                    "number":"48501501501",
                    "date_sent":1460978579,
                    "submitted_number":"48501501501",
                    "status":"QUEUE"
                },
                {
                    "id":"1460978572913968460",
                    "points":0.16,
                    "number":"48502502502",
                    "date_sent":1460978579,
                    "submitted_number":"48502502502",
                    "status":"QUEUE"
                }
    
            ]
        }
    

    b) in case of failure:

        {
            "invalid_numbers": [
                {
                    "number":"456456456",
                    "submitted_number":"456456456",
                    "message":"Invalid phone number"
                },
                {
                    "number":"321321321",
                    "submitted_number":"321321321",
                    "message":"Invalid phone number"
                }
            ],
            "error":13,
            "message":"No correct phone numbers"
        }
    
    

    II. Examples of responses without &format parameter:

    a) in case of success

    OK:<ID>:<POINTS>:<PHONE>;...;...;...
    OK:17101000090567759:0.14:500500500;OK:171010000903455357:0.14:501500501;
    

    b) in case of failure:

    ERROR:<err>
    
    ID Message unique ID. You will need it for delivery confirmation. Length of this parameter in each request may vary, but it won't be more than 32 characters long.
    POINTS Number of used credits (i.e. Text sent in 3 messages will return 3xSMS amount)
    PHONE Recipient phone number

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    Sending messages to a group of recipients is similar to single submissions (presented in chapter 2). The only difference is filling field to with set of many recipients numbers (not only one number). In order to successfully send this type of message, we recommend to pass all parameters in a HTTP POST request just to assure that all recipients numbers will be submitted correctly.

    If the total cost of sending these messages is higher than the number of available credits on user's account, the system will respond with 103 error code and none of messages will be sent. If some of given recipients numbers are invalid (unrecognised by SMSAPI due to wrong prefix or because it is a landline number) than these numbers will be skipped and not include in bulk, messages will be sent to the rest of numbers. Delivery reports will not concern the skipped numbers. If any number will appear more than once in one request, message will be sent only once to this recipient.

    Notice that in multiple SMS sending recipients numbers are in response as well, and all message data are separate by a semicolon (after the last message there is semicolon as well).

    Recommended maximum number of messages sent in one request for POST method is 10000, for GET method it is 200 messages.

    3.1 SMS messages to numbers from contacts database group

    Example request:

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sms.do?\
    group=test_group&\
    message=Test message sent to contacts from contacts database – example custom field: [%contact.field name%]\
    format=json"
    
    <?php
    $params = array(
        'username' => 'your_username',          //username from SMSAPI
        'password' => 'md-password',            //or 'password' => md5('open-text-password'),
        'group'    => 'test_group',             //destination group  
        'from'     => 'SMSAPI',                 //sender name has to be active  
        'message'  => 'Test message sent to contacts from contacts database"',      //message content
    );
    if ($params['username']&&$params['password']&&$params['group']&&$params['message']) {
        $date = '?'.http_build_query($params);
        $file = fopen('https://api.smsapi.com/sms.do'.$date,'r');
        $result = fread($file,1024);
        fclose($file);
        echo $result;
    }
    ?>
    

    Example response:

    OK:<ID>:<POINTS>:<PHONE>;...;...;... 
    
    OK:17101000090567759:0.14:500500500;OK:171010000903455357:0.14:501500501;OK:17101000096577326:0.14:502502502;
    
    
    ID Message unique ID. You will need it for delivery confirmation. Length of this parameter in each request may vary, but it won't be more than 32 characters long.
    POINTS Number of used credits (i.e. Text sent in 3 messages will return 3xSMS amount)
    PHONE Recipient phone number

    It is possible to send messages to group of numbers from contacts database? In order to do that such group should be first created in web panel menu contacts database.

    You can insert own custom field into message content. Custom fields can be defined in Custom fields. To insert custom field into message use [%contact.field name%]. This expression will be replaced with corresponding value assigned to contact.

    3.2 Bulk personalized SMS sending using parameters

    Example request

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sms.do?\
    from=sender_name&\
    to=48600111222,48500111222&\
    message=Message content,parametr1:[%1%]parametr2:[%2%]&\
    param1=**John**|**Ann**&param2=**30**|**40**\
    format=json"
    
    <?php
    $params = array(
        'username' => 'your_username',              //username from SMSAPI
        'password' => 'md-password',                //or 'password' => md5('open-text-password'),
        'to'       => '48600111222,48500111222&'    //destination numbers
        'from'     => 'SMSAPI',                     //sender name has to be active  
        'message'  => 'Message content,parametr1:[%1%]parametr2:[%2%]&',        //message content
        'param1'   => 'John|Ann'
        'param2'   => '30|40'
    );
    if ($params['username']&&$params['password']&&$params['to']&&$params['message']) {
        $date = '?'.http_build_query($params);
        $file = fopen('https://api.smsapi.com/sms.do'.$date,'r');
        $result = fread($file,1024);
        fclose($file);
        echo $result;
    }
    ?>
    
    Message will have following contents:
    Message 1 :Message content, parametr1: **John** parametr2: **30**
    Message 2 :Message content, parametr1: **Ann** parametr2: **40**
    
    

    There is possibility to send up to 100 personalized messages in one request using personalization parameters. To send more personalized messages more than one request has to be used. Personalization parameters should be defined in request as param1, param2, param3, param4, which will replace tags [%1%], [%2%], [%3%] and [%4%] in message content. Values of these parameters have to be separated by pipe char „|” according to the template below:

    param1=Ann|Michael|Andrew&param2=Smith|Thomas|Davis

    The number of parameters has to be exactly the same as number of recipients in a request otherwise ERROR: 18 will be returned and messages won't be sent.

    If one of numbers will be invalid message to this number will be skipped and the rest will be sent.

    Parameters - After defining parameters the may be used in message content:

    Parameter Description
    [%1%] Value of parameter 1 (param1)
    [%2%] Value of parameter 2 (param2)
    [%3%] Value of parameter 3 (param3)
    [%4%] Value of parameter 4 (param4)

    3.3 Bulk SMS using IDX parameter

    There a possibility to send mass messages with custom parameter IDX different for each message. This parameter will be then returned in CALLBACK. With parameter idx additional parameter check_idx may be used(&check_idx=1). Using check_idx parameter prevents two messages to be sent with the same idx parameter value in scope of 24h. Example of using idx parameter:

    idx=idx1|idx2|idx3|idx4

    Number of IDX parameters has to be equal to the number of recipients numbers given in request.

    3.4 Messages with cut.li

    Example request

    
    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sms.do?\
    from=sender_name&\
    to=49500500500,42501501501,47502502502&\
    message=test_message_with_short link:_[%goto:www.smsapi.com%]_end\
    format=json"
    
    
    <?php
    $params = array(
        'username' => 'your_username',              //username from SMSAPI
        'password' => 'md-password',                //or 'password' => md5('open-text-password'),
        'to'       => '48600111222,48500111222&'    //destination numbers
        'from'     => 'SMSAPI',                     //sender name has to be active  
        'message'  => 'test_message_with_short link:_[%goto:www.smsapi.com%]_end',      //message content
    );
    if ($params['username']&&$params['password']&&$params['to']&&$params['message']) {
        $date = '?'.http_build_query($params);
        $file = fopen('https://api.smsapi.com/sms.do'.$date,'r');
        $result = fread($file,1024);
        fclose($file);
        echo $result;
    }
    ?>
    

    This function allows to use in SMS messages the shortened URL - http://cut.li, which will redirect the message recipient to URL which be added as parameter. In the SMS message, the URL should be added as parameter [%goto:url_address%] will be visible eg. as http://cut.li/ABCD (each recipient will receive unique end of link "/ABCD").

    4. SMS templates

    Example request

    
    Template name:          Notify
    Template content:       Hello [%1%], Your order has been sent. The shipment number is [%2%] You ma y follow it on our site. 
    
    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sms.do?\
    from=sender_name&\
    to=49500500500&\
    template=Notify&\
    param1=Mark&\
    param2=BG12344423\
    format=json"
    
    <?php
    $params = array(
        'username' => 'your_username',              //username from SMSAPI
        'password' => 'md-password',                //or 'password' => md5('open-text-password'),
        'to'       => '48600111222,48500111222&'    //destination numers
        'from'     => 'SMSAPI',                     //sender name has to be active  
        'template' => 'Notify'                      //template name
        'param1'   => 'Mark'
        'param2'   => 'BG12344423'
    );
    if ($params['username']&&$params['password']&&$params['to']&&$params['template']) {
        $date = '?'.http_build_query($params);
        $file = fopen('https://api.smsapi.com/sms.do'.$date,'r');
        $result = fread($file,1024);
        fclose($file);
        echo $result;
    }
    ?>
    
    The content of sent message:
    Hello  Mark, Your order has been sent. The shipment number i BG12344423 You ma y follow it on our site. 
    
    

    Using templates simplifies changing standard notification messages (may be used in shops, internet services, medical clinics etc.) without changing php script that implements SMS sending.

    To use templates You should:

    Parameter Description
    template Template name
    param N The value of this parameter will replace [%N%]in the template where N is a number between 1 and 4
    single If the message will contain more than 160 chars (single message) it won't be sent and ERROR:12 will be replied (&single=1)

    5. mail2sms

    To send sms using mail2sms e-mail should be created according to following scheme:

    TO: sms.do@smsapi.com
    SUBJECT: username@password_hashed_in_md5
    CONTENT: from=sender_name&to=number&message=message_content

    Adding parameter raport=1 will result in sending back e-mail containing request status (sent confirmation or error code – this is useful while testing the service):

    TO: sms.do@smsapi.com
    SUBJECT: username@password_hashed_in_md5
    CONTENT: from=sender_name&to=number&raport=1&message=message_content

    Mail may be sent in plain / quotedprintable / base64 encoding. Sender name (parameter &from=) have to be active.

    6. Account balance

    Example request

    
    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/user.do?\
    credits=1\
    format=json"
    
    

    I. Examples of responses when &format=json parameter used:

    in case on success:

    
    {
        "points":100.00, // number of credits avaivable in SMSAPI service
    }
    
    

    II. Examples of responses without &format parameter:

    a) in case of success:

    Response :   Credits: <CREDITS>
    
    

    b) in case of failure

    Response :  ERROR: <ERR>
    
    <CREDITS>   number of points available for this user 
    
    Example :   Credits: 100.000
    
    

    Current account balance may be checked using one of the extended function. Find below example of using this function.

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    credits Enter a value „1”
    Format Parameter &format=json causes, that response is sending in JSON format

    required field

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    7. Delivery confirmation

    7.1 SMS callback

    We offer you possibility to run any available script in the web with callback delivery reports. In order to use this option please login on our site https://api.smsapi.com and set the „Callback address DLR_SMS” in Callback URLs.

    Receiving delivery report example (CALLBACK SMS DLR)

    
    <?php
    
    if($_GET['MsgId'] &&$_GET['status'] ) {
        mysql_select_db('database_name',mysql_connect('localhost','login','password'));
        $arIds = explode(',',$_GET['MsgId']);
        $arStatus = explode(',',$_GET['status']);
        $arIdx = explode(',',$_GET['idx']);
        if($arIds){ 
            foreach($arIdsas$k => $v){
                mysql_query("UPDATE sms SET sms_status = '".mysql_real_escape_string($arStatus[$k])."', 
    sms_index = '".mysql_real_escape_string($arIdx[$k])."' WHERE sms_id ='".mysql_real_escape_string($v)."' LIMIT 1");
       }
        mysql_close();
        echo"OK";
    }
    
    ?>
    
    
    

    Parameter will be sent using GET method separated by commas:

    $_GET['MsgId']=09062414383994024,09062414383994025
    $_GET['status']=403,404
    

    Example: http://www.my_site.com/status_update.php It is important that entered address is a valid address to existing, available script. After updating message status in SMSAPI system the update will be sent to callback script (1 to 5 statuses in one request).

    Parameters are described in following table:

    Parameter Description
    Msgld Message ID. Length of this parameter in each request may vary, but it won't be more than 32 characters long.
    status Status code, list of codes can be find in Statuses
    status_name Status name, list of names can be find in Statuses
    idx Optional parameter send with SMS
    donedate Date in UNIX timestamp of delivery report
    username Username which sent SMS
    points Number of used credits
    to Mobile phone number of the recipient
    mcc Mobile country code
    mnc Mobile network code

    All characters are case sensitive!

    7.2 Bulk callback

    Bulk CALLBACK script receives request the moment that sending bulk started. This feature is generally useful for scheduled bulks. Request contains parameters presented in table below. In order to enable Bulk CALLBACK please enter CALLBACK script URL in Callback URLs.

    Example: http://www.my_site.pl/bulk_callback.php

    It is important that entered address is a valid address to existing, available script.

    Parameter are described in following table:

    Parameter Description
    type Messages type SMS/MMS/VMS
    all Total number of messages (phone numbers) in bulk
    points Credits needed for the dispatch.
    info Defines if the bulk was sent using „Numbers from file”, „Numbers and content from file” or „Numbers from contacts database” tab
    text Message content.

    All characters are case sensitive!

    7.3 Cut.li callback

    In order to check cut.li URL visits please log in to web panel and enter in Callback URLs the address to a script to which information about URL visit should be sent.

    Parameter will be sent using GET method separated by commas:

    $_GET['MsgId']=09062414383994024
    $_GET['operating_system']=Android
    

    Example : http://www.my_site.com/bulk_callback.php

    It is important that entered address is a valid address to existing, available script.

    Parameters are described in following table:

    Parameter Description
    MsgId Message ID. Length of this parameter in each request may vary, but it won't bemore than 32 characters long.
    to Recipient's phone number
    click_date Time of first link click in unixtime format
    device Device type
    operating_system Operating system
    browser Browser type
    username Username from which message was sent

    All characters are case sensitive!

    8. HLR Lookup

    HLR (Home location Register) is an extent base including different kinds of information about every working telephone number in GSM. In order to use this option you should request one of following URL :

    with proper parameters described below. All information about numbers will be sent to address given on our site https://api.smsapi.com at „Callback address HLR” in „API Settings” → „Callback URLs”.

    Example request

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/hlr.do?\
    number=44123123123,44234234234&\
    idx=123,234&\
    format=json"
    

    I.Examples of responses when &format=json parameter used:

    a) in case of success:

    {
        "status": "OK", 
        "number": "48100200300",
        "id": "46567088",
        "price": "0.0500"
    }
    

    b) in case of failure:

    {
        "status":"ERROR",
        "number":"481002003001", // invalid phone number
        "error":13               // error code
    }
    

    II. Examples of responses without &format parameter

    a) in case of success:

    OK:<NUMBER>:<ID>:<POINTS>;OK:<NUMBER>:<ID>:<POINTS>;...;...
    OK:44123123123:80625:0.006;OK:44234234234:80627:0.006;
    
    

    b) in case of failure:

    ERROR:<NUMBER>:<ERR>;ERROR:<NUMBER>:<ERR>;...;...
    OK:44123123123:80625:0.006;ERROR:4433412333:13;
    
    

    where:

    <NUMBER>    Checked number
    <ID>        Checking unique ID.
    <POINTS>    Number of used credits
    <ERR>       Error code
    

    Example of data sent to the script callback:

    Array
    (
        [0] => Array
            (
                [id] =>  80625
                [number] => 48600600600
                [mcc] => 260
                [mnc] => 2
                [info] => T-Mobile
                [status] => OK
                [date] =>  1302703609
                [ported] => 0
                [ported_from] => null
            )
        [1] => Array
            (
                [id] =>   80627
                [number] => 48500600700
                [mcc] => 260
                [mnc] => 2
                [info] => ABSENT_SUBSCRIBER
                [status] => FAIL
                [date] =>  1302703609
                [ported] => 0
                [ported_from] => null
            )
    

    It is important that entered address is a valid address to existing, available script. After checking number in HLR information about number will be sent to given URL in POST table. There might be up to 20 numbers in one request.

    Parameters are described in following table:

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    number Numbers to be checked in HLR.
    idx Optional custom value sent with SMS and sent back in CALLBACK. Parameter idx may contain up to 36 chars, allowed are digits 0 – 9 and letters a – z (parameter is not case sensitive). (&idx=123)

    required field

    Returned parameters to script are described in following table:

    Parameter Description
    id ID returned as a response to the request
    number Checked number
    mcc Mobile country code
    mnc Mobile network code
    info Name of network or description of error
    status OK when number is correct, FAIL when number is wrong
    date UNIX timestamp when number was checked
    ported 0 number not ported, 1 number ported
    ported_from null when number is not ported or name of network from which number is ported
    idx Optional custom value sent with HLR request and sent back in CALLBACK (&idx=123

    All characters are case sensitive!

    The data are sent in UTF8 encoding. The list of possible errors, which may appear in infofield, with description is in Error Codes.

    9. User accounts administration

    URL links needed for connecting with our application:

    9.1 Adding new sub-user account

    Example request:

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/user.do?\
    password=&\
    add_user=subuser&\
    pass=subuser_md5_password\
    format=json"
    
    

    Example response:

    OK:<SUB_NAME>
    ERROR:<ERR>
    
    

    Example response when &format = json parameter used:

    
    {
        "username":"subuser", //full sub-user's name
        "limit":0, //credit limit
        "month_limit":0, // monthly renewal credit limit
        "senders":0, // access to main user's sender names
        "phonebook":0, // access to main user's contacts database
        "active":false, // active (true) or inactive (false)
        "info":"unknown"// additional description
    }
    
    

    When error occurred:

    
    {
        "error": 123,
        "message": "error message"
    }
    
    

    For adding a new sub-user account parameter &add_user=subuser_name and other parameters describing the subaccount details is used.

    User's account administration is done by sending HTTP GET or POST request to our system:

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    add_user New sub-user's name (without main user prefix)
    pass Sub-user's password hashed with md5
    pass_api Sub-user's API password hashed with MD5. If this parameter is empty API password will be same as web panel password.
    limit Credit limit granted to the sub-user account
    month_limit Month limit the amount that will be granted 1st day of every month.
    senders Allowing sub-user to use sender names of main user (available values: 1 – allow, 0 – don't allow, default value is 0)
    phonebook Allowing sub-user to use main user's contacts database (available values: 1 – allow, 0 – don't allow, default value is 0).
    active Activating sub-user's account (available values: 1 – active, 0 – inactive, default value is 0).
    info Additional account's description
    format Setting &format=json causes that API response has JSON format. JSON response contains following additional fields: limit, limit_month, senders, phonebook, active, info.
    without_prefix Setting this parameter allows not to use main user's account name as prefix in sub-user's account name (user_subuser).

    required fields

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    9.2 Editing sub-user account

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/user.do?\
    set_user=subuser&\
    pass=new_subuser_password_in_md5&active=1\
    format=json"
    
    

    Example response:

    OK:<SUB_NAME>
    ERROR:<ERR>
    
    

    Example response when &format = json parameter used::

    
    {
        "username":"subuser", //full sub-user's name
        "limit":0, //credit limit
        "month_limit":0, // monthly renewal credit limit
        "senders":0, // access to main user's sender names
        "phonebook":0, // access to main user's contacts database
        "active":false, // active (true) or inactive (false)
        "info":"unknown"// additional description
    }
    
    

    When error occurred:

    
    {
        "error": 123,
        "message": "error message"
    }
    
    

    For editing sub-user's account data &set_user=subuser_name and parameter(s) that should be edited is used in a request.

    User's account administration is done by sending HTTP GET or POST request to our system:

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    set_user The name of the sub-user that should be edited (without main user's prefix)
    pass New sub-user's web panel password hashed in MD5
    pass_api New API interface password hashed in MD5
    limit credits
    month_limit New monthly renewal limit
    senders Allowing sub-user to use sender names of main user (available values: 1 – allow, 0 – don't allow, default value is 0)
    phonebook Allowing sub-user to use main user's phonebook (available values: 1 – allow, 0 – don't allow, default value is 0).
    active Activating sub-user's account (available values: 1 – active, 0 – inactive, default value is 0).
    info Additional account's description
    format Setting &format=json causes that API response has JSON format. JSON response contains following additional fields: limit, limit_month, senders, phonebook, active, info.
    without_prefix Setting this parameter allows not to use main user's account name as prefix in sub-user's account name (user_subuser).

    required fields

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    9.3 User's account data

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/user.do?\
    get_user=sub_user\
    format=json"
    
    

    Example response:

    OK:<LIMIT>:<MONTH_LIMIT>:<SENDERS>:<PHONEBOOK>:<ACTIVE>:<INFO>
    ERROR:<ERR>
    
    

    Example response when &format = json parameter used::

    
    {
        "username":"user_subuser", //full sub-user's name
        "limit":"10.000", //credit limit
        "month_limit":"0.000", // monthly renewal credit limit
        "senders":0, // access to main user's sender names
        "phonebook":0, // access to main user's contacts database
        "active":"1", // active (true) or inactive (false)
        "info":"unknown"// additional description
    }
    
    

    When error occurred:

    
    {
        "error": 123,
        "message": "error message"
    }
    
    

    For checking sub-user's account data &get_user=subuser_name is used in a request.

    User's account administration is done by sending HTTP GET or POST request to our system:

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    get_user The name of the sub-user that should be edited (without main user's prefix)
    format Setting &format=json causes that API response has JSON format. JSON response contains following additional fields: limit, limit_month, senders, phonebook, active, info.
    without_prefix Setting this parameter allows not to use main user's account name as prefix in sub-user's account name (user_subuser)

    required fields

    LIMIT Credit limit
    MONTH_LIMIT Monthly renewal credit limit
    PHONEBOOK Allowing sub-user to use sender names of main user (available values: 1 – allow, 0 – don't allow, default value is 0)
    ACTIVE Account active (value 1) or inactive (value 0)
    ERR error code (Check the error code list Error Codes)

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    9.4 Account balance

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/user.do?\
    credits=1\
    format=json"
    
    

    Example response:

    Points: <POINTS>
    ERROR:<ERR>
    
    

    Example response when &format = json parameter used::

    
    {
        "points":6225.4875, // credit limit
        "proCount":"41503", // number of messages left
        "
    }
    
    

    When error occurred:

    
    {
        "error": 123,
        "message": "error message"
    }
    
    

    For checking main user's or sub-user's account balance parameter &credits=1 is used.

    User's account administration is done by sending HTTP GET or POST request to our system:

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    credits &credits=1
    format Setting &format=json causes that API response has JSON format. JSON response contains following additional fields: limit, limit_month, senders, phonebook, active, info.
    without_prefix Setting this parameter allows not to use main user's account name as prefix in sub-user's account name (user_subuser).

    required fields

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    9.5 Sub-users' list

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/user.do?\
    list=1\
    format=json"
    
    

    Example response:

    OK: subuser1:subuser2
    ERROR:<ERR>
    
    

    Example response when &format = json parameter used::

    [{
        "username":"subuser1", //full sub-user's name
        "limit":"10.0000", // credit limit
        "month_limit":"0.0000", // monthly renewal credit limit
        "senders":"0", // access to main user's sender names
        "phonebook":"0", // access to main user's phonebook
        "active":"1", // active (true) or inactive (false)
        "info":"unknown"// additional description
    },
        "username":"subuser2", //full sub-user's name
        "limit":"0.0000", // credit limit
        "month_limit":"0.0000", // monthly renewal credit limit
        "senders":"0", // access to main user's sender names
        "phonebook":"0", // access to main user's phonebook
        "active":"0", // active (true) or inactive (false)
        "info":"unknown"// additional description
    }]
    
    

    When error occurred:

    
    {
        "error": 123,
        "message": "error message"
    }
    
    

    For checking list of sub-users parameter &list=1 is used. Additional using parameter &format=json results in responding with table of objects in JSON format containing sub-users' accounts data like for &get_user=1 parameter.

    User's account administration is done by sending HTTP GET or POST request to our system:

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    list &list=1 returns list of sub-users for this main user
    format Setting &format=json causes that API response has JSON format. JSON response contains following additional fields: limit, limit_month, senders, phonebook, active, info.

    required fields

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    10. Sender names

    URL links needed for connecting with our application:

    10.1 Adding new sender name

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sender.do?\
    add=sender\
    format=json"
    
    

    Example response:

    OK
    ERROR:<ERR>
    
    

    Example response when &format = json parameter used::

    {
        "count": 1
    }
    
    

    When error occurred:

    
    {
        "error": 123,
        "message": "error message"
    }
    
    

    For adding new sender name parameter &add=sender_name is used.

    User's account administration is done by sending HTTP GET or POST request to our system

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    add New sender name
    format Setting &format=json causes that API response has JSON format. JSON response contains following additional fields: limit, limit_month, senders, phonebook, active, info.

    required fields

    10.2 Checking sender name status

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sender.do?\
    status=sender\
    format=json"
    
    

    Example response:

    OK:<STATUS>
    ERROR:<ERR>
    
    

    Example response when &format = json parameter used::

    {
        "name":"SMSAPI",   // sender name
        "status":"ACTIVE"  // status
        "default":true     // default sender name
    }
    
    

    When error occurred:

    
    {
        "error": 123,
        "message": "error message"
    }
    
    

    For checking sender name's status parameter: &status=sender_name is used where „sender_name” is the name that should be checked.

    User's account administration is done by sending HTTP GET or POST request to our system:

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    status Sender name that should be checked.
    format &format=json results returning an object in JSON format containing following parameters: sender_name, status

    required fields

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    10.4 Deleting sender name

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sender.do?\
    delete=sender\
    format=json"
    
    

    Example response:

    OK:<SENDER_NAME>
    ERROR:<ERR>
    
    

    Example response when &format = json parameter used::

    {
        "count": 1
    }
    
    

    When error occurred:

    
    {
        "error": 123,
        "message": "error message"
    }
    
    

    For deleting sender name parameter: &delete=sender_name is used.

    User's account administration is done by sending HTTP GET or POST request to our system:

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    delete Sender name that should be deleted.
    format &format=json results returning an object in JSON format containing following parameters: sender_name, status

    required fields

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    10.5 Checking list of sender names

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sender.do?\
    list=1\
    format=json"
    
    

    Example response:

    OK:<SENDER_1>,<STATUS_1>:<SENDER_2>:<STATUS_2>...,...:...,...:...,...
    ERROR:<ERR>
    
    

    Example response when &format = json parameter used::

    [{
        "sender":"SMSAPI", // sender name
        "status":"ACTIVE", // status
        "default":true// default sender name
    },
    {
        "sender":"SMSAPI.pl", // sender name
        "status":"INACTIVE", // status
        "default":false// default sender name
     },
     {
        "sender":"SMS", // sender name
        "status":"ACTIVE", // status
        "default":false// default sender name
    }]
    
    

    When error occurred:

    
    {
        "error": 123,
        "message": "error message"
    }
    
    

    For deleting sender name parameter: &list=1 is used.

    User's account administration is done by sending HTTP GET or POST request to our system:

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    list &list=1 results in returning list of sender names with its statuses
    format &format=json results returning an object in JSON format containing following parameters: sender_name, status
    with_nat_names Setting this parameter (&with_nat_names=1) returns also names shared from main user (for sub-users' accounts).

    required fields

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    10.6 Setting default sender name

    curl -H "Authorization: Bearer access_token" \
    "https://api.smsapi.com/sender.do?\
    default=default_name\
    format=json"
    
    

    Example response:

    OK
    ERROR:<ERR>
    
    

    Example response when &format = json parameter used::

    {
        "count": 1
    }
    
    

    When error occurred:

    
    {
        "error": 123,
        "message": "error message"
    }
    
    

    Default sender name is the name that will be used when parameter &from= is empty or when this parameter is missing. Default sender name has to be active. For setting default sender name parameter &default=sender_name is used, where sender_name is the name that should be set as default.

    User's account administration is done by sending HTTP GET or POST request to our system:

    Parameter Description
    access_token OAuth token used to authenticate in our system.
    default Sender name that should be set as default
    format &format=json results returning an object in JSON format containing following parameters: sender_name, status

    required fields

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com

    11. Price list

    curl -H "Authorization: Bearer access_token"\
    "https://api.smsapi.com/prices.do?\
    format=json"
    
    
    

    Example response when &format = json parameter used::

    
    [
    { 
        "country":"Greece",
        "network":"Cosmote",
        "mcc":"202",
        "mnc":"1",
        "date":"1363009268",
        "price":"0.0180"
    },
    {
        "country":"Greece",
        "network":"Vodafone",
        "mcc":"202",
        "mnc":"5",
        "date":"1318543200",
        "price":"0.0180"
        },
        ...
    ]
    

    When error occurred:

    
    {
        "error": 123,
        "message": "error message"
    }
    
    

    API prices.do allows to retrieve latest full price list. The response price list i given in JSON format. In the response prices for all covered networks will be sent. In request should appear only 2 parameters: username and API password hashed with md5. Full documentation, libraries and tools for proper parsing JSON response for various programming languages can found under following URL: http://json.org/

    Parameter Description
    access_token OAuth token used to authenticate in our system.

    required fields

    "country" Country name
    "network" Network name
    "mcc" Mobile Country Code
    "mnc" Mobile Network Code
    "date" Date of the last price change, expressed in UNIX timestamp
    "price" Price, expressed in €

    In case of any problems with sending requests to basic URL (as in example above) backup URL may be used: https://api2.smsapi.com/

    12. Special characters

    List of special chars that may be changed to normal ones using parameter &normalize:

    'normalize_chars' => array(
                            'Š'=>'S', 'š'=>'s', 'Ś'=>'S', 'ś'=>'s', 'Đ'=>'Dj', 'đ'=>'dj', 'ź'=>'z', 'ż'=>'z','Ź'=>'Z',
                            'Ż'=>'Z', 'Ž'=>'Z','ž'=>'z', 'Č'=>'C', 'č'=>'c', 'Ć'=>'C', 'ć'=>'c', 'À'=>'A', 'Ą'=>'A', 
                            'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',
                            'Ę'=>'E', 'ę'=>'e', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I','Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N',
                            'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Ł'=>'L', 'ł'=>'l', 'Ń'=>'N', 'ń'=>'n', 'Õ'=>'O','Ö'=>'O',
                            'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'þ'=>'B', 'ß'=>'Ss','à'=>'a', 
                            'ą'=>'a','á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 
                            'é'=>'e', 'ê'=>'e', 'ë'=>'e','ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n',
                            'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o','ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u',
                            'ý'=>'y',  'þ'=>'b', 'ÿ'=>'y', 'Ŕ'=>'R', 'ŕ'=>'r',
                            }
    
    

    Special characters are these that don't fulfil regular expression: @£$¥èéùìòÇØøÅå_^{}\[~]|ÆæßÉ!"#¤%&'()*+,-./0- 9:;<=>?A-ZÄÖÑܧ¿a-zäöñüà"enter"

    Points charges table:

    Without special characters

    Characters amount Number of parts
    160 1 part
    306 2 parts
    459 3 parts
    612 4 parts
    765 5 parts
    918 6 parts

    With special or/and polish characters

    Characters amount Number of parts
    70 1 part
    134 2 parts
    201 3 parts
    268 4 parts
    335 5 parts
    402 6 parts

    CALLBACK requests may be sent from one of following IP addresses: 85.194.241.82, 89.174.81.103, 89.174.81.98, 89.174.81.102, 91.185.184.29, 91.185.185.2 or 185.36.169.252

    Delivery statuses

    Status list:

    Number Status Description
    401 NOT_FOUND Wrong ID or report has expired
    402 EXPIRED Messages expired.
    403 SENT Message is sent without a final delivery report.
    404 DELIVERED Message is delivered to the recipient
    405 UNDELIVERED Message is undelivered (invalid number, roaming error etc)
    406 FAILED Sending message failed – please report it to us
    407 REJECTED Message is undelivered (invalid number, roaming error etc)
    408 UNKNOWN No report (the message may be either delivered or not)
    409 QUEUE Message is waiting to be sent
    410 ACCEPTED Message is delivered to the operator
    412 STOP Bulk has been stopped by the user.

    Error codes

    Error codes list:

    ERROR Description
    8 Error in request (Please report)
    11 The message is too long or there is no message or parameter: nounicode is set and special characters (including Polish characters) are used
    12 The message has more parts than defined in &max_parts parameter.
    13 Lack of valid phone numbers (invalid or blacklisted numbers)
    14 Wrong sender name
    17 FLASH message cannot contain special characters
    18 Invalid number of parameters
    19 Too many messages in one request
    20 Invalid number of IDX parameters
    25 Parameters &normalize and &datacoding musn't appear in the same request.
    27 Too long IDX parameter. Maximum 255 chars.
    28 Invalid time_restriction parameter value. Available values are: FOLLOW, IGNORE or NEAREST_AVAILABLE.
    30 Wrong UDH parameter when &datacoding=bin
    40 No group with given name in contacts database
    41 Chosen group is empty
    50 Messages may be scheduled up to 3 months in the future
    52 Too many attempts of sending messages to one number (maximum 10 attempts within 60s)
    53 Not unique idx parameter, message with the same idx has been already sent and &check_idx=1.
    54 Wrong date - (only unix timestamp and ISO 8601)
    56 The difference between date sent and expiration date can't be less than 1 and more than 72 hours.
    70 Invalid URL in notify_url parameter.
    72 -
    74 Sending date doesn't match date sent restrictions set for the account.
    93 Message parameters and group parameter cannot be used simultaneously.
    101 Invalid authorization info
    102 Invalid username or password
    103 Insufficient credits on Your account
    104 No such template
    105 Wrong IP address (for IP filter turned on)
    110 Action not allowed for your account
    200 Unsuccessful message submission
    201 System internal error (please report)
    202 Too many simultaneous request, the message won't be sent
    203 Too many requests. Please try again later.
    301 ID of messages doesn't exist
    400 Invalid message ID of a status response
    999 System internal error (please report)
    1000 Action available only for the main user
    1001 Invalid action (expected one of following parameters: add_user, set_user, get_user, credits)
    1010 Sub-user-s adding error
    1020 Sub-user-s editing error
    1021 No data to edit, at least one parameter has to be edited
    1030 Checking user's data error
    1032 Sub-user doesn't exist for this main user
    1100 Sub-user's data error
    1110 Invalid new sub-user's name
    1111 New sub-user's name is missing
    1112 Too short new sub-user's name, it has to contain minimum 3 characters
    1113 Too long new sub-user's name, sub-user's name with main user's prefix may contain maximum 32 characters
    1114 Not allowed characters occurred in sub-user's name, following are allowed: letters [A – Z], digits [0 – 9] and following others @, -, _ and .
    1115 Another user with the same name exists
    1120 New sub-user's password error
    1121 Password too short
    1122 Password too long
    1123 Password should be hashed with MD5
    1130 Credit limit error
    1131 Parameter limit ought to be a number
    1140 Month limit error
    1141 Parameter month_limit ought to be a number
    1150 Wrong senders parameter value, binary 0 and 1 values allowed
    1160 Wrong phonebook parameter value, binary 0 and 1 values allowed
    1170 Wrong active parameter value, binary 0 and 1 values allowed
    1180 Parameter info error
    1183 Parameter info is too long
    1190 API password for sub-user's account error
    1192 Wrong API password length (password hashed with MD5 should have 32 chars)
    1193 API password should be hashed with MD5
    2001 Invalid action (parameter add, status, delete or list expected)
    2010 New sender name adding error
    2030 Sender name's status checking error
    2031 Such sender name doesn't exist
    2060 Default sender name error
    2061 Sender name has to be active for setting it as default
    2062 This sender name is already set as default
    2100 Data error
    2110 Sender name error
    2111 Sender name is missing for adding new sender name action (parameter &add is empty)
    2112 Invalid Sender Name's name (i.e. Name containing special chars or name too long), sender name may contain up to 11 chars, chars allowed: a-z A-Z 0-9 - . [space]
    2115 Sender name already exists
    4000 General contacts database error.
    4001 Action not available for this account.
    4002 Invalid action.
    4003 Invalid parameter usage.
    4004 Too large limit parameter value (i.e. for list_contacts action maximum value is 200).
    4100 General groups' action error.
    4101 Group not found.
    4110 General group's name error.
    4111 Invalid group's name.
    4112 Group's name cannot not be empty.
    4113 Group's name too short (min 2 chars).
    4114 Group's name too long (max 32 chars).
    4115 Forbidden chars appeared in group's name.
    4116 Group already exists.
    4121 Invalid Info field value for groups.
    4122 Too long Info field value for contact (max 200 chars).
    4200 General contact error.
    4201 Contact not found.
    4210 General phone number error.
    4211 Invalid phone number.
    4212 Contact has to contain a phone number.
    4213 Phone number is too short.
    4214 Phone number is too long.
    4220 First name error.
    4221 First name too short (min 2 chars).
    4222 First name too long (max 100 chars).
    4230 Last name error.
    4231 Last name too long (min2 chars).
    4232 Last name too long (max 100 chars).
    4240 Contact Info field error.
    4241 Too long Info field value for contact (max 200 chars).
    4250 E-mail address error for this contact.
    4260 Birthdate error of this contact.
    4270 Group error for this contact.
    4271 Group not found.
    4272 Group name is necessary for group actions.
    4280 Gender error.

    HLR error's list

    Error Description
    UNKNOWN_SUBSCRIBER Invalid, not active number. Error is permanent.
    ABSENT_SUBSCRIBER Number turned off or out of range. Number is considered to be inactive but it may change back to active once it is in range. Error is temporary.
    TELESERVICE_NOT_PROVISIONED The recipient has no SMS subscription. Error is permanent.
    SYSTEM_FAILURE Temporary network or protocol failure
    HLR_LOCAL_CANCEL / HLR_ABORT Temporary problem or lost reach
    CALL_BARRED Barring of the recipient's number. Error is permanent.

    7-bit GSM alphabet

    This is the 7 bit default alphabet as specified by GSM 03.38.

    All chars outside this charset are considered to be special chars and cause shortening single message from 160 chars to 70 chars. Using only chars from this list won't shorten the message.

    Notice that characters ^ { } [ ] \ ~ | [enter] € are counted double when sending message without special chars because of GSM specification requirements.

    Character Character name HEX DEC
    @ COMMERCIAL AT 0x00 0
    £ POUND SIGN 0x01 1
    $ DOLLAR SIGN 0x02 2
    ¥ YEN SIGN 0x03 3
    è LATIN SMALL LETTER E WITH GRAVE 0x04 4
    é LATIN SMALL LETTER E WITH ACUTE 0x05 5
    ù LATIN SMALL LETTER U WITH GRAVE 0x06 6
    ì LATIN SMALL LETTER I WITH GRAVE 0x07 7
    ò LATIN SMALL LETTER O WITH GRAVE 0x08 8
    Ç LATIN CAPITAL LETTER C WITH CEDILLA 0x09 9
    LINE FEED 0x0A 10
    Ø LATIN CAPITAL LETTER O WITH STROKE 0x0B 11
    ø LATIN SMALL LETTER O WITH STROKE 0x0C 12
    CARRIAGE RETURN 0x0D 13
    Å LATIN CAPITAL LETTER A WITH RING ABOVE 0x0E 14
    å LATIN SMALL LETTER A WITH RING ABOVE 0x0F 15
    Δ GREEK CAPITAL LETTER DELTA 0x10 16
    _ LOW LINE 0x11 17
    Φ GREEK CAPITAL LETTER PHI 0x12 18
    Γ GREEK CAPITAL LETTER GAMMA 0x13 19
    Λ GREEK CAPITAL LETTER LAMBDA 0x14 20
    Ω GREEK CAPITAL LETTER OMEGA 0x15 21
    Π GREEK CAPITAL LETTER PI 0x16 22
    Ψ GREEK CAPITAL LETTER PSI 0x17 23
    Σ GREEK CAPITAL LETTER SIGMA 0x18 24
    Θ GREEK CAPITAL LETTER THETA 0x19 25
    Ξ GREEK CAPITAL LETTER XI 0x1A 26
    ESCAPE TO EXTENSION TABLE 0x1B 27
    FORM FEED 0x1B0A 27 10
    ^ CIRCUMFLEX ACCENT 0x1B14 27 20
    { LEFT CURLY BRACKET 0x1B28 27 40
    } RIGHT CURLY BRACKET 0x1B29 27 41
    '\' REVERSE SOLIDUS (BACKSLASH) 0x1B2F 27 47
    [ LEFT SQUARE BRACKET 0x1B3C 27 60
    ~ TILDE 0x1B3D 27 61
    ] RIGHT SQUARE BRACKET 0x1B3E 27 62
    VERTICAL BAR 0x1B40 27 64
    EURO SIGN 0x1B65 27 101
    Æ LATIN CAPITAL LETTER AE 0x1C 28
    æ LATIN SMALL LETTER AE 0x1D 29
    ß LATIN SMALL LETTER SHARP S (German) 0x1E 30
    É LATIN CAPITAL LETTER E WITH ACUTE 0x1F 31
    SPACE 0x20 32
    ! EXCLAMATION MARK 0x21 33
    \" QUOTATION MARK 0x22 34
    # NUMBER SIGN 0x23 35
    ¤ CURRENCY SIGN 0x24 36
    % PERCENT SIGN 0x25 37
    & AMPERSAND 0x26 38
    ' APOSTROPHE 0x27 39
    ( LEFT PARENTHESIS 0x28 40
    ) RIGHT PARENTHESIS 0x29 41
    * ASTERISK 0x2A 42
    + PLUS SIGN 0x2B 43
    , COMMA 0x2C 44
    - HYPHEN-MINUS 0x2D 45
    . FULL STOP 0x2E 46
    / SOLIDUS (SLASH) 0x2F 47
    0 DIGIT ZERO 0x30 48
    1 DIGIT ONE 0x31 49
    2 DIGIT TWO 0x32 50
    3 DIGIT THREE 0x33 51
    4 DIGIT FOUR 0x34 52
    5 DIGIT FIVE 0x35 53
    6 DIGIT SIX 0x36 54
    7 DIGIT SEVEN 0x37 55
    8 DIGIT EIGHT 0x38 56
    9 DIGIT NINE 0x39 57
    : COLON 0x3A 58
    ; SEMICOLON 0x3B 59
    < LESS-THAN SIGN 0x3C 60
    = EQUALS SIGN 0x3D 61
    > GREATER-THAN SIGN 0x3E 62
    ? QUESTION MARK 0x3F 63
    ¡ INVERTED EXCLAMATION MARK 0x40 64
    A LATIN CAPITAL LETTER A 0x41 65
    B LATIN CAPITAL LETTER B 0x42 66
    C LATIN CAPITAL LETTER C 0x43 67
    D LATIN CAPITAL LETTER D 0x44 68
    E LATIN CAPITAL LETTER E 0x45 69
    F LATIN CAPITAL LETTER F 0x46 70
    G LATIN CAPITAL LETTER G 0x47 71
    H LATIN CAPITAL LETTER H 0x48 72
    I LATIN CAPITAL LETTER I 0x49 73
    J LATIN CAPITAL LETTER J 0x4A 74
    K LATIN CAPITAL LETTER K 0x4B 75
    L LATIN CAPITAL LETTER L 0x4C 76
    M LATIN CAPITAL LETTER M 0x4D 77
    N LATIN CAPITAL LETTER N 0x4E 78
    O LATIN CAPITAL LETTER O 0x4F 79
    P LATIN CAPITAL LETTER P 0x50 80
    Q LATIN CAPITAL LETTER Q 0x51 81
    R LATIN CAPITAL LETTER R 0x52 82
    S LATIN CAPITAL LETTER S 0x53 83
    T LATIN CAPITAL LETTER T 0x54 84
    U LATIN CAPITAL LETTER U 0x55 85
    V LATIN CAPITAL LETTER V 0x56 86
    W LATIN CAPITAL LETTER W 0x57 87
    X LATIN CAPITAL LETTER X 0x58 88
    Y LATIN CAPITAL LETTER Y 0x59 89
    Z LATIN CAPITAL LETTER Z 0x5A 90
    Ä LATIN CAPITAL LETTER A WITH DIAERESIS 0x5B 91
    Ö LATIN CAPITAL LETTER O WITH DIAERESIS 0x5C 92
    Ñ LATIN CAPITAL LETTER N WITH TILDE 0x5D 93
    Ü LATIN CAPITAL LETTER U WITH DIAERESIS 0x5E 94
    § SECTION SIGN 0x5F 95
    ¿ INVERTED QUESTION MARK 0x60 96
    a LATIN SMALL LETTER A 0x61 97
    b LATIN SMALL LETTER B 0x62 98
    c LATIN SMALL LETTER C 0x63 99
    d LATIN SMALL LETTER D 0x64 100
    e LATIN SMALL LETTER E 0x65 101
    f LATIN SMALL LETTER F 0x66 102
    g LATIN SMALL LETTER G 0x67 103
    h LATIN SMALL LETTER H 0x68 104
    i LATIN SMALL LETTER I 0x69 105
    j LATIN SMALL LETTER J 0x6A 106
    k LATIN SMALL LETTER K 0x6B 107
    l LATIN SMALL LETTER L 0x6C 108
    m LATIN SMALL LETTER M 0x6D 109
    n LATIN SMALL LETTER N 0x6E 110
    o LATIN SMALL LETTER O 0x6F 111
    p LATIN SMALL LETTER P 0x70 112
    q LATIN SMALL LETTER Q 0x71 113
    r LATIN SMALL LETTER R 0x72 114
    s LATIN SMALL LETTER S 0x73 115
    t LATIN SMALL LETTER T 0x74 116
    u LATIN SMALL LETTER U 0x75 117
    v LATIN SMALL LETTER V 0x76 118
    w LATIN SMALL LETTER W 0x77 119
    x LATIN SMALL LETTER X 0x78 120
    y LATIN SMALL LETTER Y 0x79 121
    z LATIN SMALL LETTER Z 0x7A 122
    ä LATIN SMALL LETTER A WITH DIAERESIS 0x7B 123
    ö LATIN SMALL LETTER O WITH DIAERESIS 0x7C 124
    ñ LATIN SMALL LETTER N WITH TILDE 0x7D 125
    ü LATIN SMALL LETTER U WITH DIAERESIS 0x7E 126
    à LATIN SMALL LETTER A WITH GRAVE 0x7F 127

    Encoding

    Example

    
    https://api.smsapi.com/sms.do?
    username=username&
    password=passwordMD5&
    to=48500000000&
    encoding=utf-8&
    message=message_content
    
    

    Default encoding is utf-8. However, you can set different encoding of messages by additional parameter &encoding in your HTTP request. Available encoding types are:

    Integrations

    E-commerce sector is using more often potential of mobile communications, especially that it translates into both introductions of savings and support of sales. You can always browse complete list on our Integrations.

    Gmail

    Gmail is a free, email service provided by Google. The Gmail user interface is user-friendly with its focus on search and conversation threading of emails, grouping several messages between two or more people onto a single page. Integration with SMSAPI allows setting automatic SMS notifications about received e-mails.

    Gmail configuration

    Script monitors messages by their labels. To set automatic label assignment, you'll need to login to your Gmail account, then click the gear icon and go to settings.

    alternate text

    In the settings, go to Filters and Blocked Addresses tab and choose the option to create a new filter.

    alternate text

    In the next step, you must specify parameters that proper label will be assigned for. Notifications are going to be sent to all emails incoming from support@smsapi.com address. It means, that new all messages from the defined sender will be labelled automatically. To continue, click Create filter with this search link

    alternate text

    Select option Apply the label, then create new or select one from the list.

    alternate text

    Script configuration

    function SMSapi() {
    
      // Configuration
      /*******************************************************/
    
      var MAIL_LABEL = 'SMSAPI'; // label name (in Gmail) that notifications are going to be sent for 
    
      var SMSAPI_TOKEN = 'token';
    
    
      var SMSAPI_SENDERNAME = 'SMS'; // sender field name
      var SMSAPI_RECIVER  = 'tel_number'; // recipient phone number
    
      var MESSAGE = 'New email from: :SENDER, topic: :TITLE'; // sms content with extra parameters :SENDER, :TITLE
     /*******************************************************/
    
      var threads = GmailApp.getUserLabelByName(MAIL_LABEL).getThreads();
    
      for(i in threads)
        UrlFetchApp.fetch('https://api.smsapi.com/sms.do?encoding=utf-8&access_token='+SMSAPI_TOKEN+'&from='+SMSAPI_SENDERNAME+'&to='+encodeURIComponent(SMSAPI_RECIVER)+"&message="+encodeURIComponent(MESSAGE.replace(':SENDER',threads[i].getMessages()[0].getFrom()).replace(':TITLE', threads[i].getMessages()[0].getSubject())));
    
      GmailApp.getUserLabelByName(MAIL_LABEL).removeFromThreads(threads);
    
    }
    

    For proper script working, all variables listed below should be filled:

    
      * MAIL_LABEL – Name of monitored, previously set Gmail label
      * SMSAPI_TOKEN, your token in SMSAPI service
      * SMSAPI_SENDERNAME – name of the sender field
      * SMSAPI_RECIVER – recipient phone number
      * MESSAGE – message content
    
    

    In order to configure SMSAPI service in Google Mail, make sure if you're logged into the proper account in Google service. Then go to https://script.google.com

    Click „Start Scripting” and then „Blank Project”

    alternate text

    alternate text

    To set script executing frequency, click alternate text icon and add new trigger

    alternate text

    While saving, system can ask you for permission in order to get the script working.

    alternate text

    alternate text

    Google Calendar

    function SmsApiCalendar()
    {
      /* Configuration */
    
      var SMSAPI_TOKEN   = 'token';
    
      var SMSAPI_RECEIVER   = '48XXXXXXXXX';
      var SMSAPI_SENDERNAME = 'Info'; // Free-registered sender name
    
      var SMSAPI_URL     = 'https://api.smsapi.com/sms.do?';
    
      var HOURS = 0;
      var MINUTES  = 30;
      var MESSAGE = 'GOOGLE Calendar: Coming events: :TITLE that begin :TIME';
      /****************/
    
      SMSAPI_URL += 'access_token='+SMSAPI_TOKEN;
      SMSAPI_URL += '&from='+SMSAPI_SENDERNAME;
      SMSAPI_URL += '&to='+encodeURIComponent(SMSAPI_RECEIVER);
    
      var period = (HOURS * 3600000) + (MINUTES * 60000);
      var now = new Date();
      var periodFromNow = new Date(now.getTime() + period);
    
      var calendar = CalendarApp.getDefaultCalendar();
      var events = calendar.getEvents(now, periodFromNow);
    
      for (var i in events) {
        var event = events[i];
    
        var has_smsapi_status = false;
        var tag_keys = event.getAllTagKeys();
        for (var k = 0; k < tag_keys.length; ++k) {
          if (tag_keys[k] === 'smsapi_status') {
            has_smsapi_status = true;
            break;
          }
        }
    
        if (has_smsapi_status) {
          if (event.getTag('smsapi_status') === 'ok') {
            continue;
          }
        }
        var message = MESSAGE.replace(':TITLE', event.getTitle()).replace(':TIME', event.getStartTime());
        var url = SMSAPI_URL+"&encoding=utf8&message="+encodeURIComponent(message);
        UrlFetchApp.fetch(url);
        event.setTag('smsapi_status', 'ok');
      }
    }
    
    

    It's required to enter values of variables:

    
        * 'SMSAPI_TOKEN', your token in SMSAPI service
        * 'SMSAPI_RECIVER', mobile phone number SMS notification will be sent to.
        * 'SMSAPI_SENDERNAME', free-registered SMS notification sender name.
        * 'HOURS', defines in hours how long before the event SMS notification should be send
        * 'MINUTES', defines in minutes how long before the event SMS notification should be send
        * 'MESSAGE', content of SMS notification, ':TITLE' replace event name and ':TIME' replace event date
    
    
    
    

    Google calendar Google Calendar is a time-management web application and mobile app created by Google. It became available on April 13, 2006. Integrating with SMSAPI allows to configuring automatic SMS notifications about upcoming events.

    In order to work properly, the script should be given appropriate permissions. The script retrieves information about dates and names of the events directly from Google Calendar. Then properly prepared references to our API are performed, which results in sending SMS notification.

    To configure SMSAPI service make sure that you are logged into desired Google account. After that go to address https://script.google.com/

    Click „Start Scripting” and then „Blank Project”

    alternate text

    alternate text

    Changing script name from 'Code.gs' on'SmsApiCalendar.gs' is unnecessary.

    To set the script to execute frequency choose alternate text 'Current project's triggers' then 'No triggers set up. Click here to add one now' and change settings on 'Minutes timer' and 'Every minute'.

    alternate text

    Script needs some permissions in order to work properly. Script gets info about title and date of event. Then it constructs proper request to API that result in SMS notifications.

    alternate text

    Opencart

    To configure SMSAPI module in Opencart, first module files should be downloaded from following destination https://github.com/smsapi/smsapi-opencart and uploaded to Opencart directory. After succesful uploading it should be able to install SMSAPI – SMS notifications module.

    alternate text

    alternate text

    alternate text

    After entering username and password in MD5, a configuration of SMS notifications will be possible.

    API password is the same as web panel password after registration. You may change your API password in Settings → API. Changing your web panel password does not change API password. It is possible to generate password hashed in MD5 on Password „Show API password in MD5”.

    Tab „Settings” allows to choose active sender name for SMS notifications (only sender active for this account in SMSAPI will be available to choose), choose additional sending parameters for SMS notifications, configure informing about new order in Opencart for the owner of shop, configure and personalize SMS notifications for selected order status.

    alternate text

    alternate text

    Zapier

    Zapier lets you connect APP to hundreds of other web services. Automated connections called Zaps, set up in minutes with no coding, can automate your day-to-day tasks and build workflows between apps that otherwise wouldn't be possible.

    Each Zap has one app as the Trigger, where your information comes from and which causes one or more Actions in other apps, where your data gets sent automatically.

    Getting Started with Zapier

    Sign up for a free Zapier account, from there you can jump right in. To help you hit the ground running, there are some popular pre-made Zaps.

    How do I connect APP to Zapier?

    Log in to your Zapier account or create a new account. Navigate to "Connected Accounts" from the top menu bar. Now click on "Connect new account" and search for "APP" Use your credentials to connect your APP account to Zapier. Once that's done you can start creating an automation! Use a pre-made Zap or create your own with the Zap Editor. Creating a Zap requires no coding knowledge and you'll be walked step-by-step through the setup. Need inspiration? See everything that's possible with SMSAPI and Zapier.

    Other integrations

    We also have integrations with:

    You can check them all out at our Integrations page.