Получение статуса SMS

Метод позволяет получить информацию о состоянии кампаний, отправленных через API. Он реализован как для одного SMS, в котором отображается статус одного сообщения, так и для массовой кампании (с указанием идентификатора сообщения или идентификатора кампании или идентификатора отправителя).

Чтобы получить статус SMS, сделайте запрос по этому URL:

GET https://api.notificore.ru/rest/sms/{id}



Request parameters

Parameter Required Type Description
id Yes integer Message ID – a unique random identifier generated on the platform and returned when the object is created
or use alternative request: text GET https://api.notificore.ru/rest/sms/reference/{reference}
reference Yes integer SMS external ID. String up to 32 characters containing /a-zA-Z0-9/


Response parameters

Parameter Type Description
id integer SMS ID
msisdn integer phone number to which the SMS was sent
reference string SMS external ID
time_in datetime date and time the SMS was created
time_sent datetime SMS sending scheduled date and time
time_dr datetime Date and time the delivery report was received
status string SMS status
price float SMS price
currency string Account currency in which the SMS price is specified

Если запрос успешен, вы получите ответ:

{

"error":0,

"errorDescription":"No errors",

"id":"211″,

"msisdn":"792972000001″,

"reference":"ext_id_19″,

"time_in":"2017-01-17 09:11:41″,

"time_sent":"2017-01-17 09:11:41″,

"time_dr":"2017-01-17 09:11:41″,

"status":"delivered",

"price":0.23,

"currency":"RUB"

}


Request SMS status URL by task ID

GET https://api.notificore.ru/rest/sms/{task_id}


Request parameters

Parameter Required Type Description
task_id Yes integer A unique random identifier that is created for bulk campaigns.


Response parameters

Parameter Type Description
originator string Sender name
body string SMS message text
validity string SMS message validity period
totalprice float SMS campaign price
currency string currency of the user’s account, in which the cost of sending an SMS campaign is specified.
sent integer number of messages sent within the SMS campaign.
delivered integer number of delivered messages within the SMS campaign.
expired integer number of undelivered messages (the recipient’s phone is turned off) within the SMS campaign.
undeliverable integer number of undelivered messages (incorrect recipient phone number) within the SMS campaign.
unknown integer number of messages within the SMS campaign with an unknown status ― no delivery report.

Если запрос успешен, вы получите ответ:

{

"originator":"alpha_name",

"body":"message text",

"validity":72,

"totalprice":0.23,

"currency":"RUB",

"sent":1,

"delivered":1,

"expired":0,

"undeliverable":0,

"unknown":0

}


Errors relevant for all types of SMS messaging

Error Code Description
20 SMS not found
21 An incorrect phone number
22 The external ID of the SMS request is missing
23 SMS with this ID is already present
24 Invalid query payload
25 Incorrect originator
26 Empty or too long SMS text
27 Incorrect external SMS ID
28 Incorrect value of SMS duration
29 The task ID is incorrect
30 Task not found
31 The phone is already in the messaging list
32 Sender not allowed
33 Unresolved direction
34 Invalid OTP, code generation error
35 2WAY service is not activated
36 Incorrect sender for 2WAY


Error response sample

{

"error":"25",

"errorDescription":"Invalid originator"

}