XML Post API
If you want to receive the status of the SMS package you have sent in XML format using the POST method of the HTTP protocol, you can follow the guidelines below.
Request URL
POSThttps://api.iletimerkezi.com/v1/get-report
Request Body (Body)
<request>
<authentication>
<key></key>
<hash></hash>
</authentication>
<order>
<id></id>
<page></page>
<rowCount></rowCount>
</order>
</request>
Definitions
The request to the server should be wrapped with the request tag. The definitions of its sub-tags are as follows:
authentication
These are the user credentials that need to be sent to authorize the requested operation. Its sub-tags are:
-
key: The API Key that you can create from the settings section after logging into your iletimerkezi.com panel should be written here. It is mandatory to send this when making the request.
-
hash: iletimerkezi.com panelinize giriş yaptıktan sonra ayarlar bölümünden oluşturabileceğiniz API Anahtar ve Gizli Anahtar kullanılarak oluşturulmuş hash bu alana yazılmalıdır. İstek yapılırken gönderilmesi zorunludur.
order
Contains information about the order whose report will be queried. Its sub-tags are:
-
id: A unique numerical value representing the order. When you make an SMS sending request via the API, it is the id value returned by the server. It is mandatory to send this when making the request.
-
page: Represents the report page. It is not mandatory to send this when making the request. The default value is 1.
-
rowCount: Specifies the number of messages on a report page. It is not mandatory to send this when making the request. The default value is 1000. The maximum value is 1000. If more than 1000 messages were sent in an order, a new request should be made by increasing the value in the page tag.
Sunucu yanıtı
<response>
<status>
<code></code>
<message></message>
</status>
<order>
<id></id>
<status></status>
<message>
<number></number>
<status></status>
</message>
<message>
<number></number>
<status></status>
</message>
</order>
</response>
Definitions
The response from the server is always wrapped with the response tag. The definitions of its sub-tags are as follows:
status
Contains information about the operation status. The values returned with this tag can also be obtained by looking at the header information of the HTTP response. This tag is returned as standard in every request. Its sub-tags are:
- code: A numerical value indicating the status of the operation.
- message: Contains an informational message about the operation status.
order
If the operation was successfully completed, it contains the order information created. If the operation failed, this tag is not returned. Its sub-tags are:
-
id: A unique numerical value representing the order.
-
status: A numerical value indicating the general sending status of the order. The possible values for this tag and their meanings are listed in the table below.
Status Code Status Message 113 Order is being sent 114 Order has been completed 115 Order could not be sent message
Contains the reported message information. Repeats as many times as the number of messages on the queried page. Its sub-tags are:
-
number: Contains the recipient’s mobile phone number.
-
status: A numerical value indicating the sending status of the message. The possible values for this tag and their meanings are listed in the table below.
Status Code Status Message 110 Message is being sent 111 Message has been sent 112 Message could not be sent
-
Error Codes
If the request result is negative, the error codes and messages returned by the server are as follows.
code | message | Description |
---|---|---|
400 | Request could not be parsed | Occurs due to an error in the structure of the XML you POSTed. These errors usually result from incorrectly written XML tags, improperly closed XML tags, or the use of a character that can disrupt the structure of the XML without using CDATA. |
401 | Membership information is incorrect | We give this error when we cannot verify the information you sent within the authentication tag in the XML you POSTed. If you have a fixed IP defined on your account and you are making a request from a different IP, you will also receive this error. |
404 | The API does not have the requested method | If you receive this error, check the address you are requesting again; you may be making a request to an incorrect address. |
455 | Order not found | If there is no order created with the id you conveyed in the request, or if the order has transitioned from waiting to being sent, you will receive this error. |
456 | The order's sending date has not yet arrived | If the order created with the id you conveyed in the request is scheduled for a future date and the sending date has not yet arrived, you will receive this error. |
Sample Request
<?xml version="1.0" encoding="UTF-8" ?>
<request>
<authentication>
<key>demo</key>
<hash>demo</hash>
</authentication>
<order>
<id>428</id>
<page>1</page>
<rowCount>5</rowCount>
</order>
</request>
Sample Successful Response
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<status>
<code>200</code>
<message>İşlem başarılı</message>
</status>
<order>
<id>428</id>
<status>113</status>
<message>
<number>5301234567</number>
<status>110</status>
</message>
<message>
<number>5301234568</number>
<status>111</status>
</message>
<message>
<number>5301234569</number>
<status>110</status>
</message>
<message>
<number>5301234560</number>
<status>111</status>
</message>
<message>
<number>5301234561</number>
<status>111</status>
</message>
</order>
</response>
Sample Error Response
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>
<code>455</code>
<message>Sipariş bulunamadı</message>
</status>
</response>