Partner sends HTTP request to the address
http://smscomm.vero.lt/partner/sms.php.
Parameters must be URL-encoded and coded by UTF-8 format. The data submitted via GET method:
Title |
Description |
Example |
username |
Username |
demo |
password |
Login password |
demo |
action |
Requested action, possible values: • send – send SMS (default value); • validate – message error check, sending will not be executed; |
send |
sender |
Sender's phone number. Option can be activated by a separate agreement, in advance specifying what values will be used |
VeroDemo |
phone |
Recipient's phone number (MSISDN), international format „370xxxyyyyy“ |
37065659515 |
sms |
Message text (if WapPush, link title - tekstas) |
Demo SMS API message |
url |
(not necessary) If WapPush, then link title. |
http://project.com/site? parameter=value |
ident |
(not necessary) External system identifier, eg. ad number |
LT123 |
type |
(not necessary) Sending type (SMS, WapPush), by default SMS |
SMS |
service_id |
(not necessary) MBS service ID, to easy distinguish how much sending for different services costs for you. |
54321 |
operator |
(not necessary) Should be indicated only if the partner knows the recipient's operator. In this case message will be sent via channel with best price for that particular operator. Format: tele2_lt, bite_lt, tele2_lv ir kt. |
bite_lt |
send_date |
(not necessary) Message sending date. Should be indicated only if the partner wants to send messages later. If date is not specified, the message will be sent immediately. |
2016-11-13 14:00:00 |
timezone |
(not necessary) Message sending date time zone. Should be indicated only if the partner wants to send messages later and specify date for other time zone. If not specified – timezone „Europe/Vilnius“ is used as default. |
Europe/Vilnius |
dlrurl |
(not necessary) URL address for message delivery report. Should be specified only if partner will process delivery reports. |
http://project.com/messageDelivery.php |
priority |
(not necessary) Message priority. Higher priority is used for important messages to deliver them earlier than other messages (eg., registration code vs bulk advertisement).
• 2 – Very fast;
• 3 – Fast enough;
• 4 – Normal;
• 5 – No rush;
• 6 – Absolutely not hurry; |
3 |
charset |
(not necessary) Outgoing text rules (encoding):
• lisp – lisped characters;
• windows-1252 – Latin characters;
• windows-1257 – Baltic characters;
• windows-1251 – Cyrillic characters;
• utf-8 – Any characters;
If not specified, MBS, depending on the service settings, will lisp text or will apply the most suitable encoding for that text. |
lisp |
sms_template |
Your message template title. The message text will be uploaded from the template. |
foremployees |
sms_vars |
Template dynamic places values. Each value is described separately.
Dinamic places in template should be specified as %{name}% |
sms_vars[name]=John |
Once the HTTP GET request is sent, MBS returns a text string response with the format „{RESULT} {RESULT_DESCRIPTION}“. A list of possible results:
Result |
Description |
OK {SMS_ID} |
MBS accepted SMS request from partner and gave him a unique MBS system identifier - SMS_ID (eg. 12345) |
ERROR {ERROR_DESCRIPTION} |
SMS request was not accepted |
HTTP request example:
http://smscomm.vero.lt/partner/sms.php?username=demo&password=demo&
sender=VeroDemo&phone=37065659515&type=SMS&sms=Demo+SMS+API+message
Do not forget to code GET parameters (URL-encode). For URL-encode coding in PHP language http_build_query() or urlencode() functions should be used
EXAMPLE
The message is sent to the user and the result is printed to the screen.
If you work with PHP language you can use MBS PHP library class SMSComm
< !--?php
/**
* Raw SMS sending example
*
* @see MBSLib/examples/simple/send_sms.php
*
* @package RawExamples
* @author Valdas Petrulis
*/
// Messaging Configuration
define('SMSCOMM_SMS_URL', 'http://smscomm.vero.lt/partner/sms.php');
define('SMSCOMM_USERNAME', 'demo');
define('SMSCOMM_PASSWORD', 'demo');
$url = SMSCOMM_SMS_URL.'?'.http_build_query(array(
'username' => SMSCOMM_USERNAME,
'password' => SMSCOMM_PASSWORD,
'sender' => 'VeroDemo',
'phone' => '37065659515',
'sms' => 'Demo SMS API message',
));
$result = trim(file_get_contents($url));
if( $result=='OK' ) {
echo 'SMS sent';
} else {
echo 'Error in SMS: ' . $result;
}
?>
Example (REFERENCE LIBRARY)
PHP library used to connect to the Vero system, you can download here: MBS library