HQSMS Https
HQSMS Https
Version 3.5
Table of contents
1. Introduction
1.1 How to start
1.2 IP filter for API interface
1.3 API password
2. Single SMS Message sending
2.1 Sending Fast messages (with highest priority)
2.2 Scheduled SMS sending
2.3 Deleting single scheduled messages
3. Bulk SMS sending
3.1 Sending SMS messages to numbers from phonebook group
3.2 Bulk personalized SMS sending using parameters
3.3 Bulk SMS sending using IDX parameter
3.4 Sending messages with cut.li
4. Sending messages using templates
5. mail2SMS Sending SMS using e-mail
7. SMS delivery confirmation receiving CALLBACK procedure
7. HLR lookup
8. Last sentence
Appendix 1 Delivery reports list
Appendix 2 Error codes
Appendix 3 Encoding
Appendix 4 Example scripts
History of changes
ComVision 2015
Page no: 2/21
1. Introduction
HQSMS 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 can have your company name or any phone number
that you owns. Every message sent in our system has its own unique id which allows you to receive its
delivery confirmation.
from
ComVision 2015
Page no: 3/21
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) should be &encoding=iso-8859-2
- for Windows-1250 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 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-0510T08:40:27+00:00) when message will be sent (&date=1287734110). Setting a
past date will result in sending message instantly.
date_validate
Check if date if given in proper format. Returns ERROR:54 if not.
datacoding
This parameter allows to send WAP PUSH messages. (&datacoding=bin)
idx
Optional custom value sent with SMS and sent back in CALLBACK (&idx=123).
check_idx
Prevents from sending more than one message with the same idx. 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. Defaut
value can be set in customers panel.
nounicode
Setting this parameter prevents from sending messages containing special
characters. ERROR: 11 will be returned when the message contains special
characters.
normalize
If message will contain special characters they will be replaced with equivalent (-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 mustnt be
sent with fast parameter.
expiration_date Message expiration date (in unix timestamp) is a date after which message won't be
delivered if it wasn't delivered yet. The difference between date sent and expiration
date can't be less than 15 minutes and more than 48 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 then default one (notify_url has higher priority than default
callback). ATTENTION! notify_url parameter may be used only for requests with one
numebr, it cannot be used for mass message sending.
*
- required field
Attention! Parameters group and to are exchangeable, one of these two parameter has to appear in
a request. Lack of any or appearing both of them will result in returning ERROR:13.
ComVision 2015
Page no: 4/21
Request:
https://api.hqsms.com/sms.do?
username=username&password=passwordMD5&from=sender_name
&to=44123456789&message=message_content
Response:
OK:<ID>:<POINTS>
or (when error occur)
ERROR:<ERR>
<ID>
<POINTS>
<ERR>
Example:
In case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: https://api2.hqsms.com/.
https://api.hqsms.com/sms.do?
username=username&password=passwordMD5&from=sender_name&to
=44123456789&fast=1&message=Fast_message_content
Response:
OK:<ID>:<POINTS>
or (when error occur)
ERROR:<ERR>
<ID>
<POINTS>
<ERR>
Example:
ATTENTION! Mass and marketing messages mustnt be sent with fast parameter. In case of sending
message to more than one recipient in a single request messages will be sent as normal ones, without
parameter &fast=1.
In case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: https://api2.hqsms.com/.
ComVision 2015
Page no: 5/21
https://api.hqsms.com/sms.do?
username=username&password=passwordMD5&to=44123456789&date=
1577878200&message=scheduled_message_content
Response:
OK:<ID>:<POINTS>
or (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.hqsms.com/.
Description
username *
password *
sch_del*
Example nr 1
Request:
https://api.hqsms.com/sms.do?
username=username&password=passwordMD5&
sch_del=09040616088106874
Response:
OK
or (when ID od message doesn't exist)
ERROR:301
Example ID:
09040616088106874
In case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: https://api2.hqsms.com/.
ComVision 2015
Page no: 6/21
ComVision 2015
Page no: 7/21
https://api.hqsms.com/sms.do?
username=username&password=passwordMD5&from=sender_name
&to=48500500500,48501501501,48502502502&message=message
Response:
OK:<ID>:<POINTS>:<PHONE>;...;...;...
<ID>
<POINTS>
<PHONE>
Example:
OK:17101000090567759:0.055:500500500;OK:171010000903455357:0.055:501500501;
OK:17101000096577326:0.055:502502502;
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.
In case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: https://api2.hqsms.com/.
ComVision 2015
Page no: 8/21
https://api.hqsms.com/sms.do?
username=username&password=passwordMD5&
group=test_goup&message=Test message sent to contacts from
phonebook
Response:
OK:<ID>:<POINTS>:<PHONE>;...;...;
<ID>
<POINTS>
<PHONE>
Example:
OK:17101000090567759:0.055:500500500;OK:171010000903455357:0.055:501500501;
OK:17101000096577326:0.055:502502502;
In case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: https://api2.hqsms.com/.
ComVision 2015
Page no: 9/21
[%2%]
[%3%]
[%4%]
Example:
https://api.hqsms.com/sms.do?
username=username&password=passwordMD5&from=sender_name&to=48600111222,
48500111222&message=Message content, parametr1: [%1%] parametr2: [%2%]
¶m1=John|Ann¶m2=30|40
Message will have following contents:
Message 1 : Message content, parametr1: John parametr2: 30
Message 2 : Message content, parametr1: Ann parametr2: 40
In case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: https://api2.hqsms.com/.
ComVision 2015
Page no: 10/21
ComVision 2015
Page no: 11/21
Template name
paramN
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)
Example:
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.
https://api.hqsms.com/sms.do?
username=username&password=passwordMD5&from=sender_name&to=44123456789
&template=Notify¶m1=Mark¶m2=BG12344423
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.
In case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: https://api2.hqsms.com/
ComVision 2015
Page no: 12/21
[email protected]
username@8456fkty567gb3bg37b357b3457b3457
from=sender_name&to=number&message=message_content
Adding parameter raport=1 will result in sending back e-mail with report (sent confirmation or error
code this is useful while testing the service):
TO:
[email protected]
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.
IMPORTANT! The recipient's number mustnt start with + sign. Parameter message must be at
the end of e-mail.
Sender name (parameter &from=) have to be active.
Request:
https://api.hqsms.com/sms.do?
username=username&password=password_in_md5&credits=1
Response:
Credits: <CREDITS>
or (when error occur)
ERROR:<ERR>
<CREDITS>
Example:
Credits: 100
In case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: https://api2.hqsms.com/.
ComVision 2015
Page no: 13/21
Message ID
status*
idx*
donedate*
to*
mcc
mnc
Script have to return OK (echo OK), otherwise the system will be sending requests every 300
seconds.
CALLBACK requests may be sent from one of following IP addresses: 62.181.2.52, 62.181.2.56,
31.186.85.46 and 31.186.82.159
7. 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 :
- http://api.hqsms.com/hlr.do for standard connections
- https://api.hqsms.com/hlr.do for SSL secured connections
with proper parameters described below. All information about numbers will be sent to address given
on our site https://api.hqsms.com at Callback address HLR in Settings API tab API Callback
settings.
It is important that entered address is a valid address to existing, available script.
After checking number in HLR information about number will be send to given URL in POST table.
There might be up to 20 numbers in one request.
Request:
ComVision 2015
Page no: 14/21
https://api.hqsms.com/hlr.do?
username=username&password=passwordMD5&number=44123123123,
44234234234
Response:
OK:<NUMBER>:<ID>:<POINTS>;OK:<NUMBER>:<ID>:<POINTS>;...;...
or
ERROR:<NUMBER>:<ERR>;ERROR:<NUMBER>:<ERR>;...;...
<NUMBER>
Checked number
<ID>
Checking unique ID.
<POINTS>
Number of used credits
<ERR>
Error code
Example:
OK:44123123123:80625:0.006;OK:44234234234:80627:0.006;
or
OK:44123123123:80625:0.006;ERROR:4433412333:13;
Returned parameters to script are described in following table:
Parameter
Description
id*
Unique Id of (request-number) which you will get when requesting to us with number
number*
Checked number
mcc*
mnc*
info*
status*
date*
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
ComVision 2015
Page no: 15/21
The list of possible error, which may appear in info field, with description is in Appendix 2 Error
codes.
Example:
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
)
)
Script have to return OK (echo OK), otherwise the system will be sending requests every 300
seconds.
In case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: https://api2.hqsms.com/
ComVision 2015
Page no: 16/21
8. Last sentence
Special characters are these that don't fulfill regular expression: @$_^{}\[~]|!"#
%&'()*+,-./0-9:;<=>?A-Za-z <enter>
ATTENTION! Chars: ^ { } [ ] ~ \ | <enter> according to GSM specification are being counted double
(when no special characters are in message).
Points charges table:
Without special characters
Characters amount
Number of parts
Characters amount
Number of parts
160
1 SMS
70
1 SMS
306
2 SMS
134
2 SMS
459
3 SMS
201
3 SMS
612
4 SMS
268
4 SMS
765
5 SMS
335
5 SMS
918
6 SMS
402
6 SMS
Attention! The newest HQSMS technical documentation is always in HELP on our website
https://www.hqsms.com/.
CALLBACK requests may be sent from one of following IP addresses: 89.174.81.98, 89.174.81.102,
91.185.184.29, 91.185.185.2 or 185.36.169.252
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',
),
ComVision 2015
Page no: 17/21
STATUS
Description
401
NOT_FOUND
402
EXPIRED
403
SENT
404
DELIVERED
405
UNDELIVERED
406
FAILED
407
REJECTED
408
UNKNOWN
409
QUEUED
410
ACCEPTED
412
STOP
Messages expired
Message is sent
Message is delivered to recipient
Message is undelivered (invalid number, roaming error etc)
Sending message failed please report it to us
Description
11
12
13
14
17
18
19
20
25
27
30
40
41
50
52
53
Not unique idx parameter, message with the same idx has been already sent
and &check_idx=1.
54
56
The difference between date sent and expiration date can't be less than 1 and
ComVision 2015
Page no: 18/21
72
74
Sending date doesn't match date sent restrictions set for the account.
101
102
103
104
No such template
105
200
201
202
301
400
999
Description
TELESERVICE_NOT_
PROVISIONED
SYSTEM_FAILURE
HLR_LOCAL_CANCEL /
HLR_ABORT
CALL_BARRED
Appendix 3 Encoding
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:
'iso-8859-1'
'iso-8859-2'
'iso-8859-3'
'iso-8859-4'
'iso-8859-5'
'iso-8859-7'
'windows-1250'
'windows-1251'
'utf-8'
Example:
ComVision 2015
Page no: 19/21
https://api.hqsms.com/sms.do?
username=username&password=passwordMD5&to=48500000000
&encoding=utf-8&message=message_content
ComVision 2015
Page no: 20/21
History of changes
Version
Changes
Ver. 3.5
Ver. 3.4.1
Ver. 3.4.0
1. Introducing ¬ify_url parameter and new error codes corresponding with it.
Ver. 3.3.0
Ver. 3.2.0
1. New date format allowed (ISO 8601) and new Error code 54 meaning wrong
date format.
2. New parameter &max_parts
Ver. 3.1.0
Ver. 3.0
ATTENTION! You can find the newest version of HQSMS technical documentation in tab Help on
our site http://www.hqsms.com/.
ComVision 2015
Page no: 21/21