| Method | create.campaigns |
|---|---|
| Description | Creating an advertising campaign. You can only create an advertising campaign with the 'basic' type. |
| Available to | Agent, Client |
The available number of advertising campaigns is regulated at the tariff plan level
Request parameters
| Name | Type | Required | Valid values | Description |
|---|---|---|---|---|
access_token |
string | yes | Authentication session key | |
user_id |
number | no |
Unique user identifier of the client agent on behalf of which the request is made Is required for the agentTo obtain a list of client users, you must use the method "get.customer_users" |
|
name |
string | yes | Advertising campaign name | |
description |
string | no | Maximum 255 characters | Advertising campaign description |
status |
enum | no |
|
Advertising campaign status |
site_id |
number | yes | Unique site identifier | |
campaign_conditions |
object | no | Advertising campaign conditions. | |
| Settings for linking a number to a block on the site | ||||
site_blocks |
array | no |
Settings for linking a number to a block on the website
If site number blocks are not specified, then they are not configured, i.e. are considered not configured If |
|
site_block_id |
number | yes | Unique number block identifier | |
phone_number_id |
number | yes | Unique identifier of the virtual number. To get a list of available virtual numbers you must use the get.campaign_available_phone_numbers method
If
A number with
|
|
redirection_phone_number_id |
number | no |
Unique identifier of the forwarding number. The forwarding number is only used if the phone_number_id parameter is of type `call_tracking`. The list of available numbers can be obtained using the get.campaign_available_redirection_phone_numbers method.
Required if the
If the parameter is specified and a virtual number with type "va" is specified in
The parameter can only contain redirection numbers, which are returned by the get.campaign_available_redirection_phone_numbers method. If this is not the case, then an error will be returned with the mnemonic "invalid_parameter_value" Available if the "va" component is connected. If the parameter is filled in and you do not have the "va" component, an error will be returned with the mnemonic "parameter_component_disabled" |
|
dynamic_call_tracking_enabled |
boolean | no | true, false |
Activation of dynamic call tracking. Only free numbers without the “Use in VATS” flag can be connected to the dynamic call tracking pool
in the same code as the default ad campaign block number. If the required number of numbers is not available, they will be automatically purchased.
Calls to numbers from the dynamic call tracking pool will be processed according to the rules for processing calls to the number of the advertising campaign block by default.
Can be "true" if the parameter is
If you use this parameter, but you do not have the "dynamic_call_tracking" component connected, then you will be returned error with mnemonic "parameter_component_disabled"
If
If the |
| Dynamic call tracking | ||||
dynamic_call_tracking |
object | no |
Setting up dynamic call tracking.
Required if the
If you use this parameter, but you do not have the "dynamic_call_tracking" component connected, then you will be returned error with mnemonic "parameter_component_disabled" |
|
reservation_time |
enum | no |
|
The default value is "15m". The period for which the number is assigned to the site visitor. After the specified time has passed, the number is assigned to the new visitor (or remains with the current one if call tracking numbers are available). |
count_virtual_numbers |
number | yes | minimum value 1 | The number of numbers required for dynamic call tracking to work in one block. The specified number of numbers will be purchased. |
count_visits |
number | yes | minimum value 1 | Number of visits per advertising campaign per day |
| Condition group settings | ||||
group_conditions |
array | yes | Maximum number of groups 30 | Advertising campaign conditions group |
| Condition settings | ||||
conditions |
array | yes | Maximum number of conditions for a group is 50 | Advertising campaign conditions in the conditions group |
type |
enum | yes |
|
Advertising campaign conditions in the conditions group
|
campaign_parameter |
enum | yes | For a list of valid values and possible operators, see the table "List of parameters and their operators" | |
value |
string | yes |
Meaning. For some campaign_parameter there may be a list of valid values, see table "List of parameters and their operators"
|
|
operator |
enum | yes | =, sub, ~ |
The operator is in condition. Depends on the parameter used campaign_parameter see table "List of parameters and their operators"
|
Response parameters
| Title | Type | Required | Description |
|---|---|---|---|
id |
number | yes | Unique identifier of the advertising campaign |
JSON request structure```json
{ "jsonrpc": "2.0", "id": "number", "method": "create.campaigns", "params": { "access_token": "string", "user_id": "number", "description": "string", "name": "string", "status": "enum", "site_id": "number", "site_blocks": [ { "site_block_id": "number", "phone_number_id": "number", "redirection_phone_number_id": "number", "dynamic_call_tracking_enabled": "boolean" } ], "dynamic_call_tracking": { "reservation_time": "enum", "count_virtual_numbers": "number", "count_visits": "number" }, "campaign_conditions": { "group_conditions": [ { "conditions": [ { "type": "enum", "campaign_parameter": "enum", "operator": "enum", "value": "string" } ] } ] } } }
### JSON response structure```json
{
"jsonrpc": "2.0",
"id": "number",
"result": {
"data": {
"id": "number"
},
"metadata": {
}
}
}
List of returned errors
See the section "List of errors for methods with the create verb"