Sie sind auf Seite 1von 30

Documentation for SMSAPI (https)

Version 2.28.0
Documentation SMSAPI (https)
Wersja 2.28.0
Table of contents
1. ntroduction
1.1 How to start
1.2 P filter for AP interface
1.3 AP password
I. SMS SENDING
2. Single SMS Message sending
2.1 ECO messages sending
2.2 Fast messages sending
2.3 Scheduled SMS sending
2.4. Deleting scheduled messages
3. Multiple SMS sending
3.1 Sending messages to phonebook's group
3.2 Multiple personalized SMS sending using personalization parameters
3.3 Multiple SMS sending using DX parameter
3.4 Sending message with discount codes
4. Sending messages using templates
5. WAP PUSH messages
6. Sending vCard messages
7. mail2SMS Sending SMS using e-mail
8. Account balance checking
II. SENDING MMS MESSAGES
9. Sending MMS messages
III. SENDING VMS MESSAGES
10. Sending VMS messages
IV. MESSAGES DELIVERY CONFIRMATION RECEIVING
11. SMS delivery confirmation receiving CALLBACK procedure
12. MMS delivery confirmation receiving CALLBACK procedure
13. VMS delivery confirmation receiving CALLBACK procedure
14. Bulk CALLBACK
ComVision 2013
Page no: 2/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
V. SMS AND MMS MESSAGES RECEIVING
15. SMS/MMS receiving
15.1 SMS receiving
15.2 MMS receiving
VI. HLR LOOKU SERVICE
16. HLR Lookup
VII. SUMMARATION
17. Last sentence
Appendix 1 Delivery reports list
Appendix 2 Error codes
Appendix 3 - Encoding
Appendix 4 Example scripts
History of changes
ComVision 2013
Page no: 3/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
!. Int"o#$ct%on
SMSAP is a high quality SMS platform which enables you to integrate any of your applications
with our SMS/MMS 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.
!.! Ho& to sta"t
To start using SMSAP you need to register and create an account on our website:
URL a##"ess: 'tt()**&&&.s+sa(%.(l*
Registration is completely free. Your account is ready to use just after you register, but we recommend
you to verify at least one sender name or number. Every message sent before validation has the
,SMSAP" as a default name.
!., I f%lte" fo" AI %nte"face
n order to improve interface AP protection you may set list of P addresses which will be whitelisted.
You may do it in ,USTAWENA ,AP tab ,Filtr adresw P in field F%lt" a#"es-& I. t will be
possible to send messages only from these whitelisted P addresses (try of sending from other Ps will
result in responding: ERROR:105). P addresses should be separated by semicolon.
!.. AI (ass&o"#
AP password after registering is the same as web panel password. You may change your AP
password in Ustawienia AP. Changing your web panel password doesn't change AP password.
,. S%n/le SMS Messa/e sen#%n/
URL links needed for connecting with our application:
- 'tt(s)**ssl.s+sa(%.(l*s+s.#o for SSL secured connections 256bit v3.0
- 'tt(s)**ssl,.s+sa(%.(l*s+s.#o 0 backup for SSL secured connections 256bit v3.0
- http://api.smsapi.pl/sms.do for unsecured connections (Un"eco++en#e#1)
- http://api2.smsapi.pl/sms.do - backup for unsecured connections (Un"eco++en#e#1)
Messages should be sent as a HTTP GET or POST request to our system:
a"a+ete" Desc"%(t%on
username * Username used to identify a user in our system or e-mail address connected with
the account
password * Password to Your account hashed with MD5
to * Mobile phone number of the recipient (i.e. 48505602702 ).
group * Name of the group from the phonebook 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 three messages. Detailed information
about special characters are given in chapter 14.
from Name of the sender. As a default the sender name is set to ,SMSAP. Only verified
names are being accepted (&from=active_name). Sender name may be set after
loging into web panel on www.smsapi.pl in USTAWENA POLA NADAWCY.
encoding This parameter describes the encoding of the message text. Windows-1250 is set as
default. f another encoding is needed parameter encoding should have following
vaule:
- for iso-8859-2 (latin2) should be &encoding=iso-8859-2
- for utf-8 should be &encoding=utf-8
ComVision 2013
Page no: 4/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
flash Sending a massage 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, lenght and sms count). (&details=1)
date Date in unix timestamp (&date=1287734110) or in SO 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 Check if date if given in proper format. Returns ERROR:54 if not
datacoding This parameter allows to send 2A USH messages. (&datacoding=bin)
skip_foreign Setting this parameter (&skip_foreign=1) causes skipping all non-polish numbers
from the request and sending message only to Polish ones.
idx Optional custom value sent with SMS and sent back in CALLBACK. Parameetr idx
may contain up to 36 chars, allowd are digits 3 4 5 and letters a 4 6 (parameter is
not case sensitive). (&idx=123)
check_idx f this parameter is set (&check_idx=1) system checks if message with the same idx
value was already sent, if yes error 53 is returned.
sms2way Setting this parameter to ,1 (&sms2way=1) will result in sending 2way message.
eco Setting this parameter to ,1 will result in sending ECO message (ECO messages
are sent with 9-digits phone number in sender name)
nounicode Setting this parameter prevents from sending messages containing special
charackters. ERROR) !! will be returned when the message contains special
charackters.
normalize Setting this parameter to "1 result in changing inter alia polish chars like "q, "s, "c
etc. to "a, "s, "c. The full list of chars that may be changed is in section 15. Last
sentence. Attent%on1 Appearing other special chars than presented in Last sentence
will result in sending message in encoding like "with special chars
fast Setting this parameter to ,1 will result in sending message with the highest priority
which ensures the quickest possible time of delivery. This parameter may be used
for both PRO and ECO messages. Fast messages costs 50% more than normal
message. Attent%on1 Mass and marketing messages musn't be sent with fast
parameter.
partner_id Partner code which you will get after signing Partner agreement.
max_parts Defines maximum message parts allowed, maximum value allowed is 6.
ERROR) !, will be returned when the message has more parts than defined.
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 1 hour and more than 12 hours. Time will be set with
tolerance +/- 5 minutes.
discoint_group Name of the discounts' codes group from which codes should be sent. Groups can
be added or edited in customers panel.
notify_url This parameter allows to set URL address to delivery report receiving callback script
for this specific messages. This URL will be used instead of global callback script
URL set on the account. ATTENTION1 This Parameter may be used only for single
messages.
- required field
Attent%on1 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.s
ComVision 2013
Page no: 5/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
Request: 'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8username9(ass&o"#8+#:;password)9f"o+8sender_name
9to8<=:33:33:339+essa/e8message_content
Response: OK)>ID?)>OINTS?
or (when error occur)
ERROR)>ERR?
>ID? Message unique D. You will need it for delivery corfirmation
>OINTS? Amount of used credits (i.e. Text sent in 3 messages will return 3xSMS
amount)
>ERR? Error code (check the error code list in Appendix 2)
Example: OK)!@!3!333353.A3.:5)3.!A:
or
ERROR)!3,
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*
,.! ECO +essa/es sen#%n/
ECO messages are being sent from random 9-digits polish phone number (no possibili of setting
alphanumeric sendername). To send ECO messages parameter &eco should be set to ,1 (&eco=1)
also for mass sendings.
Request: 'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8 username 9 password=md5(password)&to=48500500500&eco
=1&message=ECO_message_content
Response: OK)>ID?)>OINTS?
or (when error occur)
ERROR)>ERR?
>ID? Message unique D. You will need it for delivery corfirmation
>OINTS? Amount of used credits (i.e. Text sent in 3 messages will return 3xSMS
amount)
>ERR? Error code (check the error code list in Appendix 2)
Example: OK)!@!3!333353.A3.:5)3.3@
or
ERROR)!3,
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*.
ComVision 2013
Page no: 6/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
,., Fast +essa/es sen#%n/
Setting parameter fast to ,1 (&fast=1) ill result in sending message with the highest priority which
ensures the quickest possible time of delivery. This parameter may be used for both PRO and ECO
messages. Fast messages costs 50% more than normal message.
Request: 'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8 username 9(ass&o"#8 password 9to8<=:33:33:339fast8!9+
essa/e8 Fast_message _content
Response: OK)>ID?)>OINTS?
or (when error occur)
ERROR)>ERR?
>ID? Message unique D. You will need it for delivery corfirmation
>OINTS? Amount of used credits (i.e. Text sent in 3 messages will return 3xSMS
amount)
>ERR? Error code (check the error code list in Appendix 2)
Example: OK)!@!3!333353.A3.:5)3.,!
or
ERROR)!3,
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*.
ATTENTION1 Mass and marketing messages musn't be sent with fast parameter. n case of sending
message to more than one recipient in a single request messages will be sent as normal ones, without
parameter &fast=1.
,.. Sc'e#$le# SMS sen#%n/
To send message at specified date and hour parameter 9#ate has to be used. This parameter
should be in unix timespamp format.
,.: Sen#%n/ +essa/es to ('oneb
Zapytanie: 'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8 username&password= md5(password)&to485005005009#ate8!:@
@=@=,339+essa/e8schedued_message_content
Response: OK)>ID?)>OINTS?
or (when error occur)
ERROR)>ERR?
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*.
ComVision 2013
Page no: 7/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
,.<. Delet%n/ sc'e#$le# +essa/es
a"a+ete" Desc"%(t%on
username * Username used to identify a user in our system or e-mail address
connected with the account
password * Password to Your account hashed in MD5
sch_del* D of message to delete (returned after sending one).
* - required fields
Request: 'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8username9(ass&o"#8+#:;password)9
sc'B#el8353<3A!A3==!3A=@<
Response: OK
or (when D od message doesn't exist)
ERROR).3!
Example D: 09040616088106874
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*.
ComVision 2013
Page no: 8/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
.. M$lt%(le SMS sen#%n/
Sendiing messages to a group of recipients is similar to single submission (presented in
chapter 2). The only difference is filling field to with multiple set of recipients numbers. n 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. Using
f the total cost of sending this message is greaterhan the number of available credits on
user's account, the system will respond !3. error code and all messages will be rejected.
f some of given recipient's numbers will be invalid (unrecognized by SMSAP due to wrong
prefix or landline number) than these numbers will be skipped and all other will be sent. Delivery
reports will not cocern the skipped numbers. f any number will appear more than once in one request
message will be sent only once to this recipient.
Request: 'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8username9(ass&o"#8+#:;password)9f"o+8sender_name
9to8<=:33:33:33C<=:3!:3!:3!C<=:3,:3,:3,9+essa/e8message
Response: OK)>ID?)>OINTS?)>HONE?D...D...D...
>ID? Message unique D. You will need it for delivery corfirmation
>OINTS? Number of used credits (i.e. Text sent in 3 messages will return 3xSMS
amount)
>HONE? Recipient's phone number
Example:
OK)!@!3!333353:A@@:5)3.!<):33:33:33DOK)!@!3!333353.<::.:@)3.!<):3!:33:3!D
OK)!@!3!33335A:@@.,A)3.!<):3,:3,:3,D
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 OST method is !3333, for
GET method it is ,33 messages.
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*.
..! Sen#%n/ +essa/es to ('onebooEFs /"o$(
To send messages to specified group first this group should be created in web panel on
www.smsapi.pl in menu KSAZKA TELEFONCZNA (ang.: phonebook). An example is presented
below:
Request: 'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8$se"na+e9(ass&o"#8+#:;(ass&o"#G9/"o$(8test_group
9+essa/e8Messa/eBcontent
Response: OK)>ID?)>OINTS?)>HONE?D...D...D...
>ID? Message unique D. You will need it for delivery corfirmation
>OINTS? Number of used credits (i.e. Text sent in 3 messages will return 3xSMS
amount)
>HONE? Recipient's phone number
Example:
OK)!@!3!333353:A@@:5)3.!<):33:33:33DOK)!@!3!333353.<::.:@)3.!<):3!:33:3!D
OK)!@!3!33335A:@@.,A)3.!<):3,:3,:3,D
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*.
ComVision 2013
Page no: 9/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
.., M$lt%(le (e"sonal%6e# SMS sen#%n/ $s%n/ (e"sonal%6at%on (a"a+ete"s
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 have to be used.
Personalization parameters should be definied in request as (a"a+!C (a"a+,C (a"a+.C (a"a+<C
which will replace HI!IJC HI,IJC HI.IJ oraz HI<IJ in message content. Values of these
parameters have to be separate by pipe char ,K according to the template below:
(a"a+!8An%aKM%c'alKAn#"6eL9(a"a+,8No&aEKKo&alsE%KNo&aEo&sE%
The number of parameters has to be exactly the same as number of recipients in a request otherwise
ERROR: 18 will be returned and message won't be sent.
IMORTANT1 Length of message ma be different depending on the length of parameter value.
f one of numbers will be invalid message to this number will be skipped and the rest will be sent.
a"a+ete"s
After definying parameters the may be used in message content:
HI!IJ Value of parameter 1 (param1)
HI,IJ Value of parameter 2 (param2)
HI.IJ Value of parameter 3 (param3)
HI<IJ Value of parameter 4 (param4)
EMa+(le)
'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8username9(ass&o"#8password9f"o+8sender_name9to8<=A33!!!,,,C
<=:33!!!,,,9+ess a/e8Messa/e contentC (a"a+et"!) HI!IJ (a"a+et",) HI,IJ
9(a"a+!8NanKAn%a9(a"a+,8.3K<3
Message will have following contents:
Message 1 : Message content, parametr1: Nan parametr2: .3
Message 2 : Message content, parametr1: An%a parametr2: <3
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*.
... M$lt%(le SMS sen#%n/ $s%n/ IDO (a"a+ete"
There is possibility to send mass messages with custom parameter IDO different for each mesage.
This parameter then is returned in CALLBACK. With parameter idx additional parameter c'ecEB%#M
(&check_idx=1). Using check_idx parameter prevents from two message with the same idx parameter
value. To use it add at the end of request:
&%#M8%#M!K%#M,K%#M.K%#M<
Number of DX parameters have to be equal to the number of recipients' number given in request.
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*.
ComVision 2013
Page no: 10/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
..< Sen#%n/ +essa/e &%t' #%sco$nt co#es
SMSAP allwos to send messages with discount codes in the message content. To send
messages with discount codes you have to first prepare list of codes in web panel in menu PMORE
FUNCTIONQ R PDISCOUNT CODESQ. Code can be imported from previously prepared csv file or
you may use built in codes generator.
While sending messages codes are taken from selected group are marked as used (one code can be
used only one). To be able to use codes the list has to be active (,Date expire hasn't expired) and
contain enough unused codes.
Request: 'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8username9(ass&o"#8password9f"o+8sender_name
9to8<=:33:33:33C<=:3!:3!:3!C<=:3,:3,:3,9#%sco$ntB/o$(8co#es9+e
ssa/e8testB+essa/eB&%t'B#%sco$ntBco#es!_"#$od#%_the_end&
Response: OK)>ID?)>OINTS?)>HONE?D...D...D...
>ID? Message unique D. You will need it for delivery corfirmation
>OINTS? Number of used credits (i.e. Text sent in 3 messages will return 3xSMS
amount)
>HONE? Recipient's phone number
Example:
OK)!@!3!333353:A@@:5)3.!<):33:33:33DOK)!@!3!333353.<::.:@)3.!<):3!:33:3!D
OK)!@!3!33335A:@@.,A)3.!<):3,:3,:3,D
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used 'tt(s)**ssl,.s+sa(%.(l*.
ComVision 2013
Page no: 11/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
<. Sen#%n/ +essa/es $s%n/ te+(lates
Using templates it is very easy to change standard notification messages (ma be used in
shops, internet services, medical clinics etc.) without changing php script that implements SMS
sending.
To use templates You should:
After loging on http://www.smsapi.pl add tempate in !"!# $stawienia# !%a&lon'#
Places which should be replaced by a parameter shoul be given [%N%] where N is number
between 1 and 4 (parameter number)
To use a template in AP request there should appear &templates=template_name in the request
Apart from all basic parameters while using templates following parameters are available:
a"a+ete" Desc"%(ct%on
template Template name
param'
The value of this parameter will replace [%N%] in the template wherew N is a
number between ! and <
single
f the message will contain more than 160 chars (single message) it won't be
sent and ERROR:12 will be replied (&single=1)
EMa+(le)
Template name: Not%fS
Template content: Hello HI!IJ, Your order has been sent. The shipment number is HI,IJ You ma y
follow it on our site.
'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8username9(ass&o"#8password9f"o+8sen#e"Bna+e9to8<=A33!!!,,,
9te+(late8Not%fS9(a"a+!8Ma"c%n9(a"a+,8TG!,.<<<,.
The content of sent message:
Hello Ma"c%n, Your order has been sent. The shipment number i TG!,.<<<,. You ma y follow it on
our site.
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*.
:. 2A USH +essa/es
(o send WA) )$!* message the lin+ and message content ha,e to &e &e co,erted to &innar'. -t
ma' &e done using a co,erter that ma' &e found in ta& )."./ on https://www.smsapi.pl.
The result of the conversion should be given in a request as a message content. There should be
used following parameters 9#ataco#%n/8b%n and 9$#'83A3:3<3b=<,.f3 in AP request.
EMa+(le)
https://ssl.smsapi.pl/sms.do?
username=username&password=password&from=sender_name&to=48501502503&datacoding=bin&
udh=0605040b8423f0&message=0605040b8423f0860601ae02056a0045c60c03687474703a2f2f7777
772e736d736170692e706c000701034e61737a61207374726f6e613a000101
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*.
ComVision 2013
Page no: 12/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
A. Sen#%n/ UCa"# +essa/es
(o send ,/ard message the lin+ and message content ha,e to &e &e co,erted to &innar'. -t ma'
&e done using a co,erter that ma' &e found in ta& )."./ on https://www.smsapi.pl
The result of the conversion should be given in a request as a message content. There should be
used following parameters 9#ataco#%n/8b%n and 9$#'83A3:3<,.F<3333 in AP request.
EMa+(le)
https://ssl.smsapi.pl/sms.do?
username=username&password=password&from=sender_name&to=48501502503&datacoding=bin&
u#'83A3:3<,.F<3333&message=
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*
@. +a%l,SMS 4 Sen#%n/ SMS $s%n/ e0+a%l
To send sms using mail2sms e-mail should be created according to followin scheme:
TO: s+s.#oVs+sa(%.(l
SUBJECT: $se"na+eV(ass&o"#B'as'e#B%nB+#:
CONTENT: f"o+8sender_name9to8num(er9+essa/e8+essa/eBcontent
ATTENTION1 Password should be given hashed in MD5
EMa+(le:
TO: s+s.#oVs+sa(%.(l
SUBJECT: $se"na+eV=<:AfEtS:A@/b.b/.@b.:@b.<:@b.<:@
CONTENT: f"o+8sender_name9to8num(er9+essa/e8+essa/eBcontent
Adding parameter "a(o"t8! will result in sending back e-mail with report (sent confirmation or error
code this is useful while testing the service):
TO: s+s.#oVs+sa(%.(l
SUBJECT: usernameV (ass&o"#B'as'e#B%nB+#:
CONTENT: f"o+8sender_name9to8num(er9"a(o"t8!9+essa/e8message_content
Mail may be sent in plain / quotedprintable / base64 encoding.
All parameters presented in Section 2. "Single SMS message sending are available in mail2sms.
Sender name (parameter &from=) has to be active.
To send ECO message using mail2SMS parameter &eco=1 has to be used.
IMORTANT1 Thne recipient's number musn't start with ,+ sign. a"a+ete" P+essa/eQ +$st be at
t'e en# of e0+a%l.
ComVision 2013
Page no: 13/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
=. Acco$nt balance c'ecE%n/
User's account administration is done by sending HTTP GET or OST request to our system:
a"a+ete" Desc"%(t%on
username * Username used to identify a user in our system
password * AP password to Your account hashed with MD5
credits* &credits=1
- required field
Request: 'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8username9(ass&o"#8(ass&o"#B%n_md5 9c"e#%ts8!
Response: o%nts) >OINTS?
or (when error occur)
ERROR)>ERR?
>OINTS? number of points available for this user
Example: o%nts) !33
5. Sen#%n/ MMS +essa/es
For sending MMS messages please send a request to one of following address
https://ssl.smsapi.pl/mms.do ;Not "eco++en#e#1G or https://ssl.smsapi.pl/mms.do for SSL
connections with proper parameters.
T'e follo&%n/ table #esc"%bes (a"a+ete"s t'at a"e "eW$%"e# to sen# MMS +essa/e)
a"a+ete" Desc"%(ct%on
username * Username used to identify a user in our system or e-mail address connected
with the account
password * Password to Your account hashed with MD5
to * Mobile phone number of the recipient (i.e. 48505602702 ).
group * Name of the group from the phonebook to which message should be sent.
subect * MMS message subject. Subject may contain up to 30 characters, if subject is
longer error 26 is returned.
date Date in unix timestamp (&date=1287734110) or in SO 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.
smil * MMS message in SML (example in Appendix 4)
idx Optional custom value sent with SMS and sent back in CALLBACK. Parameetr
idx may contain up to 36 chars, allowd are digits 3 4 5 and letters a 4 6
(parameter is not case sensitive). (&idx=123)
check_idx f this parameter is set (&check_idx=1) system checks if message with the
same idx value was already sent, if yes error 53 is returned.
- required fields
Attent%on1 Parameters group and to are exchangeable, one of them has to be in the request. Lack of
any of them will return ERROR: 13 in the result.
ComVision 2013
Page no: 14/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
Request: 'tt(s)**ssl.s+sa(%.(l*++s.#o7
$se"na+e8$se"na+e9(ass&o"#8(ass&o"#9to8<=:33:33:339s$bLect8T
estMMS9s+%l8Hs+%lJ
Response: OK)>ID?)>OINTS?
or (when error occur)
ERROR)>ERR?
>ID? MMS message unique D. You will need it for delivery corfirmation
>OINTS? Amount of used credits (i.e. Text sent in 3 messages will return 3xSMS
amount)
>ERR? Error code (check the error code list in Appendix 2)
Example: OK)!@!3!333353.A3.:5)3.<
or
ERROR)!3,
E XAMPLE OF SENDING MMS
n case of any problems with sending requests to basic URL (as in example above) backup URL may
be used: 'tt(s)**ssl,.s+sa(%.(l*.
!3. Sen#%n/ VMS +essa/es
For sending MMS messages please send a request to one of following address
https://ssl.smsapi.pl/vms.do ;Not "eco++en#e#1G or https://ssl.smsapi.pl/vms.do for SSL connections
with proper parameters.
T'e follo&%n/ table #esc"%bes (a"a+ete"s t'at a"e "eW$%"e# to sen# MMS +essa/e.
a"a+ete" Desc"%(t%on
username * Username used to identify a user in our system or e-mail address connected
with the account
password * Password to Your account hashed with MD5
from * Calling number. Leaving this parameter empty causes sending message with
default calling number. Only verified and accepted number may be used.
Number may be added in SMSAP's web panel in menu
VMS CALLNG NUMBERS
to * Mobile phone number of the recipient (i.e. 48505602702 ).
group * Name of the group from the phonebook to which message should be sent.
tts X The content of message in written text in UTF-8 encoding (for other encoding
Error:11 will be returend).
!ile X Content of message in wave file, acceptable are URL to file existing in web ora
a file sent by multipart from-data method
date Date in unix timestamp (&date=1287734110) or in SO 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.
try Number of delivery tries when call is not answered or rejected
interval An interval between tries (min 1800s)
skip_gsm Setting this parameter (skip_gsm=1) results in skipping GSM numbers and
ComVision 2013
Page no: 15/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
send VMS only to landline ones
idx Optional custom value sent with SMS and sent back in CALLBACK. Parameetr
idx may contain up to 36 chars, allowd are digits 3 4 5 and letters a 4 6
(parameter is not case sensitive). (&idx=123)
check_idx f this parameter is set (&check_idx=1) system checks if message with the
same idx value was already sent, if yes error 53 is returned.
tts_lector Defines name of lector which will read typed text. Available lectors: a/n%es6EaC
e&aC LaceEC LanC +aLa. Default value: jan. Error 35 shows when wrong value
given.
- required fields
Attent%on1 Parameters tts and )ie are exchangeable, in a request should appear on of them. Lack of
them or appearing both will result in not sending the message and responding ERROR: 11.
Attent%on1 Parameters group and to are exchangeable, in a request should appear on of them. Lack
of them or appearing both will result in not sending the message and responding ERROR: 13.
Request: 'tt(s)**ssl.s+sa(%.(l*U+s.#o7$se"na+e8username9(ass&o"#8password
9to8<=:33:33:339tts8testB+essa/e
or: 'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8username9(ass&o"#8password99to8<=:33:33:339f%le8'tt(
)**a##"ess.to*f%le.&aU
Response: OK)>ID?)>OINTS?
or (when error occur)
ERROR)>ERR?
>ID? VMS message unique D. You will need it for delivery corfirmation
>OINTS? Amount of used credits (i.e. Text sent in 3 messages will return 3xSMS
amount)
>ERR? Error code (check the error code list in Appendix 2)
Example: OK)!@!3!333353.A3.:5)3.<
or
ERROR)!3,
ATTENTION1 Voice messages may be sent only between 8am and 9 pm. Requests submitted
betwwen 9pm and 8am will be sent at 8am.
!!. SMS #el%Ue"S conf%"+at%on "ece%U%n/ 4 CALLTACK ("oce#$"e
We offer You possibility to run any available sctipt in the web with callback delivery reports. n
order to use this option please login on our site https://www.smsapi.pl and set the , Adres ca!ac" -
raport# SMS in ,Ustawienia ,AP tab ,Adresy callback.
Example.: http://www.my_site.pl/status_update.php
t is important that entered address is a valid address to existing, available script.
After updating message status in SMSAP system the update will be sent to callback script (1 to 5
statuses in one request). Parameter will be sent using GET method separated by commas:
YBGETHFMs/I#FJ=09062414383994024,09062414383994025
ComVision 2013
Page no: 16/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
YBGETHFstat$sFJ=403,404
Parameter are described in following table:
a"a+ete" Desc"%(t%on
Ms/I#X Message D
stat$sX Status code, list of codes can be find in 'Appendix 1'
%#MX Opcjonalny parametr uzytkownika wyslany z SMS'em
#one#ateX Czas dostarczenia wiadomosci w formacie timestamp
$se"na+eX Nazwa uzytkownika wysylajqcego wiadomosc
* All characters are case sensitive
Sc"%(t 'aUe to "et$"n OK ;echo *O+,G, otherwise the system will be sending requests every 300
seconds.
!,. MMS #el%Ue"S conf%"+at%on "ece%U%n/ 4 CALLTACK ("oce#$"e
n order to check MMS message delivery status please log in to web panel and enter in
,Ustawienia ,AP the address to a script to which delivery statuses shoul be sent.
i.e.: http://www.my_page.pl/status_update.php
We suggest You to check the correctness of Your scipt address before its submission.
When this request is called, the system will respond and pass To Your script all parameters needed
for delivery confirmation (GET method is used) i.e.:
Ms/I#=09062414383994024
stat$s=404
Following table describes parameters that are sent:
a"a+ete" Desc"%(ct%on
Ms/I#X Message D
stat$sX Response confirmation code (ND) check status list in
Appendix 1
%#MX Opcjonalny parametr uzytkownika wyslany z SMS'em
#one#ateX Time (in timestamp) of delivery report
$se"na+eX Username from wchich message was sent
* All characters are case sensitive
Sc"%(t 'as to "et$"n OK ;echo *O+,G, otherwise the system will be sending requests every 300
seconds.
ComVision 2013
Page no: 17/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
!.. VMS #el%Ue"S conf%"+at%on "ece%U%n/ 4 CALLTACK ("oce#$"e
n order to check VMS message delivery status please log in to web panel and enter in
,Ustawienia ,AP the address to a script to which delivery statuses shoul be sent.
i.e.: http"##www$my_page$pl#status_update$php
We suggest You to check the correctness of Your scipt address before its submission.
When this request is called, the system will respond and pass To Your script all parameters needed
for delivery confirmation (GET method is used) i.e.:
Ms/I#=09062414383994024
stat$s=404
Following table describes parameters that are sent:
a"a+ete" Desc"%(ct%on
Ms/I#X Message D
stat$sX Response confirmation code (ND) check status list in
Appendix 1
%#MX Opcjonalny parametr uzytkownika wyslany z SMS'em
#one#ateX Time (in timestamp) of delivery report
$se"na+eX Username from wchich message was sent
("esse#X Key pressed while listening the message
'an/$(Bt%+eX Time after which recipient hang up
* All characters are case sensitive
Sc"%(t 'as to "et$"n OK ;echo *O+,G, otherwise the system will be sending requests every 300
seconds.
!<. T$lE CALLTACK
Bulk CALLBACK script receives request the moment that sending bulk started. This feature is
generally usefull for scheduled bulks. Request contains parameters presented in table below. n order
to enable Bulk CALLBACK please enter CALLBACK script URL in ,Settings ,AP
Example: 'tt()**&&&.+oLaBst"ona.(l*b$lEBcallbacE.('(
t is important that entered address is a valid address to existing, available script.
Parameter are described in following table:
a"a+ete" Desc"%(t%on
tS(eX Messages' type SMS/MMS/VMS
allX Amoint of messages (numbers) in bulk.
(o%ntsX Bulk's cost
toX Points out which tab in SMS gateway was used csv, csv_and_text or
phonebook.
%nfoX When bulk i sent to groups from phonebook contains groups' names.
teMtX Content of sent message.
* - nalezy zachowac wielkosc znakw!
Sc"%(t 'aUe to "et$"n OK ;echo *O+,G, otherwise the system will be sending requests every 300
seconds.
ComVision 2013
Page no: 18/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
!:. SMS*MMS "ece%U%n/
SMSAI provides also SMS or MMS receiving service. Reponses fo ECO messages may be received
(only if the response was sent up to 24h after sending ECO message). SMS and/or MMS messages
may be also received on dedicated 9-digit number which is connected only with one specific client.
!:.! SMS "ece%U%n/
Receiving messages may be done using CALLBACK script located on client's server. Address to this
script should be entered in ,Ustawienia ,AP. The scrips works as follows:
After receiving message we will send querry to the script with POST table that contains following
parameters:
a"a+ete" Desc"%(ct%on
sms_to Recipient's phone number
sms_from Sender phone number
sms_text Message contentent
sms_date Date in timestamp taken from the message
Msgd For ECO receiving D of message to which
this message is response, for receiving on
dedicated number this field will be empty
username Username of the client to which message
has been assigned
smsc SMS Centre that delivered this message
Data will be sent in UTF-8 encoding.
Sc"%(t 'as to "et$"n OK ;echo *O+,G, otherwise the system will be sending requests every 300
seconds.
!:., MMS "ece%U%n/
Receiving messages may be done using CALLBACK script located on client's server. Address to this
script should be entered in ,Ustawienia ,AP. The scrips works as follows:
After receiving message we will send querry to the script with POST table that contains following
parameters:
OST table)
a"a+ete" Desc"%(t%on
mms_to Recipient's phone number
mms_from Sender phone number
mms_subject Message subject
mms_date Date in timestamp taken from the message
ComVision 2013
Page no: 19/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
FILES table)
a"a+et" O(%s
name Original file name
type MME type (JPEG, GF, ...)
tmp_name Temporary file name, which has been sent to the server
error Error code (0 means no error, proper sending)
size Size of sent file (in bytes)
Data will be sent in UTF-8 encoding.
Sc"%(t 'as to "et$"n OK ;echo *O+,G, otherwise the system will be sending requests every 300
seconds. E XAMPLE
Requests may be sent with SSL connection (https://..).
!A. HLR LooE$(
HLR (Home location Register) is an extent base including different kinds of information about
every working telephone number in GSM. n order to use this option you should request URL :
https://ssl.smsapi.pl/api/hlr.do with proper parameters described below. All information about numbers
will be sent to address given on our site https://ssl.smsapi.pl at ,Callback address HLR in ,Settings
,AP tab ,AP Callback settings.
t 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: 'tt(s)**ssl.s+sa(%.(l*a(%*'l".#o7
$se"na+e8username9(ass&o"#8+#:;password)9n$+be"8<<!,.!,.!,.
C<<,.<,.<,.<9%#M8!,.K,.<
Response: OK)>NUMTER?)>ID?)>OINTS?DOK)>NUMTER?)>ID?)>OINTS?D...D...
o"
ERROR)>NUMTER?)>ERR?DERROR)>NUMTER?)>ERR?D...D...
>NUMTER? Checked number
>ID? Checking unique D.
>OINTS? Number of used credits
>ERR? Error code
Example:
OK)<<!,.!,.!,.)=3A,:)3.33ADOK)<<,.<,.<,.<)=3A,@)3.33AD
o"
OK)<<!,.!,.!,.)=3A,:)3.33ADERROR)<<..<!,...)!.D
ComVision 2013
Page no: 20/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
Returned parameters to script are described in following table:
a"a+ete" Desc"%(t%on
%#X Unique d of (request-number) which you will get when
requesting to us with number
n$+be"X Checked number
+ccX Mobile country code
+ncX Mobile network code
%nfoX Name of network or description of error
stat$sX OK when number is correct, FAL when number is wrong
#ateX UNX timestamp when number was checked
(o"te#X 0 number not ported, 1 number ported
(o"te#Bf"o+X null when number is not ported or name of network from
which number is ported
%#M Optional custom value sent with HLR request and sent
back in CALLBACK (&idx=123)
*All characters are case sensitive
The list of possible error, which may appear in %nfo field, with description is in A((en#%M , 4 E""o"
co#es.
Example return:
Array
(
[0] => Array
(
[id] => 80625
[number] => 48600600600
[mcc] => 260
[mnc] => 2
[info] => T-Mobile
[saus] => !"
[dae] => #$02%0$60&
['ored] => 0
['ored(from] => null
)
[#] => Array
(
[id] => 8062%
[number] => 48500600%00
[mcc] => 260
[mnc] => 2
[info] => A*+,-T(+.*+/01*,0
[saus] => 2A13
[dae] => #$02%0$60&
['ored] => 0
['ored(from] => null
)
)
Sc"%(t 'aUe to "et$"n OK ;echo *O+,G, otherwise the system will be sending requests every 300
seconds.
ComVision 2013
Page no: 21/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
!@. Last sentence
Phone numbers should be given in 11-digits format (i.e. 48502602702). When national prefix
is not given, polish national prefix (48) will be added.
Special characters are these that don't fulfill regular expression: @$_^{}\[~]|!"#
%&'()*+,-./0-9:;<=>?A-Za-z <enter>
ATTENTION1 Chars: ^ { } [ ] ~ \ | <enter> according to GSM specificiation are being counted #o$ble
(when no special characters are in message).
L%st of s(ec%al c'a"s t'at +aS be c'an/e# to no"+al ones $s%n/ (a"a+ete" &normai-e)
'normalize_chars' =$ array%
&'&=$&S&( &)&=$&s&( &*&=$&S&( &+&=$&s&( &,&=$&D-&( &.&=$&d-&( &/&=$&0&( &1&=$&0&(&2&=$&3&( &4&=$&3&( &5&=$&3&(
&6&=$&0&( &7&=$&8&( &9&=$&c&( &:&=$&8&( &;&=$&c&( &<&=$&A&( &=&=$&A&( &>&=$&A&( &?&=$&A&( &@&=$&A&( &A&=$&A&(
&B&=$&A&( &C&=$&A&( &D&=$&8&( &E&=$&E&( &F&=$&E&( &G&=$&E&( &H&=$&e&( &I&=$&E&( &J&=$&E&( &K&=$&I&( &L&=$&I&(
&M&=$&I&( &N&=$&I&( &O&=$&N&( &P&=$&O&( &Q&=$&O&( &R&=$&O&( &S&=$&L&( &T&=$&&( &U&=$&N&( &V&=$&n&( &W&=$&O&(
&X&=$&O&( &Y&=$&O&( &Z&=$&[&( &\&=$&[&( &]&=$&[&( &^&=$&[&( &_&=$&`&( &a&=$&b&( &c&=$&Ss&(&d&=$&a&( &e&=$&a&(
&f&=$&a&( &g&=$&a&( &h&=$&a&( &i&=$&a&( &j&=$&a&( &k&=$&a&( &l&=$&c&( &m&=$&e&( &n&=$&e&( &o&=$&e&( &p&=$&e&(
&q&=$&i&( &r&=$&i&( &s&=$&i&( &t&=$&i&( &u&=$&o&( &v&=$&n&( &w&=$&o&( &x&=$&o&( &y&=$&o&( &z&=$&o&( &{&=$&o&(
&|&=$&o&( &}&=$&u&( &~&=$&u&( &&=$&u&( &&=$&#&( &a&=$&!&( &&=$&#&( &&=$&&( &&=$&r&(
(
o%nts c'a"/es table)
2%t'o$t s(ec%al c'a"acte"s 2%t' s(ec%al o"*an# (ol%s' c'a"acte"s
C'a"acte"s a+o$nt N$+be" of (a"ts C'a"acte"s a+o$nt N$+be" of (a"ts
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
Attent%on1 The newest SMSAP technical documentation is always in ,POMOC on our website
https://www.smsapi.pl.
CALLBACK requests are being sent from following P addresses: A,.!=!.,.:,C A,.!=!.,.:=C
.!.!=A.=:.<A and .!.!=A.=..=3
ComVision 2013
Page no: 22/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
A((en#%M ! 4 Del%Ue"S "e(o"ts l%st
Stat$s l%st)
N$+be" STATUS ol%s' stat$s
na+es
Desc"%(t%on
%&1 '()_!(*'+ 'ieznaleziona Wrong D or report has expired
%&2 ,-./0,+ .rzedawniona Messages expired
%&1 2,') 3ys4ana Message is sent
%&% +,5/6,0,+ +ostarczona Message is delivered ro recipient
%&7 *'+,5/6,0,+ 'iedostarczona Message is undelivered (invalid number, roaming
error etc)
%&8 !9/5,+ 'ieudana Sending message falied please report it to usB
%&: 0,;,<),+ 'ieznany Message is undelivered (invalid number, roaming
error etc)
%&= *'>'(3' >oleka No report (message may be either delivered or not)
%&? @*,*,+ Aaakceptowana Message is waiting to be sent
410 9<<,.),+ .onawianie Message is delivered to operator
A((en#%M , 4 E""o" co#es
E""o" co#es l%st)
ERROR Desc"%(ct%on
8 Error in request (Please report)
11 Message too long or there is no message or parameter nounicode is set and
special characters (including Polish characters) are used. For VMS messages
this error may mean no wave file or tts error text (no text or different than UTF-
8 encoding).
12 Message has more parts than defined in &max_parts parameter.
13 nvalid phone number
14 Wrong sender name
17 FLASH message cannot contain special characters
18 nvalid number of parameters
19 Too many messages in one request
20 nvalid number of DX parameters
21 MMS message is too big (maximum 300kB)
22 Wromg SML format
23 Error in importing a file for MMS or VMS messageB
24 Wrong format of imported file
25 Parameters &normalize and &datacoding musn't appear in the same request.
26 MMS subject is to long. Subject may contain up to 30 characters.
27 Too long idx parameter value.
30 Wrong UDH parameter when &datacoding=bin
ComVision 2013
Page no: 23/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
31 Error in TTS conversion
32 Eco, MMS i VMS messages may be sent only to Polish numbers or sending
messages to non-Polish numbers has been disabled (for Pro messages).
33 No Polish mobile phone numbers for ECO sending
35 Wrong tts_lector given. Available values: agnieszka, ewa, jacek, jan, maja
36 Sending binary messages with footer is disallowed.
40 No group with given name in phonebook
41 Chosen group is empty
50 Messages may be scheduled up to 3 months in the future
51 Wrong VMS sent date, VMS messages may be sent only between 8am and
10pm or combination of parameters try and interval may cause sending one of
tries after 10pm.
52 Too many requests for one phone number (maximum 10 requests within 60
seconds)
53 Not unique idx value.
54 Wrong date - (only unix timestamp and SO 8601)
55 No landline numbers in the recipients' list and paremeter skip_gsm set.
56 The difference between date sent and expiration date can't be less than 1 and
more tha 12 hours.
57 Phone number is blacklisted.
60 Group of codes with rthis name doesn't exist
61 Group of codes are expired
62 All codes from this group are already used
65 Not enough unused codes in the group. There is fewer codes in the group that
numbers in request.
66 Parameter HIEo#IJ the message content is missing. This parameter is
necessary for requests with parameter &discount_group$
101 nvalid authorization info
102 nvalid username or password
103 nsufficient credits on Your account
104 No such template
105 Wrong P address (for P filter turned on)
110 Service is not available on account (SMS, MMS, VMS or HLR).
200 Unsuccessful message submission
201 System internal error (please report)
202 Too many simultaneous request, message won't be sent
301 Message with provided D doesn't exist or is scheduled for following 60
seconds (such messages cannot be deleted)
400 nvalid message D of a status response
999 System internal error (please report)
ComVision 2013
Page no: 24/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
HLR e""o"Fs l%st)
TZ[# O(%s
UNKNO2NBSUTSCRITER nvalid, not active number. Error is permanent.
ATSENTBSUTSCRITER 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.
TELESERVICEBNOTB
ROVISIONED
The recipient has no SMS subscription. Error is permanent.
SYSTEMBFAILURE Temporary network or protocol failure
HLRBLOCALBCANCEL *
HLRBATORT
Temporary problem or lost reach
CALLBTARRED Barring of the recipients number. Error is permanent.
A((en#%M . 0 Enco#%n/
Default encoding is windows-1250. However you can set different encoding of messages by
additional parameter 9enco#%n/ in your HTTP GET request. Available encodings types are:
F%so0==:50!F
F%so0==:50,F
F%so0==:50.F
F%so0==:50<F
F%so0==:50:F
F%so0==:50@F
F&%n#o&s0!,:3F
F&%n#o&s0!,:!F
F$tf0=F
EMa+(le)
'tt(s)**ssl.s+sa(%.(l*s+s.#o7
$se"na+e8username9(ass&o"#8password_in_./59to8<=:33333333
9enco#%n/8$tf0=9+essa/e8message_content
A((en#%M < 4 EMa+(le sc"%(ts
Sen#%n/ SMS +essa/e $s%n/ fo(en f$nct%on
<?php
$username = "username";
$password = md5("password");
$to = "48502602702";
$from = "48502607702";
$eco = 1; // 0 Pro message, 1 Eco message
$message= "my message";
if ($username && $password && $to && $message) {
$data = "?
username=$username&password=$password&to=$to&eco=$eco&message=$message&from=$from";
$file = fopen('https://ssl.smsapi.pl/sms.do'.$data,'r');
$result = fread($plik,1024);
fclose($file);
echo $result;
}
?>
ComVision 2013
Page no: 25/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
SMS sen#s f"o+ HTML fo"+ $s%n/ H.
<?php
if (strlen($_POST['sms_from'])>0 &&
strlen($_POST['sms_to'])>=9 &&
strlen($_POST['sms_message'])>0)
{
$username = "login";
$password = md5("password");
$from = $_POST['sms_from'];
$to = $_POST['sms_to'];
$message= urlencode($_POST['sms_message']);
echo file_get_contents("https://ssl.smsapi.pl/sms.do?".
"username=$username&password=$password&to=$to&".
"message=$message&from=$from",FALSE,NULL,0,100);
}
?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=windows-1250">
</head>
<body>
<form name="sms" method="POST" action="">
<table>
<tr>
<td>Od:</td>
<td><input type="text" name="sms_from" value=""></td>
</tr>
<tr>
<td>Do:</td>
<td><input type="text" name="sms_to" value=""></td>
</tr>
<tr>
<td>Wiadomosc:</td>
<td><textarea name="sms_message"></textarea></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="wyslij"></td>
</tr>
</table>
</form>
</body>
</html>
MMS sen#s #%"ectlS $s%n/ H
<?php
$username = 'login';
$password = md5('haslo');
$to = "48500000000";
$subject = urlencode("smsAP.pl");
$smil= '<smil><head><layout><root-layout height="600" width="425"/> <region id="mage" top="0" left="0"
height="100%" width="100%" fit="meet"/></layout></head><body><par dur="5000ms"><img
src="https://www.smsapi.pl/img/mms.jpg" region="mage"></img></par></body></smil> ';
if ($username && $password) {
$data = "?username=$username&password=$password&to=$to&subject=$subject&smil=$smil";
$plik = fopen('https://ssl.smsapi.pl/mms.do'.$data,'r');
$wynik = fread($plik,1024);
fclose($plik);
echo $wynik;
}
?>
ComVision 2013
Page no: 26/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
EMa+(le MMS +essa/e %n SMIL fo"+at ;MMS sen#%n/G
<smil>
<head>
<layout>
<root-layout width="160" height="135"/>
<region id="mage" width="160" height="114" left="0" top="0"/> //Rozmiar obrazka
<region id="Text" width="160" height="20" left="0" top="120"/> //Rozmiar pola tekst.
<region id="Audio" width="106" height="1" left="0" top="120"/> //Rozmiar pola audio.
</layout>
</head>
<body>
<par dur="0s">
<img src="http://adres_www_do_obrazu" region="mage" /> //Adres do obrazka
<text src="http://adres_do_pliku_txt" region="Text" /> //Adres do pliku tekstowego
<audio src="http://adres_do_pliku_wav" region="Audio" /> //Adres do pliku audio
</par>
</body>
</smil>
EMa+(le of sen#%n/ VMS +essa/e $s%n/ cURL l%b"a"S
<?php
$path_to_file = dirname(__FLE__).'/file.wav';
$ch = curl_init('https://ssl.smsapi.pl/vms.do');
curl_setopt_array($ch, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_POST => 1,
CURLOPT_POSTFELDS => array(
'username' => 'username',
'password' => 'md5(password)',
'to' => '48500500500',
'file' => '@'.$path_to_file,
)
));
$response = curl_exec($ch);
echo $response;
?>
ComVision 2013
Page no: 27/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
Rece%U%n/ #el%Ue"S "e(o"t ;CALLTACK SMS DLRG
<?php
// UWAGA! Ponizszy przyklad jest tylko poglqdowy. Nie sprawdza on danych
// wejsciowych co jest zalecane dla zmiennych GET: Msgd i status, oraz nie
// sprawdza czy zmienne nie sq podane przez osoby trzecie.
//
// W przypadku wyslania z wiadomosciq parametru %#M zostanie on zwrcony $_GET['idx']
if($_GET['Msgd'] && $_GET['status'] ) {
mysql_select_db('nazwa_bazy',mysql_connect('localhost','login','haslo'));
$ards = explode(',',$_GET['Msgd']);
$arStatus = explode(',',$_GET['status']);
$ardx = explode(',',$_GET['idx']);
if($ards) foreach($ards as $k => $v){
mysql_query("UPDATE sms SET sms_status = '".$arStatus[$k]."', sms_index = '.$ardx[$k].' WHERE
sms_id='".$v."' LMT 1");
}
mysql_close();
echo "OK;
}
?>
EMa+(le of MMS "ece%U%n/ sc"%(t
<?php
$P = $_SERVER['REMOTE_ADDR'];
$recived=0;
foreach($_FLES as $plik) {

if(is_uploaded_file($plik['tmp_name'])) {

if(move_uploaded_file($plik['tmp_name'],'mms/'.$plik['name'])) {
$recived=1;
}
}
}
if ($recived == 1) {
echo "OK";
}
?>
ComVision 2013
Page no: 28/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
EMa+(le MMS +essa/e sent to CALLTACK sc"%(t ;o#b%-" MMSG
POST: Array
(
[mms_subject] => Testowy MMS
[mms_from] => 48600000000
[mms_to] => 48500000000
[mms_date_recv] => 1256031673
[mms_date] => 1256031643
)
FLES: Array
(
[0] => Array
(
[name] => 0.JPG
[type] => image/jpeg
[tmp_name] => /tmp/phpGXutNv
[error] => 0
[size] => 25097
)
[1] => Array
(
[name] => 1.txt
[type] => text/plain
[tmp_name] => /tmp/phpaoM6dU
[error] => 0
[size] => 14
)
[2] => Array
(
[name] => 3.amr
[type] => audio/AMR
[tmp_name] => /tmp/php60KEi
[error] => 0
[size] => 27078
)
)
ComVision 2013
Page no: 29/30 go to the table of contents
Documentation SMSAPI (https)
Wersja 2.28.0
H%sto"S of c'an/es
Ves"s%on Date C'an/es
Ver 2.29.0 08.11.2013 1. ntroducing from parameter for VMS messages sending
Ver 2.28.0 07.10.2013 1. Bulk CALLBACK description introduced.
Ver 2.27.2 04.09.2013 1. ntroducing Error code 57
Ver 2.27.1 28.08.2013 1. ntroducion of Polish names for delivery statuses (may appear in AP
responses)
Ver 2.27.0 30.07.2013 1. ntroduction of &idx parameter in HLR Lookup service.
1. New error 27 which meand too long idx value.
Ver 2.26.0 18.07.2013 1. ntroduction of &skip_foreign parameter
Ver 2.25.0 23.04.2013 1. ntroduction of discount codes in the AP.
2. ntroduction of &sms2way parameter.
3. ntroduction of &nofify_url parameter
Ver 2.24.1 05.02.2013 1. HLR errors description introduced.
2. Updating list of P addresses from which callback may be sent.
Ver 2.24.0 19.10.2012 1. ntroducing &expiration_date and new Error code 56 corresponding
with it.
2. Added possibility to change TTS lector in VMS (&tts_lector).
3. New error code 110 which means that service (SMS, MMS, VMS or
HLR) is not available on sending account
4. ntroducing new Error code 36.
5. ntroducing length limit for MMS subject and new Error code 26
corresponding with it.
Ver 2.23.0 13.09.2012 1. ntroducing pressed and hanguptime parameters for CALLBACK
requests with VMS delivery reports.
2. Added parameter &max_parts
Ver. 2.22.0 24.07.2012 1. ntroducing &idx and &check_idx for MMS and VMS messages.
2. ntroducing &idx for CALLBACK requests with MMS and VMS
delivery reports.
3. ntroducing &normalize and new Error code 25 corresponding with it.
Ver. 2.21.0 17.05.2012 1. ntroducing new date format allowed (SO 8601) and new Error code
54 meaning wrong date format.
Ver. 2.20.0 27.03.2012 1. ntroducing new AP SMS parameter check_idx and new Error code
53 corresponding with it.
2. ntroducing new AP VMS parameter skip_gsm and new Error code
55 corresponding with it.
Ver. 2.19.0 01.03.2012 1. HLR Lookup Description
2. ntroducing new Error code 52 preventing from looping sending
procedure
Ver. 2.18.0 02.02.2012 1. New examples
Ver. 2.17.0 1. Documentation in English
ATTENTION1 You can find the newest version of SMSAP technical documentation in tab ,POMOC
on our site https://www.smsapi.pl/.
ComVision 2013
Page no: 30/30 go to the table of contents

Das könnte Ihnen auch gefallen