Отправка SMS по списку контактов

Этот метод позволяет отправить SMS на список контактов из Контактной книги. Кампания может содержать персонализированные данные из полей контакта в тексте сообщения для каждого контакта. Можно указать не более 10 000 контактов для одной кампании. Ограничение: В режиме DEMO учетной записи создание кампании через API недоступно. В режиме TEST платформы создание кампании возможно только для проверенных номеров.

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

POST http://one-api.notificore.ru/api/campaigns/sms/send-groups



Request parameters

Parameter Required Type Default Description
groups[] Yes array <int> No An array of lists with contacts from the address book. The ID of the list with the contacts to which the SMS should be sent.
sender Yes string No SMS Sender name:
1 to 11 characters for the Sender alphanumeric name (consists of Latin letters, symbols, numbers, spaces)
1 to 15 characters for the Sender numeric name
text Yes string No Message text.
To substitute personalized data of the recipient in the text of the message, you must specify the identifier(s) of the contact field(s) in the form {field_id}. Maximum number of characters for a message text: 335 characters Cyrillic 765 characters Latin
validity No integer 72 SMS validity period in hours.
Integer from 1 to 72. By default 72 hours.
tariff_code No integer 0 Number of tariff at which the campaign messages will be billed. You can only specify the tariff connected to your account. The parameter format is an integer from 0 to 9. The default is 0.
start_at No string now Date and time of the message sending in ISO 8601 format: yyyy-mm-dd hh:mm:ss. Used only to schedule campaigns for a specific time. Maximum date for scheduling is 30 days. If not specified by the user, the value is set to now (campaign without delay).


Request sample

{

"groups": [

1

],

"sender": "string",

"text": "string",

"tariff_code": 0,

"validity": 72,

"start_at": "2025-01-25 09:00:00"

}


Response parameters

Parameter Type Description
id integer Created campaign ID
name string Campaign name: auto-generated for the created campaign
sender string 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": "2021-04-27 19:44:06",

"real_start_at": "2021-04-27 19:44:06",

"finished_at": "2021-04-27 19:44:06",

"created_at": "2021-04-27 19:44:06",

"statistics": {

"delivered": 0,

"sent": 0

}

}

}