HTTP Interface for SMS

TG provides a HTTP interface to enable your applications to send messages over the internet. You can send SMS message using the HTTP interface. Parameters are specified in the URL.

Note: Limit your sending speed to 1 SMS per 10 seconds for 1 port when using this API.

Sending SMS format:
http://[IP]/cgi/WebCGI?1500101=account=[user]&password=[pass]&port=[port]&destination=[phone_number]&content=[MSG]

Sending USSD format:
http://[IP]/cgi/WebCGI?1500102=account=[user]&password=[pass]&port=[port]&content=[MSG]

Please check the following example SMS message from web.
If you want to send a message "Hello world!!" to phone number 15880270900 through TG GSM port 1.

The API settings are configured as the following picture shows:

Figure 1 API Settings on TG


As we can see, the [User] should be apiuser, and the [pass] should be password.


The URL format should be like this:
http://192.168.5.176/cgi/WebCGI?1500101=account=apiuser&password=password&port=1&destination=15880270900&content=Hello+world!!

For the content, it is better to convert it to URL Encode. 

You might find a tool in the Internet like this web tool: URL Encode Decode

 

Have more questions? Submit a request

23 Comments

  • 0
    Avatar

    Hi You,

    I am a programmer. Now, I'm writing SMS function GT400 Neogate, but I do not know what is the value returned when I call the method"http://192.168.5.176/cgi/WebCGI?1500101=account=apiuser&password=password&port=1&destination=15880270900&content=Hello world!!".

    I hope to get feedback from you.

    Thanks you.

  • 1
    Avatar

    hi youu

    i wanna know how i can receive SMS  sent from the neogate device to an HTTP interface using the same things as u have done with sending the message here

    i hope to get feedback from you

    thank you

  • 1
    Avatar

    Hello @Trung Út Lê,

    If the SMS is sent successfully, you can will the receive the response like this:

    Response: Success
    Message: Commit successfully!

     

  • 1
    Avatar

    Hello halimalarhrafi1993,

    Currently, TG doesn't support read SMS via HTTP interface, hope you will know.

    Thanks.

  • 0
    Avatar

    Hi Pixy Xie,

    So, The response include two variables: response (value is Success and message (value is Commit successfuly) ?

    Looking forward to your response!

  • 0
    Avatar

    Hi,
    I must send sms from a remote server to local gateway. To perform the call I use jquery + ajax. Because it is a cross domain request I must use jsonp, but the gateway response is text/html, so I receive a syntax error from jquery. There is a way to fix it? Thanks.

  • 0
    Avatar

    Hello,

    I want to send massive sms from HTTP, this is possible?. my device is GT400 Neogate

  • 0
    Avatar

    dear all ;

    how can i send SMS to multiple Numbers

    what is the revived SMS Form ?

    what is the revived SMS sender name will appear ?  

    and what is the response in case there is failure in one of them 

    Edited by mahmoud elshennawy
  • 0
    Avatar

    Hi do you have example PHP code/framework to send SMS through Yeastar TGX00 I am  interested to understand Throttling, round Robin of GSM, need some way to read/store "Sucess Send of SMS" to the database on the sending app side, for example a way to handle a potential Queue of 1000 burst or high activity of SMS without dropping/loosing SMS transmissions
    For Round Robin of GSM modules is this Automatic and handled by the Yeastar TG?

    Some PHP Examples would be useful, thank you
     

  • 0
    Avatar

    Hello!

    how do I get the response to my application?

  • 0
    Avatar

    Hi. I make programm in JAVA for my needs. I can send and get SMS. But I understand, how i can connect to database for look all my sms. Help. Yeastas TG100. Sorry for my english.

  • 0
    Avatar

    Is it possible to send "+" before country code in destination filed?

  • 0
    Avatar

    Dear
    When I load the content of the message I wish to send, the space between the words replaces it with the + sign.
    How could I solve the problem?
    Grateful

  • 0
    Avatar

    USE URL ENCODE @Konstantin @Contacto

  • 0
    Avatar
    Response: Error
    Message: Authentication failed

    does it support in t400?

  • 0
    Avatar

    Hi,

    How can I end an ussd session using http interface after initiating a ussd session ?
    i have Yeastar tg400 model.

    thanks.

  • 0
    Avatar

    Hi,

    I have TG800 here. How can I access the Web GUI of the device?
    I have tried accessing using the default IP address (192.168.5.150) provided in the user's manual but didn't have any luck accessing it.
    Please someone help me.

    Thank you.

  • 0
    Avatar

    @louieje,you can advanced ip scanner to know the exact ip address or you do a manual reset.
    @Garry Hill,were you able to use the php code to store the status of the Sms sent (delivered or undelivered)? Were you able to get the php syntax to send the SMS?

  • 0
    Avatar

    onyegbado collins uc
    Yes
    it turned out to be not so hard to do in PHP
    establish your Gateway IP and Port, and set the Params your Yeastar should send a SMS

    Here is some code that worked for me (note +61 for Australia you can expand on that of course) it will send a test SMS, its mostly the same code I incorporated into my Application it will round robin the ports I have a 4 Channel Yeastar
    Hope it helps

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>SMS Test</title>
    </head>
    <body>

    <?php
    $debug = 'on';
    $smskey = '12345';
    $mobile = '041234567';
    $SMS_gateway_account = 'username';
    $SMS_gateway_password = 'password';
    $SMS_leader = 'Use ';
    $SMS_trailer = ' for SMS validation';
    $SMS_message = $SMS_leader . $smskey . $SMS_trailer;
    $SMS_channel_count = '4';
    $SMS_gateway = '123.123.123.123';
    $SMS_port = '1111';
    $SMS_destination = 61 . substr($mobile, -9);
    // Starting Assumptions
    $SMS_success = 'NO';
    // Produce an array with unique random SMS ports in the channel count range starting at 1
    $random_port_array = range(1, $SMS_channel_count);
    shuffle($random_port_array);
    foreach($random_port_array as $channel)
    {
    ;
    $ch = curl_init();
    $SMS_gateway_password_encoded = curl_escape($ch, $SMS_gateway_password);
    $SMS_message_encoded = curl_escape($ch, $SMS_message);
    $transmission = "http://" . $SMS_gateway . ":" . $SMS_port . "/cgi/WebCGI?1500101=account=" . $SMS_gateway_account . "&password=" . $SMS_gateway_password_encoded . "&port=" . $channel . "&destination=" . $SMS_destination . "&content=" . $SMS_message_encoded;
    curl_setopt($ch, CURLOPT_URL, $transmission);
    if ($debug == 'on') { echo '<hr>' . $transmission . '<hr>'; }
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $SMS_result = curl_exec($ch);
    if ($debug == 'on') { echo $SMS_result . '<hr>'; }
    if ((strpos($SMS_result, 'Response: Success') !== false) && ((strpos($SMS_result, 'Message: Commit successfully!') !== false)))
    {
    $SMS_success = 'YES';
    }
    else
    {
    $SMS_success = 'NO';
    }
    curl_close($ch);
    if ($SMS_success == 'YES')
    {
    echo '<h1 align="center">SMS SENT</h1>';
    break;
    }
    else
    {
    echo '<h1 align="center">SMS FAIL</h1>';
    }
    }
    ?>
    </body>
    </html>

    Edited by Garry Hill
  • 0
    Avatar

    Hello Gary Hiill,

    thanks for the swift response.Its well explanatory.

    However, i didnt see the plus sign before the 61

    $SMS_destination = 61 . substr($mobile, -9);

    something like :

    $SMS_destination = +61 . substr($mobile, -9);

  • 0
    Avatar

    because it cant dial like "+" I guess,

    my application required Australian Only phone numbers, you can probably leave like that out and the Telco/Provider will default to your country :-)

     

  • 0
    Avatar

    So what you are basically doing is Curling this below where [IP] is your Gateway IP (and port if you changed it)

    (From the Gateway Release notes)

    http://[IP]/cgi/WebCGI?1500101=account=[user]&password=[pass]&port=[port]&destination=351[phone_number]&content=[MSG]

    that crazy 1500101 IS important :-)

    and Destination, is that Country Code? I forgot, give it a try

    So perhaps like 61 (or your Country Code) is important
    this is Curl, so really its not just PHP all you are doing is using PHP to send the right type of curl

    Edited by Garry Hill
  • 0
    Avatar

    You are right.I can send the sms without the plus sign( within my country).

    Thanks. I will give it a try

Please sign in to leave a comment.