JSON Post API
If you want to receive the status of the SMS package you have sent in JSON format using the POST method of the HTTP protocol, you can follow the instructions below.
Address to request
POSThttps://api.iletimerkezi.com/v1/get-report/json
Request Content (Body)
{
"request": {
"authentication": {
"key": "",
"hash": ""
},
"order": {
"id": "",
"page": "",
"rowCount": ""
}
}
}
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 report contains the information of the order to be queried. The alt tags are as follows.
id: Unique numeric value representing the order. When you request to send SMS via API, it is the id value returned by the server. It is required to be sent when making a request.
page: Indicates the report page. It is not required to be sent when making a request. Its default value is 1.
rowCount: Indicates the number of posts on a report page. It is not required to be sent when making a request. Its default value is 1000. Its maximum value is 1000. If more than 1000 messages are sent in an order, a new request should be made by increasing the value in the page tag.
Server response
{
"response": {
"status": {
"code": "",
"message": ""
},
"order": {
"id": "",
"status": "",
"message": [
{
"number": "",
"status": ""
},
{
"number": "",
"status": ""
},
{
"number": "",
"status": ""
}
]
}
}
}
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 alt tags are as follows:
id: Unique numeric value representing the order.
status: It is the numerical value that indicates the general shipping status of the order. The following table lists the values that this label can take and the meanings they mean.
Status Code Status Message 113 Order in progress 114 Order has been shipped 115 Failed to submit order messages
Contains reported message information. It is repeated as many times as the number of messages on the queried page. Sub tagsi is as follows:
number: Contains the recipient's mobile phone number.
status: It is the numerical value that indicates the sending status of the message. The following table lists the values that this label can take and the meanings they mean.
Status Code Status Message 110 Sending message 111 Message sent 112 Failed to send message
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.
code | message | Description |
---|---|---|
400 | The request could not be resolved | This error is returned if the JSON you POST cannot be validated (invalidate). These errors are usually caused by non-escaped values. |
401 | Incorrect membership information | We give this error when we cannot verify the information you have sent in the authentication tag of the JSON you POST. If you have defined a fixed IP in your account and you are requesting from a different IP, you will get this error again. |
404 | API does not have requested method | If you're getting this error, double-check the address you requested, you may be making a request to a wrong address. |
455 | Order not found | If there is no order created with the id that you have forwarded in the request, or if the order has changed from being pending delivery to being delivered, you will get this error. |
456 | Order shipping date has not come yet | If the order created with the id you have submitted in the request is a post-dated delivery and the delivery date has not yet arrived, you will receive this error. |
Sample Request
{
"request": {
"authentication": {
"key": "507caf2e1fcdb5eea9786332ca2d8785",
"hash": "0db4e316db72c519ba08121985f6ddf479809053d555c"
},
"order": {
"id": 428,
"page": 1,
"rowCount": 5
}
}
}
Example Successful Response
{
"response": {
"status": {
"code": 200,
"message": "Operation successful"
},
"order": {
"id": 428,
"status": 113,
"message": [
{
"number": 5301234567,
"status": 110
},
{
"number": 5301234568,
"status": 111
},
{
"number": 5301234569,
"status": 112
},
{
"number": 5301234560,
"status": 111
},
{
"number": 5301234561,
"status": 111
}
]
}
}
}
Example Incorrect Answer
{
"response": {
"status": {
"code": 455,
"message": "Order not found"
}
}
}