Skip to main content

XML Post API

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

Address to request

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

Request Content (Body)

If you are processing using API Key, the content of the request is:
<request>
<authentication>
<key></key>
<hash></hash>
</authentication>
<order>
<sender></sender>
<sendDateTime></sendDateTime>
<iys>1</iys>
<iysList>INDIVIDUAL</iysList>
<message>
<text><![CDATA[...]]></text>
<receipents>
<number></number>
<number></number>
</receipents>
</message>
</order>
</request>

Definitions

The request to the server must be wrapped with the request tag. The definitions of the subtags of this tag are as follows:

authentication

It is the user information that must be sent in order to receive authorization for the requested operation. The alt tags are as follows:

  • key: API Key that you can create from the settings section should be written in this field after logging in to your iletimerkezi.com panel. It is required to be sent when making a request.

  • hash: After logging into your iletimerkezi.com panel, the hash generated using the API Key and Secret Key that you can create from the settings section should be written in this field. It is required to be sent when making a request.

order

The SMSs to be sent are considered as an order and will be reported in this way after the request is made. The order can sometimes contain a single recipient and a single message text, or it can contain multiple recipients and more than one message text. The order tag is not a repeatable tag. Only one order can be submitted per request. The alt tags are as follows:

  • sender: This is the header information, consisting of maximum 11 characters, defined from the transmissionerkezi.com administration panel and approved by transmissionerkezi.com. The sent message is sent to the receiver with the header specified with this parameter. It is required to be sent when making a request.

  • sendDateTime: Indicates the sending date of the message. It is used for forward-dated message sending. Its format is DD/MM/YYYY HH:MM. It is not required to be sent when making a request. Its default value is the time the request is made.

  • iys: Indicates whether the message will be queried over the Message Management System (İYS). If you send this value as 1 (true), your messages will be queried via IYS, if you send it as 0 (false), it will not be queried. It is required to be sent when making a request.

    Hint

    This value should legally be 1 if you are sending a commercial message. Otherwise, penalties may apply.

    Click for detailed information about İYS.

  • iysList: Indicates the list you want to be queried via the Message Management System (İYS). If you have sent the iys value as 1, that is, if you want your message to be queried via IYS, it is mandatory to send the iysList value as INDIVIDUAL or TRADEMARK. If you are sending the iys value as 0, this field will be ignored.

    messages

    It contains the message information to be sent. If different messages are to be sent in a single order, the message tag should be repeated as many times as the number of different messages to be sent. The alt tags are as follows

    • text: Contains the text of the SMS to be sent. It is required to be sent when making a request.

      Hint

      Structure of XML in your message textWe recommend that you write your message text in <![CDATA[...]]> as it may contain characters that break the code. The use of <![CDATA[...]]> is important for the healthy transmission of your messages, as there may be expressions determined by your users using your software in your message text.

    • receipents: Contains the recipients of the SMS to be sent. Recipients are indicated by the following label:

      • number: Contains the recipient's mobile phone number. Formats such as 905xxxxxxxxx, +90 5xx xxx xx xx, 5xxxxxxxxx can be used. It is required to be sent when making a request. If more than one recipient is to be defined for the specified message text, this label should be repeated as many as 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 the response tag. The definition of subtags of this tag is as follows:

status

Contains information about the transaction status. The values ​​returned by this tag can also be obtained by looking at the header information of the HTTP response. This tag is returned by default on every request made. The alt tags are as follows

  • code: It is the numerical value that indicates the operation status.
  • message: Contains an informational message about the transaction status.

order

Contains the order information created if the transaction was completed successfully. If the operation fails, this tag is not returned. The order tag is not a repeatable tag. Only one order can be submitted per request. The alt tag is as follows:

  • id: Unique numeric value representing the order. With this id value returned to you, you can check the latest status of your order. If your order is an order to be sent at a future date, you can cancel your order with the id value.

Error Codes

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
401Incorrect membership informationWe give this error when we cannot verify the information you have submitted with the key, hash tags, if your account If you have defined a fixed IP and you are requesting from a different IP, you will still get this error.
402Insufficient balanceIf the balance in your account is not enough to send this order, we give this error.
450Submitted header is not available for useIf the value you sent with the sender tag is not approved in your account, you will get this error, you need to send it as defined in your account. Usually, the changes that cause this error are lowercase and uppercase letters or sending extra space values.
451Repeating orderIf you want to resend the same message text to the same recipients within 10 minutes, the system will return this error to you, so that there is no spam and the same messages are not sent to the same people by mistake. If you need such a transmission, you can differentiate the text of the message by typing the current hour and minute in the message text.
452Message recipients are incorrectIf the phone numbers you have sent under the receipents tag are missing or cannot be verified, we give this error. At the same time, if you are sure that the mobile phone number you want to message is correct, you can still get this error if you have added the mobile phone number to your number blocking list.
453Order size exceededIf the text of the message you sent with the text tag is more than seven (7) SMS lengths according to your character encoding, this error will return.
454Message text is emptyIf the text of the message you sent with the text tag does not contain any value, your message will not be sent and this error message will be returned.
457Incorrect format of message sending dateIf the date format you sent with the sendDateTime tag is incorrect, this error is 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 message.]]></text>
<receipents>
<number>5301234567</number>
<number>5301234568</number>
</receipents>
</message>
<message>
<text><![CDATA[Demo message.]]></text>
<receipents>
<number>5301234569</number>
<number>530123456</number>
</receipents>
</message>
</order>
</request>

Example Successful Response

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

Example Incorrect Answer

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