English | Slovak

smsSendJSON

Description
Sending message with POST method
Functionality
All requests are sent to URL listed below. Message body format have to be kept for sending of message succesfuly.
In case of success send the HTTP response 200 is returned and the answer is in the body. In case of error, the error HTTP response is returned back with the error description
Request
POST http://text421.naimar.sk/api/v6/rest/sms/json/
1.1 MSISDN with message ID
{ "username": "test", "password": "test", "message": { "text": "Test SMS", "sender": "Info", "delivery": "2012-11-05 16:01:22" }, "recipients": [ {"msisdn": 421901727051, "id": "12345678901234"}, {"msisdn": 421905537914, "id": "abcdefghijklab"} ] }
1.2 MSISDN without message ID
{ "username": "test", "password": "test", "message": { "text": "Test SMS", "sender": "Info", "delivery": "2012-11-05 16:01:22" }, "recipients": {"msisdn": [ "421901727051", "421905537914" ] } }
1.3 Message with special UTF8 characters
{ "username": "test", "password": "test", "message": { "text": "Příliš žluťoučký kůň pěl ďábelské ódy. Mäso v tôni.", "type": "utf8" }, "recipients": [ {"msisdn": 421901727051, "id": "12345678901234"} ] }
1.4 Messages with custom text
{ "username": "test", "password": "test", "message": { "text": "Test SMS", "sender": "Info", "delivery": "2012-11-05 16:01:22" }, "recipients": [ {"msisdn": 421901727051, "id": "456123", "text": "Custom text for SMS ID 456123"}, {"msisdn": 421905537914, "id": "abcdefghijklab"} ] }
Parameter Required Type Description
username
required Varchar (16) user name
password
required Varchar (16) password
Message
text
required text Text of message. Standard text message - 160 characters, binary SMS - 280 characters, utf8 messages - 70 characters
type
optional binary, utf8 binary - binary message, utf8 - message with special characters
dcs
optional integer if DCS is missing and message is binary, standard DCS 245 is used
esm
optional integer if ESM is missing and message is binary, standard ESM 64 is used
sender
optional varchar(11) from which sender name will be message delivered, max. 11 alphanumeric or 15 numeric characters
Allowed characters: a-zA-Z0-9/+!_*&%@$.#
delivery
optional timestamp non mandatory parameter, time when message is sent (example 2012-11-05 16:01:22)
Recipients
msisdn
required integer number where message will be sent
id
optional varchar (14) unique message ID
text
optional text unique text for MSISDN
Response
{ "response": { "status": 200, "recipients": 2 } }
Parameter Type Description
status integer server response (200 if API receive the message, 4xx in case of error)
description varchar (300) detailed error description
recipients integer number of received MSISDN
Error response
{ "response": { "status": 400, "description": "missing parameter", "recipients": 0, "recipients_error": 0 } }
Chybové návratové hodnoty
Error ID Description Detail
400 unknown prefix xxx unknown prefix, use known prefix like 901, 903, ...
400 unknwon network xxx you can't send SMS to this network
400 missing parameter text missing mandatory parameter text
400 missing parameter recipients the recipient is missing
400 sender must have 11 characters or less sender must have max 11 characters
400 unknown sender sender can be only in defined range
400 unknown type type can be only binary or utf8
401 unknown username/password wrong username or password
500 unknown error unknown error, detailed description is in response
Revision
Version Date Description
3.0 14.8.2013 obmedzenie na známe prefixy operátorov, obmedzenie na odosielanie do sietí mimo SR
2.0 9.1.2013 doplnená možnosť zaslať unikátny text pri každom MSISDN
1.5 30.10.2012 opravená drobná chyba v implementácii XML, zmena XML formátovania pri Error response
1.4 24.9.2012 zmena parametru v GET volani, miesto message=Text spravy sa pouziva text=Text spravy
1.3 13.9.2012 sender môže byť len z definovaného rozsahu
1.2 10.9.2012 doplnená možnosť zaslania správ s diakritikou a binárnych správ
1.1 9.9.2012 doplnená možnosť zaslania správ s textovým senderom
1.0 24.8.2012 first version