Getting a list of advertising campaigns
| Method | get.campaigns |
|---|---|
| Description | Getting a list of all advertising campaigns - integrated, regular and system |
| Available to | Agent, Client |
Request parameters
| Title | Type | Required | 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" |
limit |
number | no | Number of records returned. See section "Paging" |
offset |
number | no | Shift determines from which record number to return "limit" records. Default is "0". See section "Paging" |
filter |
object | no | See section "Filtering criteria" |
fields |
array | no | See section "View of returned data" |
sort |
array | no | See section "Sorting data" |
Response parameters
| Name | Type | Valid values | Filtering | Sorting | Description |
|---|---|---|---|---|---|
id |
number | yes | Unique identifier of the advertising campaign | ||
name |
string | yes | yes | Advertising campaign name | |
description |
string | Maximum 255 characters | Advertising campaign description | ||
status |
enum |
|
yes | Advertising campaign status | |
creation_time |
iso8601 | YYYY-MM-DD hh:mm:ss | yes | yes | Date and time of creation of the advertising campaign |
campaign_conditions |
object | no | Advertising campaign conditions. Absent if the field is |
||
engine |
enum |
|
yes | yes | Platform for an integrated advertising campaign |
type |
enum |
|
yes | yes | Types of advertising campaigns.
|
costs |
number | yes | yes | Advertising campaign expenses | |
cost_ratio |
number | minimum value 1 | Default value 1. Coefficient that affects the value of the parameter `costs` | ||
cost_ratio_operator |
enum |
|
The default value is `wo_changes`. Operator that is used when calculating `costs` taking into account `cost_ratio` | ||
| Website | |||||
site_id |
number | yes | yes | Unique site identifier | |
site_domain_name |
string | yes | Site address on the Internet. Without specifying the protocol - "http://" or "https://" | ||
| Settings for linking a number to a block on the site | |||||
site_blocks |
array | yes | Settings for linking a number to a block on the site | ||
site_block_id |
number | Unique number block identifier | |||
site_block_name |
string | Name of the block of numbers | |||
phone_number_type |
enum |
|
Virtual number type (see method get.campaign_available_phone_numbers) for the phone_number_id parameter:
|
||
phone_number_id |
number |
Unique virtual number identifier depending on the phone_number_type parameter.
To get a list of available virtual numbers you must use the get.campaign_available_phone_numbers method
|
|||
phone_number |
string | Number that corresponds to the parameter phone_number_id |
|||
redirection_phone_number_id |
number | Forwarding number, which is used if the number type specified in the phone_number_id parameter is call_tracking.
To get a list of available numbers for forwarding, you must use the get.campaign_available_redirection_phone_numbers method
|
|||
redirection_phone_number |
string | Number that corresponds to the parameter redirection_phone_number_id |
|||
static_utm_source |
string | yes | Static utm label source. The parameter will appear in the response only if it is present in the fields request |
||
static_utm_medium |
string | yes | Static utm label medium. The parameter will appear in the response only if it is present in the fields request |
||
static_utm_campaign |
string | yes | Static utm label campaign. The parameter will appear in the response only if it is present in the fields request |
||
static_utm_term |
string | yes | Static utm label term. The parameter will appear in the response only if it is present in the fields request |
||
static_utm_content |
string | yes | Static utm tag content. The parameter will appear in the response only if it is present in the fields request |
||
static_utm_referrer |
string | yes | Static utm label referrer. The parameter will appear in the response only if it is present in the fields request |
||
static_utm_expid |
string | yes | Static utm tag expid. The parameter will appear in the response only if it is present in the fields request |
||
dynamic_call_tracking_enabled |
boolean | true, false |
Dynamic call tracking.
Can be "true" if the parameter is
|
||
| Dynamic call tracking | |||||
dynamic_call_tracking |
object | yes |
Dynamic call tracking settings. 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. |
||
reservation_time |
enum |
|
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 | 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 | minimum value 1 | Number of visits per advertising campaign per day | ||
coverage_visitors |
number | Percentage of website visitors who will see a dynamic call tracking number | |||
| Condition group settings | |||||
group_conditions |
array | Advertising campaign conditions group | |||
| Condition settings | |||||
conditions |
array | Advertising campaign conditions in the conditions group | |||
type |
enum |
|
Advertising campaign conditions in the conditions group | ||
campaign_parameter |
enum | For a list of valid values and possible operators, see the table "List of parameters and their operators" | |||
value |
string |
Value for campaign_parameter. For some campaign_parameter there may be a list of valid values, see table "List of parameters and their operators"
|
|||
operator |
enum | =, sub, ~ |
Operator in condition
|
||
JSON request structure```json
{ "jsonrpc":"2.0", "id":"number", "method":"get.campaigns", "params":{ "access_token":"string", "user_id":"number", "offset":"number", "limit":"number", "filter":{
},
"sort":[
{
"field":"string",
"order":"string"
}
],
"fields":[
"string"
]
} }
### JSON response structure```json
{
"jsonrpc": "2.0",
"id": "number",
"result": {
"metadata": {
},
"data": [
{
"id": "number",
"status": "enum",
"creation_time": "iso8601",
"description": "string",
"site_id": "number",
"site_domain_name": "string",
"costs": "number",
"cost_ratio": "number",
"cost_ratio_operator": "enum",
"engine": "enum",
"type": "enum",
"name": "string",
"site_blocks": [
{
"site_block_id": "number",
"site_block_name": "string",
"phone_number_type": "enum",
"phone_number_id": "number",
"phone_number": "string",
"redirection_phone_number_id": "number",
"redirection_phone_number": "string",
"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"
}
]
}
]
}
}
]
}
}
List of returned errors
See the section "List of errors for methods with the verb get"