Skip to main content

XML Post API

If you want to perform SMS sending using the POST method of the HTTP protocol in XML format, you can follow the guidelines below.

Request URL

POSThttps://api.iletimerkezi.com/v1/send-sms

Request Body (Body)

<request>
<authentication>
<key></key>
<hash></hash>
</authentication>
<order>
<sender></sender>
<sendDateTime></sendDateTime>
<iys>1</iys>
<iysList>BIREYSEL</iysList>
<message>
<text><![CDATA[...]]></text>
<receipents>
<number></number>
<number></number>
</receipents>
</message>
</order>
</request>

Definitions

The request to be made to the server must be wrapped in a request tag. The definitions of the sub-tags of this tag are as follows:

authentication

These are the user information that must be sent to obtain authorization for the requested operation. The sub-tags are as follows:

  • key: After logging into your iletimerkezi.com panel, the API Key you can create from the settings section should be written in this field. It is mandatory to send it when making the request.

  • hash: After logging into your iletimerkezi.com panel, the hash created using the API Key and Secret Key that you can generate from the settings section should be written in this field. It is mandatory to send it when making the request.

order

The SMS messages to be sent are considered as an order and will start to be reported in this manner after the request is made. An order can sometimes include a single recipient and a single message text, but it can also contain multiple recipients and multiple message texts. The order tag is not a repeatable tag. Only one order can be sent per request. The sub-tags are as follows:

  • sender: This is the header information defined and approved by iletimerkezi.com, consisting of a maximum of 11 characters. The sent message is delivered to the recipient with the header specified by this parameter. It is mandatory to send it when making the request.

  • sendDateTime: This indicates the date of message sending. It is used for sending messages scheduled for a future date. The format is DD/MM/YYYY HH:MM. It is not mandatory to send it when making the request. The default value is the time at which the request is made.

  • iys: This indicates whether the message will be queried through the Message Management System (İYS). If you send this value as 1 (true), your messages will be queried through İYS; if you send it as 0 (false), they will not be queried. It is mandatory to send it when making the request.

    İpucu

    If you are sending commercial messages, this value must legally be 1. Otherwise, penalties may apply.

    For detailed information about İYS, please click here.

  • iysList: This indicates the list you want to query through the Message Management System (İYS). If you have sent the iys value as 1, meaning you want your message to be queried through İYS, it is mandatory to send the iysList value as BIREYSEL (INDIVIDUAL) or TACIR (TRADER). If you send the iys value as 0, this field will be ignored.

    message

    This contains the information of the message to be sent. If you want to send different messages within a single order, the message tag must be repeated for the number of different messages you wish to send. The sub-tags are as follows:

    • text: This contains the SMS text to be sent. It is mandatory to send it when making the request.
    İpucu

    Since your message text may contain characters that could disrupt the structure of XML, we recommend writing your message text within <![CDATA[...]]>. The use of <![CDATA[...]]> is important for the proper delivery of your messages, as it may include expressions determined by users using your software.

    • receipents: This contains the recipients of the SMS messages to be sent. The recipients are specified by the following tag:

      • number: This contains the mobile phone number of the recipient. Formats such as 905xxxxxxxxx, +90 5xx xxx xx xx, and 5xxxxxxxxx can be used. It is mandatory to send it when making the request. If multiple recipients are to be defined for the specified message text, this tag must be repeated for the number of recipients.

Server Response

<response>
<status>
<code></code>
<message></message>
</status>
<order>
<id></id>
</order>
</response>

Definitions

The response from the server is always wrapped in a response tag. The definitions of the sub-tags of this tag are as follows:

status

This contains information about the status of the operation. The values returned by this tag can also be obtained by checking the headers of the HTTP response. This tag is returned by default in every request. The sub-tags are as follows:

  • code: This is a numeric value indicating the status of the operation.
  • message: This contains an informational message about the status of the operation.

order

If the operation is completed successfully, it contains the information about the created order. If the operation fails, this tag is not returned. The order tag is not a repeatable tag. Only one order can be sent per request. The sub-tag is as follows:

  • id: This is a unique numeric value that represents the order. You can check the status of your order using this id value. If your order is scheduled to be sent at a later date, you can cancel your order using the id value.

Hata Kodları

If the result of the request is negative, the error codes and messages that will be returned to you by the server are as follows:

CodeMessageDescription
401Membership information is incorrect.When we are unable to verify the information you sent with the key and hash tags, we return this error. Additionally, if you have defined a static IP on your account and are making the request from a different IP, you will receive this error as well.
402Insufficient balance.If the balance in your account is not sufficient to send this order, we return this error.
450The submitted header is not suitable for use.If the value you sent with the sender tag is not approved in your account, you will receive this error. It must be sent exactly as defined in your account. Typically, changes that cause this error include differences in uppercase and lowercase letters or the inclusion of extra whitespace characters.
451Duplicate order.If you try to send the same message text to the same recipients within 10 minutes, the system will return this error to you to prevent spam and ensure that the same messages are not sent to the same individuals by mistake. If you need to make such a sending, you can differentiate the message text by including the current hour and minute in the message content.
452Message recipients are incorrect.If the phone numbers you sent under the recipients tag are incomplete or cannot be verified, we return this error. Additionally, if you are certain that the mobile phone number you want to send a message to is correct, you may still receive this error if the phone number has been added to your blocked numbers list.
453Order size exceeded.If the message text you sent with the text tag exceeds seven (7) SMS lengths based on your character encoding, this error will be returned
454Message text is emptyIf the message text you sent with the text tag does not contain any value, your message will not be sent, and this error message will be returned.
457The format of the message sending date is incorrect.If the date format you sent with the sendDateTime tag is incorrect, this error will be returned. The date format is DD/MM/YYYY HH:MM (Example: 20/01/2022 13:45).

Sample Request

<?xml version="1.0" encoding="UTF-8" ?>
<request>
<authentication>
<key>demo</key>
<hash>demo</hash>
</authentication>
<order>
<sender>APITEST</sender>
<sendDateTime>23/04/2022 09:00</sendDateTime>
<message>
<text><![CDATA[Test mesaji.]]></text>
<receipents>
<number>5301234567</number>
<number>5301234568</number>
</receipents>
</message>
<message>
<text><![CDATA[Demo mesaji.]]></text>
<receipents>
<number>5301234569</number>
<number>5301234560</number>
</receipents>
</message>
</order>
</request>

Sample Successful Response

<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>
<code></code>
<message></message>
</status>
<order>
<id></id>
</order>
</response>

Sample Error Response

<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>
<code>400</code>
<message>Request could not be resolved.</message>
</status>
</response>