Returns the status of an SMS message, along with its rate, sender ID, number of parts, price, and currency.
Principle of use
| Syntax and URL to call the method |
| checkSms (int | string sms_id) |
| https://api.selzy.com/en/api/checkSms?format=json&api_key=KEY&sms_id=ID |
| Arguments | |
| api_key * | API access key. |
| sms_id * | The field code returned by the sendSms. Example:
sms_id=2376678.12025550123 sms_id=3123 |
| Return value | |
A JSON object with the fields below. The tariff, price, and currency fields are filled in once the message is charged, usually within a minute after it's sent. Until then, they're null. |
|
| status | Message status. One of the values listed below. |
| tariff | The rate used to calculate the price. For most countries, this is the country calling code, for example 1 (USA). world is the default rate for countries without their own rate. null means the price hasn't been calculated yet. |
| sender | The alphanumeric sender ID the message was sent from. |
| parts_count | Number of parts (SMS segments) in the message. A long message is split into parts, but it's still one message with one sms_id. |
| price | Total price of the message, all parts included, in the currency shown in currency. A string with exactly 4 decimal places, for example "0.1200". "0.0000" means the message was paid for from an SMS bundle. null means the price hasn't been calculated yet. |
| currency | Three-letter currency code for price. It's the same currency your account shows prices in, for example USD or UAH. null until the price is calculated. |
| Status values | |
| In the future, there may be new values, but the following principle will be respected: if the status starts with err_, it means that the delivery failed. If it starts with ok_, the delivery is still in progress or has been successfully completed. The only exception is the 'not_sent' status. | |
| not_sent | The message has not been sent yet, and is waiting to be sent. The status will be changed after sending. |
| ok_sent | The message has been sent, but the delivery status is still unknown. The status is temporary and may change. |
| ok_delivered | The message has been delivered. The status is final. |
| err_src_invalid | The delivery is not possible, the sender is set incorrectly. The status is final. |
| err_dest_invalid | The delivery is not possible, a wrong number is indicated. The status is final. |
| err_skip_letter | The delivery is impossible because the status of the phone number was changed in the process of sending, or the phone number has been removed from the list, or the letter has been deleted. The status is final. |
| err_not_allowed | The delivery is not possible, this communications service provider is not serviced. The status is final. |
| err_delivery_failed | The delivery failed — usually because of indication of a formally correct, but non-existent number, or because the phone is turned off. The status is final. |
| err_expired | Message expired. The carrier closed the message without receiving a delivery report (DLR). The message was sent and you were charged for it, but we don't know whether it reached the recipient. This is a final status. |
| err_lost | The message has been lost, and the sender needs to re-send the message on his own, since the original has not been saved. The status is final. |
| err_internal | Internal failure. The message needs to be re-sent. The status is final. |
| Examples of the return value | |
A two-part message to a US number +1 202 555 0123
{"result":{"status":"ok_delivered","tariff":"1","sender":"MyCompany","parts_count":2,"price":"0.1200","currency":"USD"}}
A message that hasn't been sent yet, so price details aren't available {"result":{"status":"not_sent","tariff":null,"sender":"MyCompany","parts_count":1,"price":null,"currency":null}}
Error {"error":"AK100313-05 [invalid sms id]","code":"unspecified","result":""}
|