| Server response and error codesIf an error occurs, the Server returns the following string:
- When fmt = 0:
ERROR = N (description)
- When fmt = 1:
0,-N
- When fmt = 2:
<result>
<error>description</error>
<error_code>N</error_code>
</result> |
- When fmt = 3:
{
"error": "description",
"error_code": N
} |
N – error number, can take the following values:
The value | Description
|
---|
1 | Error in parameters.
|
---|
2 | Invalid username or password. Also occurs when trying to send a message from an IP address that is not included in the list of allowed by the Client (if such a list was previously configured by the Client).
|
---|
4 | The IP address is temporarily blocked.
|
---|
5 | Error deleting a message.
|
---|
9 | Attempt to send more than five requests to get the status of the same message or more than one mass request within a minute.
This error also occurs when you try to send five or more requests simultaneously from different connections under the same username (too many concurrent requests).
|
---|
If the request is successful, the Server returns a response in the form of a string:
Responses for SMS messages:
- ïðè fmt = 0 è all = 0: Status = <status>, check_time = <last_date>, err = <err>
- ïðè fmt = 1 è all = 0: <status>,<last_timestamp>,<err>
- ïðè fmt = 2 è all = 0:
<sms>
<status>status</status>
<last_date>last_date</last_date>
<last_timestamp>last_timestamp</last_timestamp>
<flag>flag</flag>
<err>err</err>
</sms> |
- ïðè fmt = 3 è all = 0:
{
"status": <status>,
"last_date": "<last_date>",
"last_timestamp": <last_timestamp>,
"flag": <flag>,
"err": <err>
} |
- ïðè fmt = 0 è all = 1:
Status = <status>, check_time = <last_date>, err = <err>, send_date = <send_date>, phone = <phone>, cost = <cost>, sender_id = <sender>, status_name = <status_name>, message = <message>, comment = <comment>, type = <type>
|
- ïðè fmt = 1 è all = 1:
<status>,<last_timestamp>,<err>,<send_timestamp>,<phone>,<cost>,<sender>,<status_name>,<message>, <comment>, <type>
- ïðè fmt = 2 è all = 1:
<sms>
<status>status</status>
<last_date>last_date</last_date>
<last_timestamp>last_timestamp</last_timestamp>
<flag>flag</flag>
<err>err</err>
<send_date>send_date</send_date>
<send_timestamp>send_timestamp</send_timestamp>
<phone>phone</phone>
<cost>cost</cost>
<sender_id>sender</sender_id>
<status_name>status_name</status_name>
<message>message</message>
<comment>comment</comment>
<type>type</type>
<sms_cnt>sms_cnt</sms_cnt>
</sms>
|
- ïðè fmt = 3 è all = 1:
{
"status": <status>,
"last_date": "<last_date>",
"last_timestamp": <last_timestamp>,
"flag": <flag>,
"err": <err>,
"send_date": "<send_date>",
"send_timestamp": <send_timestamp>,
"phone": "<phone>",
"cost": "<cost>",
"sender_id": "<sender>",
"status_name": "<status_name>",
"message": "<message>",
"comment": "<comment>",
"type": <type>,
"sms_cnt": <sms_cnt>
} |
- ïðè fmt = 0 è all = 2:
Status = <status>, check_time = <last_date>, err = <err>, send_date = <send_date>, phone = <phone>, mccmnc = <mccmnc>, country = <country>, operator = <operator>, operator_orig= <operator_orig>, region = <region>, cost = <cost>, sender_id = <sender>, status_name = <status_name>, message = <message>, comment = <comment>, type = <type>
|
- ïðè fmt = 1 è all = 2:
<status>,<last_timestamp>,<err>,<send_timestamp>,<phone>,<country>,<operator>,<region>,<cost>,<sender>,<status_name>,<message>, <comment>, <type>
|
- ïðè fmt = 2 è all = 2:
<sms>
<status>status</status>
<last_date>last_date</last_date>
<last_timestamp>last_timestamp</last_timestamp>
<flag>flag</flag>
<err>err</err>
<send_date>send_date</send_date>
<send_timestamp>send_timestamp</send_timestamp>
<phone>phone</phone>
<cost>cost</cost>
<sender_id>sender</sender_id>
<status_name>status_name</status_name>
<message>message</message>
<comment>comment</comment>
<mccmnc>mccmnc</mccmnc>
<country>country</country>
<operator>operator</operator>
<operator_orig>operator_orig</operator_orig>
<region>region</region>
<type>type</type>
<sms_cnt>sms_cnt</sms_cnt>
</sms>
|
- ïðè fmt = 3 è all = 2:
{
"status": <status>,
"last_date": "<last_date>",
"last_timestamp": <last_timestamp>,
"flag": <flag>,
"err": <err>,
"send_date": "<send_date>",
"send_timestamp": <send_timestamp>,
"phone": "<phone>",
"cost": "<cost>",
"sender_id": "<sender>",
"status_name": "<status_name>",
"message": "<message>",
"comment": "<comment>",
"mccmnc": "<mccmnc>",
"country": "<country>",
"operator": "<operator>",
"operator_orig": "<operator_orig>",
"region": "<region>",
"type": <type>,
"sms_cnt": <sms_cnt>
} |
Where:
<status> – status Code (list)
<last_date> – the date of the last status change. Format DD.MM.YYYY hh: mm: ss.
<last_timestamp> – time stamp of the last status change.
<flag> is a flag in the form of a 2 byte number containing various information about the message. Combinations of bit values of different characteristics are possible.
Bits 0-3 (message type): 0 – SMS, 1 – Flash-SMS, 2 – Binary SMS, 3 – Wap-push, 4 – HLR-request, 5 – Ping-SMS, 6 – MMS, 7 – Call, 8 – E-mail,
10 – Viber, 12 – Social Networks.
Bit 5 – payment of the message from the second balance.
Bit 8 is a sign of a template message.
<err> – error code if the message was not delivered.
<send_date> – date the message was sent (format DD.MM.YYYY hh: mm: ss).
<send_timestamp> – time stamp for sending the message.
<phone> – subscriber's phone number or e-mail address.
<country> – name of the country of registration of the subscriber number.
<operator> – current mobile operator of the subscriber.
<operator_orig> – the subscriber's operator by mobile code before porting the number.
<region> – region of registration of the subscriber number.
<cost> – message cost.
<sender> – sender ID.
<status_name> – status name.
<message> – the text of the message.
<comment> – message comment.
<mccmnc> – the numeric code of the subscriber's country plus the numeric code of the subscriber's operator.
<type><type> - message type (0 - SMS, 1 - Flash-SMS, 2 - Binary SMS, 3 - Wap-push, 4 - HLR-request, 5 - Ping-SMS, 6 - MMS, 7 -
Call, 8 - E-mail, 10 - Viber, 12 - Social Networks).
<sms_cnt> – number of parts in an SMS message (or seconds in a voice message).
Responses for HLR queries:
- ïðè fmt = 0 è all = 0:
Status = <status>, check_time = <check_time>, err = <err>, imsi = <imsi>, msc = <msc>, mcc = <mcc>, mnc = <mnc>, cn = <cn>, net = <net>, rcn = <rcn>, rnet = <rnet> |
- ïðè fmt = 1 è all = 0: <status>,<last_timestamp>,<err>,<imsi>,<msc>,<mcc>,<mnc>,<cn>,<net>,<rcn>,<rnet>
- ïðè fmt = 2 è all = 0:
<sms>
<status>status</status>
<last_date>last_date</last_date>
<last_timestamp>last_timestamp</last_timestamp>
<flag>flag</flag>
<err>err</err>
<imsi>imsi</imsi>
<msc>msc</msc>
<mcc>mcc</mcc>
<mnc>mnc</mnc>
<cn>cn</cn>
<net>net</net>
<rcn>rcn</rcn>
<rnet>rnet</rnet>
</sms> |
- ïðè fmt = 3 è all = 0:
{
"status": <status>,
"last_date": "<last_date>",
"last_timestamp": <last_timestamp>,
"flag": <flag>,
"err": <err>,
"imsi": "<imsi>",
"msc": "<msc>",
"mcc": "<mcc>",
"mnc": "<mnc>",
"cn": "<cn>",
"net": "<net>",
"rcn": "<rcn>",
"rnet": "<rnet>"
} |
- ïðè fmt = 0 è all = 1:
Status = <status>, check_time = <check_time>, err = <err>, imsi = <imsi>, msc = <msc>, mcc = <mcc>, mnc = <mnc>, cn = <cn>, net = <net>, rcn = <rcn>, rnet = <rnet>, send_date = <send_date>, phone = <phone>, cost = <cost>, sender_id = <sender_id>, status_name = <status_name>, message = <message>, type = <type> |
- ïðè fmt = 1 è all = 1:
<status>,<last_timestamp>,<err>,<imsi>,<msc>,<mcc>,<mnc>,<cn>,<net>,<rcn>,<rnet>,
<send_timestamp>,<phone>,<cost>,<sender_id>,<status_name>,<message>,<type> |
- ïðè fmt = 2 è all = 1:
<sms>
<status>status</status>
<last_date>last_date</last_date>
<last_timestamp>last_timestamp</last_timestamp>
<flag>flag</flag>
<err>err</err>
<imsi>imsi</imsi>
<msc>msc</msc>
<mcc>mcc</mcc>
<mnc>mnc</mnc>
<cn>cn</cn>
<net>net</net>
<rcn>rcn</rcn>
<rnet>rnet</rnet>
<send_date>send_date</send_date>
<send_timestamp>send_timestamp</send_timestamp>
<phone>phone</phone>
<cost>cost</cost>
<sender_id>sender_id</sender_id>
<status_name>status_name</status_name>
<message>message</message>
<type>type</type>
</sms> |
- ïðè fmt = 3 è all = 1:
{
"status": <status>,
"last_date": "<last_date>",
"last_timestamp": <last_timestamp>,
"flag": <flag>,
"err": <err>,
"imsi": "<imsi>",
"msc": "<msc>",
"mcc": "<mcc>",
"mnc": "<mnc>",
"cn": "<cn>",
"net": "<net>",
"rcn": "<rcn>",
"rnet": "<rnet>",
"send_date": "<send_date>",
"send_timestamp": <send_timestamp>,
"phone": "<phone>",
"cost": "<cost>",
"sender_id": "<sender>",
"status_name": "<status_name>",
"message": "<message>",
"type": <type>
} |
- ïðè fmt = 0 è all = 2:
Status = <status>, check_time = <check_time>, err = <err>, imsi = <imsi>,
msc = <msc>, mcc = <mcc>, mnc = <mnc>, cn = <cn>, net = <net>, rcn = <rcn>, rnet = <rnet>,
send_date = <send_date>, phone = <phone>, country = <country>, operator = <operator>, region = <region>, cost = <cost>,
sender_id = <sender_id>, status_name = <status_name>, message = <message>, type = <type> |
- ïðè fmt = 1 è all = 2:
<status>,<last_timestamp>,<err>,<imsi>,<msc>,<mcc>,<mnc>,<cn>,<net>,<rcn>,<rnet>,
<send_timestamp>,<phone>,<country>,<operator>,<region>,<cost>,<sender_id>,<status_name>,<message>,<type> |
- ïðè fmt = 2 è all = 2:
<sms>
<status>status</status>
<last_date>last_date</last_date>
<last_timestamp>last_timestamp</last_timestamp>
<flag>flag</flag>
<err>err</err>
<imsi>imsi</imsi>
<msc>msc</msc>
<mcc>mcc</mcc>
<mnc>mnc</mnc>
<cn>cn</cn>
<net>net</net>
<rcn>rcn</rcn>
<rnet>rnet</rnet>
<send_date>send_date</send_date>
<send_timestamp>send_timestamp</send_timestamp>
<phone>phone</phone>
<cost>cost</cost>
<sender_id>sender_id</sender_id>
<status_name>status_name</status_name>
<message>message</message>
<country>country</country>
<operator>operator</operator>
<region>region</region>
<type>type</type>
</sms> |
- ïðè fmt = 3 è all = 2:
{
"status": <status>,
"last_date": "<last_date>",
"last_timestamp": <last_timestamp>,
"flag": <flag>,
"err": <err>,
"imsi": "<imsi>",
"msc": "<msc>",
"mcc": "<mcc>",
"mnc": "<mnc>",
"cn": "<cn>",
"net": "<net>",
"rcn": "<rcn>",
"rnet": "<rnet>",
"send_date": "<send_date>",
"send_timestamp": <send_timestamp>,
"phone": "<phone>",
"cost": "<cost>",
"sender_id": "<sender>",
"status_name": "<status_name>",
"message": "<message>",
"country": "<country>",
"operator": "<operator>",
"region": "<region>",
"type": <type>
} |
Where:
<status> – status Code (list)
<last_date> – the date of the last status change. Format DD.MM.YYYY hh: mm: ss.
<last_timestamp> – time stamp of the last status change.
<flag> is a flag in the form of a 2 byte number containing various information about the message. Combinations of bit values of different characteristics are possible.
Bits 0-3 (message type): 0 – SMS, 1 – Flash-SMS, 2 – Binary SMS, 3 – Wap-push, 4 – HLR-request, 5 – Ping-SMS, 6 – MMS, 7 – Call, 8 – E-mail,
10 – Viber, 12 – Social Networks.
Bit 5 – payment of the message from the second balance.
Bit 8 is a sign of a template message.
<err> – hLR error code or subscriber status code (list).
<imsi> – unique IMSI code of the subscriber's SIM card.
<msc> – the number of the service center of the operator in whose network the subscriber is located.
<mcc> – numeric code of the subscriber's country.
<mnc> – numeric code of the subscriber's operator.
<cn> – name of the country of registration of the subscriber.
<net> – name of the subscriber registration operator.
<rcn> – the name of the roaming country of the subscriber when he is in a foreign network.
<rnet> – the name of the roaming operator of the subscriber when he is in someone else's network.
<send_date> – date the message was sent (format DD.MM.YYYY hh: mm: ss).
<send_timestamp> – time stamp for sending the message.
<phone> – subscriber's phone number.
<country> – name of the country of registration of the subscriber number.
<operator> – the name of the operator of the subscriber.
<region> – region of registration of the subscriber number.
<cost> – message cost.
<sender> – sender ID.
<status_name> – status name.
<message> – the text of the message.
<type><type> - message type (for HLR, it is equal to 4).
Åñëè ñîîáùåíèå íå íàéäåíî èëè íàõîäèòñÿ â àðõèâíîé áàçå (çíà÷åíèå ñòàòóñà ðàâíî -3), òî äëÿ fmt = 0,2,3 âîçâðàùàåòñÿ êîä ñòàòóñà â
ñîîòâåòñòâóþùåì ôîðìàòå. Äëÿ fmt = 1 âîçâðàùàåòñÿ îòâåò â ôîðìàòå ñòàòóñà îáû÷íîãî ñîîáùåíèÿ.
When multiple statuses are requested:
- äëÿ fmt = 0 è fmt = 1 â ðåçóëüòàòå âîçâðàùàåòñÿ ñïèñîê ñòðîê, êàæäàÿ èç êîòîðûõ ñîäåðæèò èíôîðìàöèþ î ñòàòóñå ñîîòâåòñòâóþùåãî ñîîáùåíèÿ.
- äëÿ fmt = 2 ôîðìàò âîçâðàùàåìûõ ñòàòóñîâ àíàëîãè÷åí ôîðìàòó äëÿ îäèíî÷íûõ ñîîáùåíèé, ïðè ýòîì âåñü ñïèñîê ñòàòóñîâ çàêëþ÷àåòñÿ â òåã "<list>".
- äëÿ fmt = 3 ôîðìàò òàêæå àíàëîãè÷åí ôîðìàòó äëÿ îäèíî÷íûõ ñîîáùåíèé, ñòàòóñû ïåðå÷èñëÿþòñÿ ÷åðåç çàïÿòóþ, è âåñü ñïèñîê îáðàìëÿåòñÿ
êâàäðàòíûìè ñêîáêàìè.
 ñëó÷àå ìíîæåñòâåííîãî çàïðîñà ñòàòóñîâ ïðè çíà÷åíèè ïàðàìåòðà all = 1 èëè all = 2 äëÿ êàæäîãî ñòàòóñà äîïîëíèòåëüíî âîçâðàùàåòñÿ èäåíòèôèêàòîð
ñîîáùåíèÿ. Ïðè all = 0 äîïîëíèòåëüíî âîçâðàùàåòñÿ èäåíòèôèêàòîð ñîîáùåíèÿ è íîìåð òåëåôîíà. |