Create regular campaign
Description
Creates a new regular campaign.
Request URL
Method: POST
https://example.com/api/v1.1/campaigns/regulars/add/
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
format | string | "json" | No | Response data format. By default – json |
name | string | "Broadcast campaign name" | Yes | Campaign name |
is_active | bool | true | No | Activate campaign on creation |
data_type | string | "list" | Yes | Audience source type |
data_id | int | 12 | Yes | Audience source ID |
resource_id | int | 24 | No | Resource ID |
content | JSON array | Yes | Message template object | |
send_channel | string | "email" "sms" "push" | Yes | Sending channel |
content_type | string | "email" | No | Deprecated. If you pass this parameter, the campaign will use the email channel for sending, no matter what value you specify. It is recommended to use send_channel . |
send_email_content | bool | true | No | Deprecated. If you pass this parameter, the campaign will use the email channel for sending, no matter what value you specify. It is recommended to use send_channel . |
send_push_content | bool | true | No | Deprecated. If you pass this parameter, the campaign will use the email channel for sending, no matter what value you specify. It is recommended to use send_channel . |
send_sms_content | bool | true | No | Deprecated. If you pass this parameter, the campaign will use the email channel for sending, no matter what value you specify. It is recommended to use send_channel . |
subid | string | "Adv_1" | No | Campaign SubID |
start_schedule | JSON object | No | Start schedule object | |
limit | int | 0 | No | Campaign cycle limitation |
aglimit_count | int | 0 | No | Increase limit each cycle — number |
agllimit_percent | float | 99.0 | No | Increase limit each cycle — percent |
policy_id | int | 1 | No | Sending policy ID |
push_sending_mode | string | "fanout" (default) "last" | No | Push notification sending mode (push channels only) |
Smart settings | ||||
virtual_sender_id | int | 12 | No | Virtual sender ID (Smart accounts) |
is_random_tracking_prefix | bool | false | No | Random tracking domain prefix (Smart accounts) |
custom_tracking_domains | JSON array | ["trk.example.com", "trk2.example.com"] | No | Tracking domain list (Smart accounts) |
blind_carbon_copy | JSON array | ["john@example.com", "george@example.com"] | No | Hidden copy email addresses (Smart accounts) |
unconditional_sending | bool | true | No | Send messages regardless of subscription status (Smart accounts) |
watched_list_id | int | 12 | No | Campaign watchers database ID (Smart accounts) |
watcher_limit | int | 100 | No | Watchers limit (Smart accounts) |
Request example
{
"content": [
{
"from_email": "broadcast@altcraft.com",
"from_name": "",
"message_id": 2549,
"replyto_email": "broadcast@altcraft.com",
"replyto_name": "",
"subject": "Hello"
}
],
"custom_tracking_domains": [
"trk.example.com",
"trk.example.org"
],
"data_id": 2690,
"data_type": "segment",
"is_active": true,
"limit": 1,
"name": "Regular campaign name",
"resource_id": 400,
"send_channel": "email",
"start_schedule": {
"start_hours": [
1,
2,
3,
4
],
"start_mdays": [
1
],
"start_mins": [
1,
2,
3,
4
],
"start_months": [
12
],
"start_wdays": [],
"start_years": [
2020
]
},
"token": "abcdefghijklmnqrstuvwxyz",
"virtual_sender_id": 7
}
Response example
{
"data": {
"saved_id": 4800
},
"error": 0,
"error_text": "Successful operation"
}
Response parameters
Parameter | Type | description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
saved_id | int | New campaign ID |