Отмена SMS-кампании
Этот метод позволяет отменить рассылку SMS, отправленную через API. Отмена возможна только для кампаний со статусами создания / приостановленной / отправленной / запланированной.
Чтобы отменить кампанию, сделайте запрос по этому URL:
PATCH http://one-api.notificore.ru/api/campaigns/{id}/stop
Request parameters
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
id | Yes | integer | No | The ID of the campaign created using: POST /api/campaigns/sms/send POST /api/campaigns/sms/send-groups POST /api/campaigns/sms/send-individual |
Response parameters
Parameter | Type | Description |
---|---|---|
id | integer | ID of the task created for a bulk campaign |
name | string | Campaign name |
sender | string | SMS Sender name |
status | string | Campaign status. Possible values: creation – created, spam – campaign did not pass moderation, scheduled – campaign is scheduled, sending – campaign began to be sent, paused – campaign is paused, stopped – campaign is stopped, done – campaign is completed |
message_type | string | Campaign type: sms |
start_at | string | Date and time of the campaign start (scheduled). Format ISO 8601: yyyy-mm-dd hh:mm:ss |
real_start_at | string | Actual date and time the campaign started. Format ISO 8601: yyyy-mm-dd hh:mm:ss |
finished_at | string | Date and time the campaign is completed. Format ISO 8601: yyyy-mm-dd hh:mm:ss |
created_at | string | Date and time the campaign is created. Format ISO 8601: yyyy-mm-dd hh:mm:ss |
statistics | array | Campaign statistics: |
delivered | integer | Total number of messages delivered within the campaign |
sent | integer | Total number of messages sent within the campaign |
Если запрос успешен, вы получите ответ:
{
"data": {
"id": 1,
"name": "string",
"sender": "string",
"status": "creation",
"message_type": "sms",
"start_at": "2024-04-22 19:44:06",
"real_start_at": "2024-04-22 19:44:06",
"finished_at": "2021-04-22 19:44:06",
"created_at": "2021-04-22 19:44:06",
"statistics": {
"delivered": 0,
"sent": 0
}
}
}