Difference between revisions of "API setting"

From Service Manual Kadam.net
Jump to: navigation, search
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
== API authorization ==
+
==PHP SDK==
 +
Install from github: https://github.com/kadam-official/php-sdk<br>
 +
Install from composer:
 +
<pre>
 +
      composer require kadam/php-sdk
 +
</pre>
 +
 
 +
== API authorization with a Bearer Token ==
 +
To authorize in the system via API with Bearer Token you need to add to your request the "Authorization" header with
 +
"Bearer X" value where "X" is your personal token. You can get the token by asking your manager. The lifetime of token is not limited. You can change your token in the settings of your personal account.
 +
 
 +
== API authorization with a signature==
  
 
To access the API, you will need a user ID (app_id) and a signature (signature).
 
To access the API, you will need a user ID (app_id) and a signature (signature).
Line 103: Line 114:
  
 
== Campaign Statistics ==
 
== Campaign Statistics ==
To get campaign statistics, use the method <b>ads.analytic.campaign.get</b><br/>
+
To get campaign statistics, use the method <b>ads.stats.campaign.get</b><br/>
 
<table>
 
<table>
 
   <tr bgcolor = #DCDCDC>
 
   <tr bgcolor = #DCDCDC>
Line 111: Line 122:
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>campaign_id</td>
+
       <td>campaigns</td>
       <td>campaign's id</td>
+
       <td>One or some campaign's id</td>
 
       <td>int (numeric value), required parameter</td>
 
       <td>int (numeric value), required parameter</td>
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>region_id</td>
+
       <td>group</td>
       <td>region's id: data.geo.regions.get</td>
+
       <td>Group by:  
      <td>int (numeric value), required parameter</td>
+
        <p>date - by dates</p>
  </tr>
+
        <p>campaign - by campaigns</p>
  <tr bgcolor = #F5F5F5>
+
      <td>period</td>
+
      <td>The way data is grouped by date:  
+
          <p>day — daily statistics;</p>
+
          <p>month - monthly statistics</p>
+
          <p>Temporary restrictions are set by parameters date_from and date_to</p>
+
 
       </td>
 
       </td>
       <td>required parameter, string</td>
+
       <td>string, listed with a comma, required parameter</td>
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
 
       <td>date_from</td>
 
       <td>date_from</td>
       <td>The starting date of the statistics to display. Different date format is used for different parameter ''period'' values:  
+
       <td>The starting date of the statistics to display. Different date formats are used for different parameter ''period'' values:  
 
           <p>day: YYYY-MM-DD, example: 2011-09-27;</p>
 
           <p>day: YYYY-MM-DD, example: 2011-09-27;</p>
 
           <p>month: YYYY-MM, example: 2011-09</p>
 
           <p>month: YYYY-MM, example: 2011-09</p>
Line 139: Line 144:
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
 
       <td>date_to</td>
 
       <td>date_to</td>
       <td>The final date of the displayed statistics. Different date format is used for different parameter ''period'' values:  
+
       <td>The final date of the displayed statistics. Different date formats are used for different parameter ''period'' values:  
 
           <p>day: YYYY-MM-DD, example: 2011-09-27;</p>
 
           <p>day: YYYY-MM-DD, example: 2011-09-27;</p>
 
           <p>month: YYYY-MM, example: 2011-09</p>
 
           <p>month: YYYY-MM, example: 2011-09</p>
Line 145: Line 150:
 
       <td>required parameter, string</td>
 
       <td>required parameter, string</td>
 
   </tr>
 
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> sort </td>
 +
       <td> One or some parameters for sorting data, listed with a comma. </td>
 +
       <td> optional parameter </td>
 +
   </tr>
 +
  <tr bgcolor = #F5F5F5>
 +
       <td> limit </td>
 +
       <td> Number of rows returned </td>
 +
       <td> optional parameter, int (numeric value) </td>
 +
   </tr>
 +
  <tr bgcolor = #F5F5F5>
 +
       <td> offset </td>
 +
       <td> Offset on returned rows (use with limit parameter) </td>
 +
       <td> optional parameter, int (numeric value) </td>
 +
   </tr>
 
</table>
 
</table>
 
<b>Result:</b><br/>
 
<b>Result:</b><br/>
Line 151: Line 171:
 
<pre>
 
<pre>
 
{
 
{
response: {
+
  "response":{
count: %total items%
+
      "count": %number rows returned%,
items: {
+
      "items":[
shows
+
        {
clicks
+
            “date” // date; if group by date
ctr
+
            "id" // id campaign; if group by campaign
cpm
+
            "views"
money
+
            "clicks"
                      }
+
            "conversions"
                  }
+
            "rejections"
 +
            "holds"
 +
            "moneyOut" // spent
 +
            "moneyIn" // income
 +
            "ctr"
 +
            "cpm"
 +
            "cpc"
 +
        }
 +
      ]
 +
  }
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
  
== Statistics on sites in the advertiser's office ==
+
'''Sorting'''
Under the statistics on the sites in the office of the advertiser means statistics on impressions and clicks on the site in the context of each campaign.
+
 
<br>To get statistics on sites, use the <b> ads.campaigns.statblock.get </b> method (GET request)
+
Sort Ascending
 +
<code> <pre>
 +
sort = {parameter}
 +
Example: api.kadam.net?sort=views
 +
</pre> </code>
 +
 
 +
Sort descending
 +
<code> <pre>
 +
sort = - {parameter}
 +
Example: api.kadam.net?sort=-views
 +
</pre> </code>
 +
 
 +
Sort by several parameters
 +
<code> <pre>
 +
sort = {parameter1}, - {parameter2}, {parameter3}
 +
Example: api.kadam.net?sort=views,-clicks,leads
 +
</pre> </code>
 +
 
 +
 
 +
== Statistics on sites in the advertiser's account ==
 +
Statistics on sites in the advertiser's account references statistics on views and clicks on the site in the context of each campaign.
 +
<br>To get statistics on sites, use the <b> ads.stats.campaign.placement.get </b> method (GET request)
 
<table>
 
<table>
 
   <tr bgcolor = #DCDCDC>
 
   <tr bgcolor = #DCDCDC>
Line 174: Line 224:
 
       <th width = 350 align = left> Additional attributes </th>
 
       <th width = 350 align = left> Additional attributes </th>
 
   </tr>
 
   </tr>
 +
  <tr bgcolor = #F5F5F5>
 +
      <td>campaigns</td>
 +
      <td>One or some id campaigns, listed with a comma</td>
 +
      <td>string; mandatory parameter</td>
 +
  </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
 
       <td> date_from </td>
 
       <td> date_from </td>
 
       <td> Start date of the statistics output. </td>
 
       <td> Start date of the statistics output. </td>
       <td> string, format YYYY-MM-DD (example: 2017-05-15), filter parameter </td>
+
       <td> string, mandatory parameter, format YYYY-MM-DD (example: 2017-05-15), filter parameter </td>
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
 
       <td> date_to </td>
 
       <td> date_to </td>
 
       <td> The end date of the statistics output. </td>
 
       <td> The end date of the statistics output. </td>
       <td> string, format YYYY-MM-DD (example: 2017-05-15), filter parameter </td>
+
       <td> string, mandatory parameter, format YYYY-MM-DD (example: 2017-05-15), filter parameter </td>
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td> campaign_id </td>
+
       <td> sort </td>
       <td> campaign id </td>
+
       <td> One or some parameters for sorting data, listed with a comma. </td>
       <td> required parameter, int (numeric value), filter parameter </td>
+
       <td> optional parameter </td>
 +
   </tr>
 +
  <tr bgcolor = #F5F5F5>
 +
       <td> limit </td>
 +
       <td> Number of rows returned </td>
 +
       <td> optional parameter, int (numeric value) </td>
 +
   </tr>
 +
  <tr bgcolor = #F5F5F5>
 +
       <td> offset </td>
 +
       <td> Offset on returned rows (use with limit parameter) </td>
 +
       <td> optional parameter, int (numeric value) </td>
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
Line 198: Line 263:
 
       <td> user id </td>
 
       <td> user id </td>
 
       <td> required parameter, int (numeric value) </td>
 
       <td> required parameter, int (numeric value) </td>
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
       <td> macros </td>
 
       <td> site id </td>
 
       <td> int (numeric value), write parameter, filter option </td>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
       <td> leads </td>
 
       <td> Lida </td>
 
       <td> int (numeric value), write parameter, filter option </td>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
       <td> views </td>
 
       <td> Impressions </td>
 
       <td> int (numeric value), write parameter, filter option </td>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
       <td> clicks </td>
 
       <td> Clicks </td>
 
       <td> int (numeric value), write parameter, filter option </td>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
       <td> conversions </td>
 
       <td> Confirmed Conversions </td>
 
       <td> int (numeric value), write parameter, filter option </td>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
       <td> rejections </td>
 
       <td> Failed Conversions </td>
 
       <td> int (numeric value), write parameter, filter option </td>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
       <td> ctr </td>
 
       <td> CTR </td>
 
       <td> int (numeric value), write parameter, filter option </td>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
       <td> cpm </td>
 
       <td> CPM </td>
 
       <td> int (numeric value), write parameter, filter option </td>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
       <td> cpc </td>
 
       <td> CPC </td>
 
       <td> int (numeric value), write parameter, filter option </td>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
       <td> prelandvisit </td>
 
       <td> Prelend Visits </td>
 
       <td> int (numeric value), write parameter, filter option </td>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
       <td> prelanduseful </td>
 
       <td> Useful visits Prelend </td>
 
       <td> int (numeric value), write parameter, filter option </td>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
       <td> prelandscroll </td>
 
       <td> Prelend Scroll </td>
 
       <td> int (numeric value), write parameter, filter option </td>
 
 
   </tr>
 
   </tr>
 
</table>
 
</table>
Line 265: Line 270:
 
<pre>
 
<pre>
 
{
 
{
  "response": {
+
  "response":{
    "count": 1,
+
      "count": %количество возвращаемых элементов%,
    "items": [
+
      "items":[
      {
+
        {
        "macros": "12345678901234",
+
            "id" // id campaign
        "block": "1234",
+
            "placement" // id placement
        "domain": "123456789",
+
            "views"
        "leads": "0",
+
            "clicks"
        "views": "123",
+
            "conversions"
        "clicks": "0",
+
            "rejections"
        "conversions": "0",
+
            "holds"
        "rejections": "0",
+
            "moneyOut"
        "ctr": "0.0000",
+
            "moneyIn"
        "cpm": "0.00",
+
            "ctr"
        "cpc": null,
+
            "cpm"
        "moneyOut": "0.000000",
+
            "cpc"
        "moneyIn": null,
+
            "prelandvisit"
        "prelandvisit": "0",
+
            "prelanduseful"
        "prelanduseful": "0",
+
            "prelandscroll"
        "prelandscroll": "0",
+
            "landvisit"
        "landvisit": "0",
+
            "landuseful"
        "landuseful": "0",
+
            "landscroll"
        "landscroll": "0",
+
            "blackList"
        "multiplier": null,
+
            "multiplier" // stake multiplier
        "blackList": "0"
+
        }
      }
+
      ]
    ],
+
  }
    "request": {
+
      "campaignId": 123456,
+
      "limit": 10,
+
      "offset": 0
+
    }
+
  }
+
 
}
 
}
 
</pre>
 
</pre>
Line 331: Line 330:
 
</pre> </code>
 
</pre> </code>
  
==Изменение множителя для статистики по площадкам в кабинете рекламодателя==
+
== Change the multiplier for statistics on sites in the advertiser's account ==
Для изменения множителя для статистики по площадкам используется метод <b>ads.campaigns.statblock</b> (PUT запрос)
+
To change the multiplier for site statistics, use the <b> ads.stats.campaign.placement.put </b> method (GET request). Bearer-token authorization required.
 
+
Parameters (all are required):
Параметры (все являются обязательными):
+
 
<ul>
 
<ul>
<li>app_id - id пользователя, числовое значение (int)</li>
+
<li> app_id - user id, numeric value (int) </li>
<li>signature - подпись, строка (string)</li>
+
<li> campaign_id - campaign id, numeric value (int) </li>
<li>campaign_id - id кампании, числовое значение (int)</li>
+
<li> multiplier - new multiplier value, numeric value (float) </li>
<li>block - числовое значение (int)</li>
+
<li> placement - place id, numeric value (int) </li>
<li>domain - числовое значение (int)</li>
+
<li>multiplier - новое значение множителя, числовое значение (float)</li>
+
<li>multiplierOld - старое значение множителя, числовое значение (float)</li>
+
<li>macros - id площадки, числовое значение (int)</li>
+
 
</ul>
 
</ul>
  
Параметры block и macros в кабинете не выводятся, их можно получить через метод, описанный в пункте "Статистика по площадкам в кабинете рекламодателя".
+
The block and macros parameters in the account are not displayed, they can be obtained through the method described in the paragraph "Statistics by sites in the advertiser's account".
  
==Статистика по всем материалам кампании==
+
== Statistics on all campaign materials ==
Для получения статистики по всем материалам кампании используется метод <b>ads.analytic.materials.get</b><br/>
+
To get statistics on all campaign materials, use the <b> ads.stats.creative.get </b> method <br/>
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
      <td>campaigns</td>
 +
      <td>One or some id campaigns, listed with a comma</td>
 +
      <td>string; mandatory parameter if not set creatives</td>
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>campaign_id</td>
+
       <td>creatives</td>
       <td>id кампании</td>
+
       <td>One or some id creatives, listed with a comma</td>
       <td>int (числовое значение), обязательный параметр</td>
+
       <td>string; mandatory parameter if not set campaigns</td>
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>period</td>
+
       <td>group</td>
       <td>Способ группировки данных по датам:  
+
       <td>Group by:  
          <p>1. day — статистика по дням;</p>
+
        <p>date - by dates</p>
          <p>2. month — статистика по месяцам;</p>
+
        <p>creative - by creatives</p>
          <p>Временные ограничения задаются параметрами date_from и date_to</p>
+
 
       </td>
 
       </td>
       <td>обязательный параметр, строка</td>
+
       <td>string, listed with a comma, required parameter</td>
 
   </tr>
 
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> date_from </td>
 +
       <td> The starting date of the displayed statistics. Different date formats are used for different values ​​of the period parameter:
 +
           <p> 1. day: YYYY-MM-DD, Example: 2011-09-27 </p>
 +
           <p> 2. month: YYYY-MM, example: 2011-09 </p>
 +
       </td>
 +
       <td> required parameter, string </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> date_to </td>
 +
       <td> End date of output statistics. Different date formats are used for different values ​​of the period parameter:
 +
           <p> 1. day: YYYY-MM-DD, Example: 2011-09-27 </p>
 +
           <p> 2. month: YYYY-MM, example: 2011-09 </p>
 +
       </td>
 +
       <td> required parameter, string </td>
 +
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
      <td>date_from</td>
+
       <td> sort </td>
      <td>Начальная дата выводимой статистики. Используется разный формат дат для разного значения параметра period:
+
       <td> One or some parameters for sorting data, listed with a comma. </td>
          <p>1. day: YYYY-MM-DD, пример: 2011-09-27</p>
+
       <td> optional parameter </td>
          <p>2. month: YYYY-MM, пример: 2011-09</p>
+
   </tr>
      </td>
+
      <td>обязательный параметр, строка</td>
+
  </tr>
+
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
      <td>date_to</td>
+
       <td> limit </td>
      <td>Конечная дата выводимой статистики. Используется разный формат дат для разного значения параметра period:
+
       <td> Number of rows returned </td>
          <p>1. day: YYYY-MM-DD, пример: 2011-09-27</p>
+
       <td> optional parameter, int (numeric value) </td>
          <p>2. month: YYYY-MM, пример: 2011-09</p>
+
   </tr>
      </td>
+
  <tr bgcolor = #F5F5F5>
      <td>обязательный параметр, строка</td>
+
       <td> offset </td>
  </tr>
+
       <td> Offset on returned rows (use with limit parameter) </td>
 +
       <td> optional parameter, int (numeric value) </td>
 +
   </tr>
 
</table>
 
</table>
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает объект с данными
+
Returns an object with data
<code>
+
<code>
 
<pre>
 
<pre>
 
{
 
{
response: {
+
  "response":{
count: %total items%
+
      "count": %количество возвращаемых элементов%,
items: {
+
      "items":[
teaser_id
+
        {
date
+
            "date" // date; returned if group by dates
shows
+
            "id" // id creative; returned if group by creatives
clicks
+
            "views"
ctr
+
            "clicks"
cpm
+
            "conversions"
money
+
            "rejections",
                      }
+
            "holds"
                  }
+
            "moneyOut" // spent
 +
            "moneyIn" // income
 +
            "ctr"
 +
            "cpm"
 +
            "cpc"
 +
        }
 +
      ]
 +
  }
 
}
 
}
 
</pre>
 
</pre>
</code>
+
</code>
==Статистика по материалу==
+
 
Для получения статистики по материалу используется метод <b>ads.analytic.material.get</b><br/>
+
== Material statistics ==
 +
For statistics on the material, use the method <b> ads.analytic.material.get </b> <br/>
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>material_id</td>
+
       <td> material_id </td>
      <td>id материала</td>
+
       <td> material id </td>
      <td>int (числовое значение), обязательный параметр</td>
+
       <td> int (numeric value), required parameter </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>period</td>
+
       <td> period </td>
      <td>Способ группировки данных по датам:  
+
       <td> Method for grouping data by date:
          <p>1. day — статистика по дням;</p>
+
           <p> 1. day - statistics by day; </p>
          <p>2. month — статистика по месяцам;</p>
+
           <p> 2. month - statistics by months; </p>
          <p>Временные ограничения задаются параметрами date_from и date_to</p>
+
           <p> Temporary restrictions are set by date_from and date_to parameters </p>
      </td>
+
       </td>
      <td>обязательный параметр, строка</td>
+
       <td> required parameter, string </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>date_from</td>
+
       <td> date_from </td>
      <td>Начальная дата выводимой статистики. Используется разный формат дат для разного значения параметра period:  
+
       <td> The starting date of the displayed statistics. Different date formats are used for different values ​​of the period parameter:
          <p>1. day: YYYY-MM-DD, пример: 2011-09-27</p>
+
           <p> 1. day: YYYY-MM-DD, Example: 2011-09-27 </p>
          <p>2. month: YYYY-MM, пример: 2011-09</p>
+
           <p> 2. month: YYYY-MM, example: 2011-09 </p>
      </td>
+
       </td>
      <td>обязательный параметр, строка</td>
+
       <td> required parameter, string </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>date_to</td>
+
       <td> date_to </td>
      <td>Конечная дата выводимой статистики. Используется разный формат дат для разного значения параметра period:  
+
       <td> End date of output statistics. Different date formats are used for different values ​​of the period parameter:
          <p>1. day: YYYY-MM-DD, пример: 2011-09-27</p>
+
           <p> 1. day: YYYY-MM-DD, Example: 2011-09-27 </p>
          <p>2. month: YYYY-MM, пример: 2011-09</p>
+
           <p> 2. month: YYYY-MM, example: 2011-09 </p>
      </td>
+
       </td>
      <td>обязательный параметр, строка</td>
+
       <td> required parameter, string </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает объект с данными
+
Returns an object with data
<code>
+
<code>
 
<pre>
 
<pre>
 
{
 
{
response: {
+
response: {
count: %total items%
+
count:% total items%
items: {
+
items: {
date
+
date
shows
+
shows
clicks
+
clicks
ctr
+
ctr
cpm
+
cpm
money
+
money
                      }
+
                       }
                  }
+
                  }
 
}
 
}
 
</pre>
 
</pre>
</code>
+
</code>
==Создание рекламной кампании==
+
 
Для для создания новой рекламной кампании используется метод <b>ads.campaigns.put</b><br>
+
== Creating an advertising campaign ==
Допустимое количество кампаний, создаваемых с помощью одного запроса — 50.<br/>
+
To create a new advertising campaign, use the <b> ads.campaigns.put </b> <br> method
 +
Fifty (50) campaigns can be created with a single request. <br/>
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>data</td>
+
       <td> data </​​td>
      <td>сериализованный JSON-массив объектов, описывающих создаваемые кампании. Описание объектов client_specification см. ниже.</td>
+
       <td> a serialized JSON array of objects describing the campaigns being created. See the client_specification object description below. </Td>
      <td>обязательный параметр, строка</td>
+
       <td> required parameter, string </td>
  </tr>
+
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> client_specification </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> app_id </td>
 +
       <td> user id </td>
 +
       <td> required parameter, int (numeric value) </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> client_id </td>
 +
       <td> id of the client in whose advertising account the campaign will be created. It can also take the value app_id (itself)
 +
       </td>
 +
       <td> required parameter, int (numeric value) </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> ad_format </td>
 +
       <td> Ad Format:
 +
           <p> 10 - Teaser; </p>
 +
           <p> 20 - Banner; </p>
 +
           <p> 30 - Push Notifications; </p>
 +
           <p> 40 - Clickunder; </p>
 +
           <p> 60 - Contextual </p>
 +
       </td>
 +
       <td> required parameter, int (numeric value) </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> cost_type </td>
 +
       <td> Payment method:
 +
           <p> 0 - CPC; </p>
 +
           <p> 1 - CPA; </p>
 +
           <p> 2 - CPM </p>
 +
       </td>
 +
       <td> required parameter, int (numeric value) </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> name </td>
 +
       <td> campaign name
 +
       </td>
 +
       <td> required parameter, string </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> Link_url </td>
 +
       <td> link to the advertised object in the format: http: //yoursite.cоm
 +
       </td>
 +
       <td> required parameter, string </td>
 +
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>client_specification</td>
+
       <td>pushType</td>
  </tr>
+
       <td>Push type:
  <tr bgcolor = #F5F5F5>
+
          <p>1 - On-site Push;</p>
       <td>app_id</td>
+
          <p>2 - Classic;</p>
      <td>id пользователя</td>
+
          <p>4 - In-app push;</p>
      <td>обязательный параметр, int (числовое значение)</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>client_id</td>
+
      <td>id клиента, в рекламном кабинете которого будет создаваться кампания. Так же может принимать значение app_id (самого себя)
+
 
       </td>
 
       </td>
       <td>обязательный параметр, int (числовое значение)</td>
+
       <td>
  </tr>
+
           <p>int (numeric value)</p>
  <tr bgcolor = #F5F5F5>
+
           <p>example: "pushType: 1,2,4"</p>
      <td>ad_format</td>
+
      <td>Формат объявления:
+
           <p>10 - Тизерная;</p>
+
           <p>20 - Баннерная;</p>
+
          <p>30 - Push-уведомления;</p>
+
          <p>40 - Clickunder;</p>
+
          <p>60 - Контекстная</p>
+
 
       </td>
 
       </td>
      <td>обязательный параметр, int (числовое значение)</td>
 
 
   </tr>
 
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> real_url </td>
 +
       <td> link to the real domain of the advertised object in the format: http: //yoursite.cоm
 +
       </td>
 +
       <td> required parameter, string </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> sex </td>
 +
       <td> Gender:
 +
           <p> 3 - any; </p>
 +
           <p> 2 - male; </p>
 +
           <p> 1 - female </p>
 +
       </td>
 +
       <td> required parameter, int (numeric value) </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> age </td>
 +
       <td> The age of the target audience. Age category number from 1 to 6 (up to 17, 18-25, 26-34, 35-49, 50-60, over 61) </td>
 +
       <td> required parameter, a sequence of numbers separated by a comma </td>
 +
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>cost_type</td>
+
       <td>countryTarget</td>
       <td>Способ оплаты:
+
       <td>
           <p>0 - СРС;</p>
+
           <p>Countries id:</p>
           <p>1 - СРА;</p>
+
           <p>/ads.targeting.countries.get</p>
          <p>2 - СРМ</p>
+
 
       </td>
 
       </td>
       <td>обязательный параметр, int (числовое значение)</td>
+
       <td>
  </tr>
+
          <p>required parameter</p>
  <tr bgcolor = #F5F5F5>
+
          <p>array [country_id => [ bid => 0.1, leadCost => 0.2 ] ]</p>
      <td>name</td>
+
      <td>название кампании
+
 
       </td>
 
       </td>
      <td>обязательный параметр, строка</td>
 
 
   </tr>
 
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>Link_url</td>
+
       <td> regionTarget </td>
      <td>ссылка на рекламируемый объект в формате: http://yoursite.cоm
+
       <td>
 +
          <p>ID regions:</p>
 +
          <p>/ads.targeting.regions.get</p>
 
       </td>
 
       </td>
      <td>обязательный параметр, строка</td>
+
       <td> required parameter, a sequence of numbers separated by a comma </td>
  </tr>
+
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>real_url</td>
+
       <td>cityTarget</td>
       <td>ссылка на реальный домен рекламируемого объекта в формате: http://yoursite.cоm
+
       <td>
 +
          <p>ID cities:</p>
 +
          <p>/ads.targeting.cities.get</p>
 
       </td>
 
       </td>
       <td>обязательный параметр, строка</td>
+
       <td>
  </tr>
+
           <p>required parameter, a sequence of numbers separated by a comma </p>
  <tr bgcolor = #F5F5F5>
+
      <td>sex</td>
+
      <td>Пол:
+
           <p>3 - любой;</p>
+
          <p>2 - мужской;</p>
+
          <p>1 - женский</p>
+
 
       </td>
 
       </td>
      <td>обязательный параметр, int (числовое значение)</td>
 
 
   </tr>
 
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> cpa_mode </td>
 +
       <td> Type of conversion notifications for CPA: /ads.targeting.modes.get </td>
 +
       <td> int (numeric value), mandatory for CPA campaigns </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> categories </td>
 +
       <td> <p> category IDs: </p>
 +
           <p> /data.categories.get?ad_format =% </p>
 +
           
 +
       </td>
 +
       <td> required parameter, a sequence of numbers separated by a comma </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> tags </td>
 +
       <td> keyword targeting </td>
 +
       <td> <p> required parameter, a sequence of keywords separated by a comma: [“key1”, “key2”, .., “keyN”] </p>
 +
           <p> Keywords with price. Only for payment - for clicks or for views: {“key1”: “cost”, “key2”: “cost”, .., “keyN”: “cost”} </p>
 +
           <p> cost - float </p>
 +
           <p> example: "data [tags] [qwerty]: 1" is the qwerty keyword with a 1rub rate. </p>
 +
       </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> day_limit </td>
 +
       <td> Daily limit in rubles. For all types except clickunder </td>
 +
       <td> positive number </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> all_limit </td>
 +
       <td> Total limit in rubles. For all types except clickunder </td>
 +
       <td> positive number </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> click_limit </td>
 +
       <td> Maximum count. transitions per day. For all types except clickunder. For views and clicks. </Td>
 +
       <td> positive number </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> conversion_limit </td>
 +
       <td> Maximum count. conversions per day. For all types except clickunder. Only for CPA </td>
 +
       <td> positive number </td>
 +
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
      <td>age</td>
+
       <td> adult_content </td>
      <td>Возраст целевой аудитории. Номер возрастной категории от 1 до 6 (до 17, 18-25, 26-34, 35-49, 50-60, старше 61)</td>  
+
       <td> presence of adult content in the advertising campaign:
      <td>обязательный параметр, последовательность чисел, разделенных запятой</td>
+
           <p> 0 - No; </p>
  </tr>
+
           <p> 1 - Yes </p>
 +
       </td>
 +
       <td> optional parameter, int (numeric value), default 0 </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> adult_site </td>
 +
       <td> Display campaign ads on adult content sites:
 +
           <p> 0 - No; </p>
 +
           <p> 1 - Yes </p>
 +
       </td>
 +
       <td> optional parameter, int (numeric value), default 0 </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> time_show </td>
 +
       <td> Time Targeting:
 +
           <p> & nbsp; & nbsp; * - display in any hours and days of the week </p>
 +
           <p> & nbsp; & nbsp; {} is an array, where the key is the name of the day of the week ["Sn", "Mn", "Tu", "Wd", "Th", "Fr", "Sa"]: </p>
 +
           <p> & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; {} - ‘mn’: ‘*’ - all watches are weekly </p>
 +
           <p> & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; {} - ‘mn’: [0, .., 23] - hours, separated by commas </p>
 +
       </td>
 +
       <td> optional parameter, * default </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> platforms </td>
 +
       <td> platform targeting: /data.platforms </td>
 +
       <td> comma separated numbers </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> browsers </td>
 +
       <td> browser targeting: /data.browsers </td>
 +
       <td> comma separated numbers </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> black_list </td>
 +
       <td> black list of sites where ads will not be shown </td>
 +
       <td> comma separated site ID number sequence </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> white_list </td>
 +
       <td> white list of sites where ads will not be shown </td>
 +
       <td> comma separated site ID number sequence </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> black_list_ip </td>
 +
       <td> ip lock </td>
 +
       <td> sequence of ip addresses separated by a comma or an array </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> unique_day_count </td>
 +
       <td> frequency of material shown to one user (times) </td>
 +
       <td> positive number </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> unique_days </td>
 +
       <td> frequency of advertising material shown to one user (days) </td>
 +
       <td> positive number </td>
 +
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>regions</td>
+
       <td>deviceTarget</td>
       <td>Регионы, от 1 до 10 (1 - Россия, 2 - Украина и т.д.)</td>  
+
       <td>
      <td>обязательный параметр, последовательность чисел, разделенных запятой</td>
+
          <p>ID devices:</p>
  </tr>
+
           <p>/ads.targeting.devices.get</p>
  <tr bgcolor = #F5F5F5>
+
      <td>cpa_mode</td>
+
      <td>Тип уведомлений о конверсий для CPA: /ads.targeting.modes.get</td>
+
      <td>int (числовое значение), обязательное для CPA кампании</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>categories</td>
+
      <td><p>идентификаторы категорий:</p>
+
           <p>/data.categories.get?ad_format=%</p>
+
         
+
 
       </td>
 
       </td>
       <td><p>масив [category_id => cost]</p></td>
+
       <td>
  </tr>
+
           <p>sequence of numbers separated by a comma</p>
  <tr bgcolor = #F5F5F5>
+
      <td>tags</td>
+
      <td>таргетинг по ключевым словам</td>
+
      <td><p>обязательный параметр, последовательность ключевых слов, разделенных запятой: [“key1”, “key2”, .., “keyN”]</p>
+
          <p>Ключевые слова с ценой. Только для оплаты - за клики или за показы: {“key1”: “cost”, “key2”: “cost”, .., “keyN”: “cost”}</p>
+
          <p>cost - float</p>
+
           <p>пример: "data[tags][qwerty]: 1" - ключевое слово qwerty со ставкой 1руб.</p>
+
 
       </td>
 
       </td>
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>day_limit</td>
+
       <td>langTarget</td>
       <td>Дневной лимит в рублях. Для всех типов кроме clickunder</td>
+
       <td>
      <td>положительное число</td>
+
           <p>ID browser languages:</p>
  </tr>
+
           <p>/ads.targeting.langs.get</p>
  <tr bgcolor = #F5F5F5>
+
      <td>all_limit</td>
+
      <td>Общий лимит в рублях. Для всех типов кроме clickunder</td>
+
      <td>положительное число</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>click_limit</td>
+
      <td>Максимальное кол. переходов в день. Для всех типов кроме clickunder. За показы и за клики.</td>
+
      <td>положительное число</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>conversion_limit</td>
+
      <td>Максимальное кол. конверсий в день. Для всех типов кроме clickunder. Только для CPA</td>
+
      <td>положительное число</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>adult_content</td>
+
      <td>присутсвие контента для взрослых в рекламной кампании:
+
           <p>0 - Нет;</p>
+
           <p>1 - Да</p>
+
 
       </td>
 
       </td>
       <td>необязательный параметр, int (числовое значение), по умолчанию 0</td>
+
       <td>
  </tr>
+
           <p>sequence of numbers separated by a comma</p>
  <tr bgcolor = #F5F5F5>
+
      <td>adult_site</td>
+
      <td>Отображать объявления кампании на сайтах с контентом для взрослых:
+
          <p>0 - Нет;</p>
+
           <p>1 - Да</p>
+
 
       </td>
 
       </td>
      <td>необязательный параметр, int (числовое значение), по умолчанию 0</td>
 
  </tr>
 
  <tr bgcolor = #F5F5F5>
 
      <td>time_show</td>
 
      <td>Временной таргетинг:
 
          <p>&nbsp;&nbsp; * - отображение в любые часы и дни недели</p>
 
          <p>&nbsp;&nbsp; {} - массив, где ключ имя дня недели ["Sn","Mn","Tu","Wd","Th","Fr","Sa"]:</p>
 
          <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {} - ‘mn’: ‘*’ - все часы понендельника</p>
 
          <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {} - ‘mn’: [0, .., 23] - часы через запятую</p>
 
      </td>
 
      <td>необязательный параметр, * по умолчанию</td>
 
  </tr>
 
  <tr bgcolor = #F5F5F5>
 
      <td>platforms</td>
 
      <td>таргетинг по платформам:  /data.platforms</td>
 
      <td>последовательность чисел, разделенных запятой</td>
 
  </tr>
 
  <tr bgcolor = #F5F5F5>
 
      <td>browsers</td>
 
      <td>таргетинг по браузерам:  /data.browsers</td>
 
      <td>последовательность чисел, разделенных запятой</td>
 
  </tr>
 
  <tr bgcolor = #F5F5F5>
 
      <td>black_list</td>
 
      <td>черный список площадок на которых не будет показана реклама</td>
 
      <td>последовательность чисел ID площадок, разделенных запятой</td>
 
  </tr>
 
  <tr bgcolor = #F5F5F5>
 
      <td>white_list</td>
 
      <td>белый список площадок на которых не будет показана реклама</td>
 
      <td>последовательность чисел ID площадок, разделенных запятой</td>
 
  </tr>
 
  <tr bgcolor = #F5F5F5>
 
      <td>black_list_ip</td>
 
      <td>блокировка по ip</td>
 
      <td>последовательность ip адресов, разделенных запятой или массивом</td>
 
  </tr>
 
  <tr bgcolor = #F5F5F5>
 
      <td>unique_day_count</td>
 
      <td>частота показов материала одному пользователю (разы)</td>
 
      <td>положительное число</td>
 
  </tr>
 
  <tr bgcolor = #F5F5F5>
 
      <td>unique_days</td>
 
      <td>частота показов рекламного материала одному пользователю (дни)</td>
 
      <td>положительное число</td>
 
 
   </tr>
 
   </tr>
 
</table>
 
</table>
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на запросы в массиве data. Соответствующий объект в выходном массиве содержит id созданной кампании, и поля error_code и error_desc в случае возникновения ошибки.
+
Returns an array of responses to queries in the data array. The corresponding object in the output array contains the id of the created campaign, and the error_code and error_desc fields in case of an error.
<p>Errors:</p>
+
<p> Errors: </p>
<pre>   102 - unknown client
+
<pre> 102 - unknown client
  103 - overlimit campaigns</pre>
+
   103 - overlimit campaigns </pre>
  
==Редактирование рекламных кампаний==
+
== Editing ad campaigns ==
Для редактирования рекламных кампаний используется метод <b>ads.campaigns.update</b><br>
+
To edit ad campaigns, use the <b> ads.campaigns.update </b> <br> method
Максимальное допустимое количество кампаний, редактируемых с помощью одного запроса — 50.<br>
+
The maximum number of campaigns edited with a single query is 50. <br>
Version log: 1.0.1 - добавлен параметр status
+
Version log: 1.0.1 - added status parameter
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> data </​​td>
 +
       <td> is a serialized JSON array of objects describing changes in campaigns. Object descriptions client_mod_specification see below. </Td>
 +
       <td> required parameter, string </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> client_specification </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> campaign_id </td>
 +
       <td> id of the edited campaign
 +
       </td>
 +
       <td> required parameter, positive number </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> name </td>
 +
       <td> campaign name </td>
 +
       <td> optional parameter, a string between 3 and 60 characters </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> link_url </td>
 +
       <td> link to the advertised object in the format http: //yoursite.com </td>
 +
       <td> optional parameter, string </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> real_url </td>
 +
       <td> link to the real domain of the advertised object in the format: http: //yoursite.cоm
 +
       </td>
 +
       <td> optional parameter, string </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> sex </td>
 +
       <td> Gender:
 +
           <p> 3 - any; </p>
 +
           <p> 2 - male; </p>
 +
           <p> 1 - female </p>
 +
       </td>
 +
       <td> optional parameter, int (numeric value) </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> age </td>
 +
       <td> age: /data.ages </td>
 +
       <td> optional parameter, int (numeric value) </td>
 +
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>data</td>
+
       <td>countryTarget</td>
       <td>сериализованный JSON-массив объектов, описывающих изменения в кампаниях. Описание объектов client_mod_specification см. ниже.</td>
+
       <td>
      <td>обязательный параметр, строка</td>
+
          <p>Countries id:</p>
  </tr>
+
          <p>/ads.targeting.countries.get</p>
  <tr bgcolor = #F5F5F5>
+
      <td>client_specification</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>campaign_id</td>
+
      <td>id редактируемой кампании
+
 
       </td>
 
       </td>
       <td>обязательный параметр, положительное число</td>
+
       <td>
  </tr>
+
          <p>required parameter</p>
  <tr bgcolor = #F5F5F5>
+
          <p>array [country_id => [ bid => 0.1, leadCost => 0.2 ] ]</p>
      <td>name</td>
+
      <td>название кампании</td>
+
      <td>необязательный параметр, строка длиной от 3 до 60 символов</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>link_url</td>
+
      <td>ссылка на рекламируемый объект в формате http://yoursite.cоm</td>
+
      <td>необязательный параметр, строка</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>real_url</td>
+
      <td>ссылка на реальный домен рекламируемого объекта в формате: http://yoursite.cоm
+
 
       </td>
 
       </td>
      <td>необязательный параметр, строка</td>
 
 
   </tr>
 
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>sex</td>
+
       <td> regionTarget </td>
      <td>Пол:
+
       <td>
           <p>3 - любой;</p>
+
           <p>ID regions:</p>
           <p>2 - мужской;</p>
+
           <p>/ads.targeting.regions.get</p>
          <p>1 - женский</p>
+
 
       </td>
 
       </td>
      <td>необязательный параметр, int (числовое значение)</td>
+
       <td> required parameter, a sequence of numbers separated by a comma </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
      <td>age</td>
+
      <td>возраст: /data.ages</td>
+
      <td>необязательный параметр, int (числовое значение)</td>
+
  </tr>
+
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>categories</td>
+
       <td>cityTarget</td>
       <td>идентификаторы категорий:
+
       <td>
           <p>/data.categories.get?ad_format=%</p>
+
           <p>ID cities:</p>
           <p>category_id: {region_id: cost}</p>
+
           <p>/ads.targeting.cities.get</p>
 
       </td>
 
       </td>
       <td>необязательный параметр</td>
+
       <td>
  </tr>
+
           <p>required parameter, a sequence of numbers separated by a comma </p>
  <tr bgcolor = #F5F5F5>
+
      <td>tags</td>
+
      <td>таргетинг по ключевым словам</td>
+
      <td>необязательный параметр, последовательность ключевых слов, разделенных запятой</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>day_limit</td>
+
      <td>дневной лимит в рублях. для всех типов кроме clickunder</td>
+
      <td>необязательный параметр, положительное число</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>adult_content</td>
+
      <td>присутсвие контента для взрослых в рекламной кампании:
+
           <p>0 - Нет;</p>
+
          <p>1 - Да</p>
+
 
       </td>
 
       </td>
      <td>необязательный параметр, int (числовое значение), по умолчанию 0</td>
 
 
   </tr>
 
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> categories </td>
 +
       <td> category IDs:
 +
           <p> /data.categories.get?ad_format =% </p>
 +
           <p> category_id: {region_id: cost} </p>
 +
       </td>
 +
       <td> optional parameter </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> tags </td>
 +
       <td> keyword targeting </td>
 +
       <td> optional parameter, comma separated keyword sequence </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> day_limit </td>
 +
       <td> daily limit in rubles. for all types except clickunder </td>
 +
       <td> optional parameter, positive number </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> adult_content </td>
 +
       <td> presence of adult content in the advertising campaign:
 +
           <p> 0 - No; </p>
 +
           <p> 1 - Yes </p>
 +
       </td>
 +
       <td> optional parameter, int (numeric value), default 0 </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> adult_site </td>
 +
       <td> display campaign ads on adult content sites:
 +
           <p> 0 - No; </p>
 +
           <p> 1 - Yes </p>
 +
       </td>
 +
       <td> optional parameter, int (numeric value), default 0 </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> time_show </td>
 +
       <td> Time Targeting:
 +
           <p> & nbsp; & nbsp; * - display in any hours and days of the week </p>
 +
           <p> & nbsp; & nbsp; {} is an array, where the key is the name of the day of the week ["Sn", "Mn", "Tu", "Wd", "Th", "Fr", "Sa"]: </p>
 +
           <p> & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; {} - ‘mn’: ‘*’ - all watches are weekly </p>
 +
           <p> & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; {} - ‘mn’: [0, .., 23] - hours, separated by commas </p>
 +
       </td>
 +
       <td> optional parameter, * default </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> platforms </td>
 +
       <td> platform targeting: /data.platforms </td>
 +
       <td> comma separated numbers </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> browsers </td>
 +
       <td> browser targeting: /data.browsers </td>
 +
       <td> comma separated numbers </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> black_list </td>
 +
       <td> black list of sites where ads will not be shown </td>
 +
       <td> comma separated site ID number sequence </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> white_list </td>
 +
       <td> white list of sites where ads will not be shown </td>
 +
       <td> comma separated site ID number sequence </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> black_list_ip </td>
 +
       <td> ip lock </td>
 +
       <td> sequence of ip addresses separated by a comma or an array </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> status </td>
 +
       <td> start /pause campaign:
 +
           <p> 0 - suspended; </p>
 +
           <p> 1 - running </p>
 +
       </td>
 +
       <td> optional parameter, int (numeric value), default 1 </td>
 +
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>adult_site</td>
+
       <td>deviceTarget</td>
       <td>отображать объявления кампании на сайтах с контентом для взрослых:  
+
       <td>
           <p>0 - Нет;</p>
+
          <p>ID devices:</p>
           <p>1 - Да</p>
+
           <p>/ads.targeting.devices.get</p>
 +
      </td>
 +
      <td>
 +
           <p>sequence of numbers separated by a comma</p>
 
       </td>
 
       </td>
      <td>необязательный параметр, int (числовое значение), по умолчанию 0</td>
 
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>time_show</td>
+
       <td>langTarget</td>
       <td>Временной таргетинг:
+
       <td>
           <p>&nbsp;&nbsp; * - отображение в любые часы и дни недели</p>
+
           <p>ID browser languages:</p>
          <p>&nbsp;&nbsp; {} - массив, где ключ имя дня недели ["Sn","Mn","Tu","Wd","Th","Fr","Sa"]:</p>
+
           <p>/ads.targeting.langs.get</p>
           <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {} - ‘mn’: ‘*’ - все часы понендельника</p>
+
          <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {} - ‘mn’: [0, .., 23] - часы через запятую</p>
+
 
       </td>
 
       </td>
       <td>необязательный параметр, * по умолчанию</td>
+
       <td>
  </tr>
+
           <p>sequence of numbers separated by a comma</p>
  <tr bgcolor = #F5F5F5>
+
      <td>platforms</td>
+
      <td>таргетинг по платформам:  /data.platforms</td>
+
      <td>последовательность чисел, разделенных запятой</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>browsers</td>
+
      <td>таргетинг по браузерам:  /data.browsers</td>
+
      <td>последовательность чисел, разделенных запятой</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>black_list</td>
+
      <td>черный список площадок на которых не будет показана реклама</td>
+
      <td>последовательность чисел ID площадок, разделенных запятой</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>white_list</td>
+
      <td>белый список площадок на которых не будет показана реклама</td>
+
      <td>последовательность чисел ID площадок, разделенных запятой</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>black_list_ip</td>
+
      <td>блокировка по ip</td>
+
      <td>последовательность ip адресов, разделенных запятой или массивом</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>status</td>
+
      <td>запуск/приостановка кампании:
+
          <p>0 - приостановлена;</p>
+
           <p>1 - запущена</p>
+
 
       </td>
 
       </td>
      <td>необязательный параметр, int (числовое значение), по умолчанию 1</td>
 
 
   </tr>
 
   </tr>
 
</table>
 
</table>
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на каждый запрос в массиве data. Соответствующий объект в выходном массиве содержит id изменяемого клиента и, в случае возникновения ошибки, поля error_code и error_desc.
+
Returns an array of responses to each request in the data array. The corresponding object in the output array contains the id of the client being changed and, in case of an error, the error_code and error_desc fields.
<p>Errors:</p>
+
<p> Errors: </p>
<pre>   100 - unknown campaign
+
<pre> 100 - unknown campaign
  102 - unknown client</pre>
+
    102 - unknown client </pre>
  
==Список кампаний рекламного кабинета==
+
== List of campaign advertising campaign ==
Для получения списка кампаний рекламного кабинета используется метод <b>ads.campaigns.get</b>
+
To get a list of campaign advertising campaigns use the method <b> ads.campaigns.get </b>
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>client_id</td>
+
       <td> client_id </td>
      <td>Идентификатор клиента, у которого запрашиваются рекламные кампании</td>
+
       <td> Client ID from which ad campaigns are requested </td>
      <td>int (числовое значение)</td>
+
       <td> int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>include_archive</td>
+
       <td> include_archive </td>
      <td>Флаг, задающий необходимость вывода архивных объявлений:  
+
       <td> A flag that specifies whether to display archived ads:
          <p>0 - выводить только активные кампании;</p>
+
           <p> 0 - show only active campaigns; </p>
          <p>1 - выводить все кампании</p>
+
           <p> 1 - show all campaigns </p>
      </td>
+
       </td>
      <td>Флаг, может принимать значения 1 или 0</td>
+
       <td> Flag, can be 1 or 0 </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>campaign_ids</td>
+
       <td> campaign_ids </td>
      <td>Фильтр выводимых рекламных кампаний.
+
       <td> Filter for displayed ad campaigns.
          <p>Сериализованный JSON-массив, содержащий id кампаний. Выводиться будут только кампании, присутствующие в campaign_ids и являющиеся кампаниями указанного рекламного кабинета. Если параметр равен null, то выводиться будут все кампании.</p>  
+
           <p> Serialized JSON array containing campaign id. Only campaigns that are present in the campaign_ids and are campaigns of the specified advertising cabinet will be displayed. If the parameter is null, then all campaigns will be displayed. </P>
      </td>
+
       </td>
      <td>Строка</td>
+
       <td> String </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>with_bwlist</td>
+
       <td> with_bwlist </td>
      <td>Флаг передачи блек- и вайт-листов</td>
+
       <td> Black and white list transfer flag </td>
      <td>любое значение (например 1)</td>
+
       <td> any value (for example 1) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>with_tags</td>
+
       <td> with_tags </td>
      <td>Флаг передачи ключевых слов</td>
+
       <td> Keyword Transfer Flag </td>
      <td>любое значение (например 1)</td>
+
       <td> any value (for example 1) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>limit</td>
+
       <td> limit </td>
      <td>ограничение на количество возвращаемых кампаний. Используется, только если параметр campaign_ids равен null</td>
+
       <td> limit on the number of campaigns returned. Used only if the campaign_ids parameter is null </td>
      <td>int (числовое значение)</td>
+
       <td> int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>offset</td>
+
       <td> offset </td>
      <td>смещение. Используется в тех же случаях, что и параметр limit</td>
+
       <td> offset. Used in the same cases as the limit parameter </td>
      <td>int (числовое значение)</td>
+
       <td> int (numeric value) </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив объектов campaign, каждый из которых содержит следующие поля:
+
Returns an array of campaign objects, each of which contains the following fields:
<code>
+
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
      count: %total%,
+
       count:% total%
      items: [{
+
       items: [{
  id — идентификатор кампании
+
id - campaign identifier
  name — название кампании
+
name - campaign name
  status — статус кампании (0 — кампания остановлена, 1 — кампания запущена, 2 — кампания удалена)
+
status - campaign status (0 - campaign stopped, 1 - campaign started, 2 - campaign deleted)
  day_limit — дневной лимит кампании в рублях (0 — лимит не задан)
+
day_limit - campaign daily limit in rubles (0 - no limit is set)
  all_limit — общий лимит кампании в рублях (0 — лимит не задан)
+
all_limit - total campaign limit in rubles (0 - no limit is set)
  ad_format — формат объявления
+
ad_format - ad format
  cost_type — тип оплаты
+
cost_type - payment type
  link_url - ссылка на рекламируемый объект
+
link_url - link to the advertised object
  sex - пол
+
sex
  age - возраст
+
age - age
  regions - идентификаторы регионов
+
regions - region identifiers
  categories - идентификаторы категорий.
+
categories - category identifiers.
  adult_content - присутсвие контент для взрослых
+
adult_content - the presence of adult content
  adult_site - отображение объявлений кампании на сайтах с контентом для взрослых
+
adult_site - display campaign ads on adult content sites
          tags - ключевые слова
+
           tags - keywords
          bw_list - блек- и вайт-лист
+
           bw_list - black and white list
      },..]
+
      }, ..]
 
}
 
}
 
</pre>
 
</pre>
</code>
+
</code>
<p>Errors:</p>
+
<p> Errors: </p>
<pre>   102 - unknown client</pre>
+
<pre> 102 - unknown client </pre>
  
==Архивирование рекламной кампании==
+
== Archiving an advertising campaign ==
Для архивирования рекламной кампании используется метод <b>ads.campaigns.delete</b><br>  
+
To archive an existing advertising campaign, use the <b> ads.campaigns.delete </b> <br> method
Максимальное допустимое количество клиентов, редактируемых с помощью одного запроса — 10.<br/>
+
Ten (10) campaigns can be archived with a single request. <br/>
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>ids</td>
+
       <td> ids </td>
      <td>Список id кампаний через запятую или массив с id кампаниями.  
+
       <td> Campaign id list separated by comma or array with id campaigns.
          <p>Например:</p>
+
          <p> For example: </p>
          <p>“id1, id2, , idn“ или [id1, id2, , idn]</p>
+
          <p> “id1, id2, ..., idn“ or [id1, id2, ..., idn] </p>
      </td>
+
       </td>
      <td>обязательный параметр, строка</td>
+
       <td> required parameter, string </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на каждый запрос. Каждый ответ является либо 0, что означает успешное удаление, либо массив error.
+
Returns an array of responses to each request. Each answer is either 0, which means successful deletion, or an error array.
<p>Errors:</p>
+
<p> Errors: </p>
<pre>   100 - unknown campaign
+
<pre> 100 - unknown campaign
  101 - campaign already archive
+
   101 - campaign already archive
  102 - unknown client</pre>
+
   102 - unknown client </pre>
  
==Получение кодов для СРА кампаний==
+
== Receiving codes for CPA campaigns ==
Для получения кодов по СРА кампаниям используется метод <b>ads.campaigns.cpa.mode.get</b><br/>
+
Use the <b> ads.campaigns.cpa.mode.get </b> <br/> method to get the codes for the CPA campaigns
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>campaign_id</td>
+
       <td> campaign_id </td>
      <td>id кампании</td>
+
       <td> campaign id </td>
      <td>int (числовое значение), обязательный параметр</td>
+
       <td> int (numeric value), required parameter </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает объект с данными.
+
Returns an object with data.
<code>
+
<code>
 
<pre>
 
<pre>
 
{
 
{
response: {
+
response: {
url: %url%
+
url:% url%
                  }
+
                  }
 
}
 
}
 
</pre>
 
</pre>
</code>
+
</code>
  
==Получение списка категорий по заданому фильтру==
+
== Getting a list of categories for a given filter ==
Для возврата списка категорий по заданому фильтру используется метод <b>ads.campaigns.categories.get</b><br/>
+
To return the list of categories for a given filter, use the <b> ads.campaigns.categories.get </b> <br/> method
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>ad_format</td>
+
       <td> ad_format </td>
      <td>формат объявления:
+
       <td> ad format:
            <p>ads.campaigns.foarmats.get</p>
+
            <p> ads.campaigns.formats.get </p>
      </td>
+
       </td>
      <td>обязательный параметр, int (числовое значение)</td>
+
       <td> required parameter, int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>category_id</td>
+
       <td> category_id </td>
      <td>id категории. ограничивает отображение только по id категории</td>
+
       <td> category id. limits displaying only by category id </td>
      <td>необязательный параметр, int (числовое значение)</td>
+
       <td> optional parameter, int (numeric value) </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на запросы в массиве response.  
+
Returns an array of responses to queries in the response array.
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
            count: %total%,
+
            count:% total%
            items: [{
+
            items: [{
                      %category_id%: {
+
                       % category_id%: {
                            %region_id%: {
+
                            % region_id%: {
                        min: %min_cost%,
+
min:% min_cost%
                        max: %max_cost%
+
max:% max_cost%
                            }
+
                             }
                      }
+
                       }
                  },..]
+
                  }, ..]
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
  
==Получение списка форматов объявлений==
+
== Getting the list of ad formats ==
Для получения списка форматов объявлений используется метод <b>ads.campaigns.formats.get</b><br/>
+
Use the <b> ads.campaigns.formats.get </b> <br/> method to get the list of ad formats.
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на запросы в массиве response.  
+
Returns an array of responses to queries in the response array.
 +
<code>
 +
<pre>
 +
response: {
 +
       count:% total%
 +
       items: [{
 +
             id:% format_id%
 +
             title: ‘% format title%’
 +
       }, ..]
 +
}
 +
</pre>
 +
</code>
 +
 
 +
== Getting the list of platforms ==
 +
For a list of platforms, use the <b> ads.targeting.platforms.get </b> <br/> method
 +
 
 +
<b> Result: </b> <br/>
 +
Returns an array of responses to queries in the response array.
 +
<code>
 +
<pre>
 +
response: {
 +
       count:%
 +
       items: [{
 +
           id:% platform_id%
 +
           title:% platform_name%,
 +
           mobile:% is mobile%
 +
       }, ..]
 +
}
 +
</pre>
 +
</code>
 +
 
 +
== Getting Browser List ==
 +
For a list of browsers, use the <b> ads.targeting.browsers.get </b> <br/> method
 +
 
 +
<b> Result: </b> <br/>
 +
Returns an array of responses to queries in the response array.
 +
<code>
 +
<pre>
 +
response: {
 +
       count:%
 +
       items: [{
 +
           id:% browser_id%,
 +
           title:% browser_name%,
 +
       }, ..]
 +
}
 +
</pre>
 +
</code>
 +
 
 +
== Getting a list of conversion notifications for the CPA ==
 +
To get a list of conversion notifications for CPA, use the <b> ads.targeting.cpa.modes.get </b> <br/> method
 +
 
 +
<b> Result: </b> <br/>
 +
Returns an array of responses to queries in the response array.
 +
<code>
 +
<pre>
 +
response: {
 +
       count:% total%
 +
       items: [{
 +
           id:% mode_id%
 +
           title: ‘% mode title%’
 +
       }, ..]
 +
}
 +
</pre>
 +
</code>
 +
 
 +
== Getting a list of ages ==
 +
To get the list of views, use the <b> ads.targeting.ages.get </b> <br/> method
 +
 
 +
<b> Result: </b> <br/>
 +
Returns an array of responses to queries in the response array.
 +
<code>
 +
<pre>
 +
response: {
 +
       count:%
 +
       items: [{
 +
           id:% age_id%
 +
           title:% age_name%
 +
       }, ..]
 +
}
 +
</pre>
 +
</code>
 +
 
 +
==Getting a list of countries==
 +
To get the list of countries, use the <b>ads.targeting.countries.get</b> method<br/>
 +
<b>Result:</b><br/>
 +
Returns an array of responses to queries in the response array.  
 
<code>
 
<code>
 
<pre>
 
<pre>
Line 989: Line 1,201:
 
</code>
 
</code>
  
==Получение списка платформ==
+
==Getting a list of regions==
Для получения списка платформ используется метод <b>ads.targeting.platforms.get</b><br/>
+
To get the list of regions, use the <b>ads.targeting.regions.get</b> method<br/>
 
+
<b>Result:</b><br/>
<b>Результат:</b><br/>
+
Returns an array of responses to queries in the response array.  
Возвращает массив ответов на запросы в массиве response.
+
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
       count: %,
+
       count: %total%,
 
       items: [{
 
       items: [{
          id: %platform_id%,
+
            id: %format_id%,
          title: %platform_name%,
+
            title: %format title%
          mobile: %is mobile%
+
 
       },..]
 
       },..]
 
}
 
}
Line 1,007: Line 1,217:
 
</code>
 
</code>
  
==Получение списка браузеров==
+
==Getting a list of cities==
Для получения списка браузеров используется метод <b>ads.targeting.browsers.get</b><br/>
+
To get the list of cities, use the <b>ads.targeting.cities.get</b> method<br/>
 
+
<b>Result:</b><br/>
<b>Результат:</b><br/>
+
Returns an array of responses to queries in the response array.  
Возвращает массив ответов на запросы в массиве response.
+
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
       count: %,
+
       count: %total%,
 
       items: [{
 
       items: [{
          id: %browser_id%,
+
            id: %format_id%,
          title: %browser_name%,
+
            title: %format title%
 
       },..]
 
       },..]
 
}
 
}
Line 1,024: Line 1,233:
 
</code>
 
</code>
  
==Получение списка уведомлений о конверсиях для СРА==
+
==Getting a list of devices==
Для получения списка уведомлений о конверсиях для СРА используется метод <b>ads.targeting.cpa.modes.get</b><br/>
+
To get the list of devices, use the <b>ads.targeting.devices.get</b> method<br/>
 
+
<b>Result:</b><br/>
<b>Результат:</b><br/>
+
Returns an array of responses to queries in the response array.  
Возвращает массив ответов на запросы в массиве response.
+
 
<code>
 
<code>
 
<pre>
 
<pre>
Line 1,034: Line 1,242:
 
       count: %total%,
 
       count: %total%,
 
       items: [{
 
       items: [{
          id: %mode_id%,
+
            id: %format_id%,
          title: ‘%mode title%’
+
            title: ‘%format title%’
 
       },..]
 
       },..]
 
}
 
}
Line 1,041: Line 1,249:
 
</code>
 
</code>
  
==Получение списка возрастов==
+
==Getting a list of browser languages==
Для получения списка возврастов используется метод <b>ads.targeting.ages.get</b><br/>
+
To get the list of devices, use the browser languages <b>ads.targeting.langs.get</b> method<br/>
 
+
<b>Result:</b><br/>
<b>Результат:</b><br/>
+
Returns an array of responses to queries in the response array.  
Возвращает массив ответов на запросы в массиве response.
+
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
       count: %,
+
       count: %total%,
 
       items: [{
 
       items: [{
          id: %age_id%,
+
            id: %format_id%,
          title: %age_name%
+
            title: %format title%
 
       },..]
 
       },..]
 
}
 
}
Line 1,058: Line 1,265:
 
</code>
 
</code>
  
==Создание клиентов рекламного агенства==
+
== Creating advertising agency clients ==
Для создания клиентов рекламного агенства используется метод <b>ads.clients.put</b><br/>
+
To create ad agency clients, use the <b> ads.clients.put</b> method<br/>
Допустимое количество создаваемых клиентов с помощью одного запроса — 50.
+
The allowable number of clients created with a single request is 50.
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>data</td>
+
       <td> data </​​td>
      <td>сериализованный JSON-массив объектов, описывающих создаваемые кампании. Описание объектов client_specification см. ниже.</td>
+
       <td> a serialized JSON array of objects describing the campaigns being created. See the client_specification object description below. </Td>
      <td>обязательный параметр, строка</td>
+
       <td> required parameter, string </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>client_specification</td>
+
       <td> client_specification </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>name</td>
+
       <td> name </td>
      <td>название клиента</td>
+
       <td> client name </td>
      <td>строка от 3 до 60 символов, обязательный параметр</td>
+
       <td> string from 3 to 60 characters, required parameter </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>day_limit</td>
+
       <td> day_limit </td>
      <td>дневной лимит в рублях</td>
+
       <td> daily limit in rubles </td>
      <td>int (числовое значение)</td>
+
       <td> int (numeric value) </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на запросы в массиве data. Соответствующий объект в выходном массиве содержит информацию клиента или массив error в случае возникновения ошибки (для каждого клиента отдельно).  
+
Returns an array of responses to queries in the data array. The corresponding object in the output array contains the client information or the error array in case of an error (for each client separately).
 
<code>
 
<code>
 
<pre>
 
<pre>
 
{
 
{
    client_id — идентификатор клиента;
+
    client_id - client identifier;
    name — название клиента;
+
    name - the name of the client;
    day_limit — дневной лимит клиента в рублях;
+
    day_limit - client's daily limit in rubles;
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
  
==Редактирование клиентов рекламного агенства==
+
== Editing advertising agency clients ==
Для редактирования клиентов рекламного агенства используется метод <b>ads.clients.update</b><br/>
+
To edit ad agency clients, use the <b> ads.clients.update </b> method<br/>
Максимальное допустимое количество клиентов, редактируемых с помощью одного запроса — 50.
+
The maximum number of clients edited with a single query is 50.
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>data</td>
+
       <td> data </​​td>
      <td>сериализованный JSON-массив объектов, описывающих изменения в клиентах. Описание объектов client_mod_specification см. ниже.         </td>
+
       <td> is a serialized JSON array of objects describing changes in clients. Description of client_mod_specification objects see below. </td>
      <td>обязательный параметр, строка</td>
+
       <td> required parameter, string </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>client_mod_specification</td>
+
       <td> client_mod_specification </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>client_id</td>
+
       <td> client_id </td>
      <td>идентификатор редактируемого клиента</td>
+
       <td> ID of the client being edited </td>
      <td>обязательный параметр, положительное число</td>
+
       <td> required parameter, positive number </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>name</td>
+
       <td> name </td>
      <td>название клиента</td>
+
       <td> client name </td>
      <td>строка длиной от 3 до 60 символов</td>
+
       <td> a string between 3 and 60 characters </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>day_limit</td>
+
       <td> day_limit </td>
      <td>дневной лимит в рублях</td>
+
       <td> daily limit in rubles </td>
      <td>положительное число</td>
+
       <td> positive number </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на каждый запрос в массиве data. Соответствующий объект в выходном массиве содержит id изменяемого клиента и, в случае возникновения ошибки, поля error_code иerror_desc.
+
Returns an array of responses to each request in the data array. The corresponding object in the output array contains the id of the client being changed and, in case of an error, the error_code and error_desc fields.
  
==Получение списка клиентов рекламного агенства==
+
== Getting a list of advertising agency clients ==
Для возврата списка клиентов рекламного агенства используется метод <b>ads.clients.get</b><br/>
+
To return the list of clients of an advertising agency, use the <b> ads.clients.get method </b> <br/>
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>client_ids</td>
+
       <td> client_ids </td>
      <td>Список id клиентов через запятую. Например: “id1, id2, , idn“</td>
+
       <td> A list of client ids separated by commas. For example: “id1, id2, ..., idn“ </td>
      <td>необязательный параметр, строка</td>
+
       <td> optional parameter, string </td>
  </tr>
+
   </tr>
  
 
</table>
 
</table>
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив объектов client — клиентов агентства, каждый из которых содержит следующие поля:  
+
Returns an array of client objects of the agency, each of which contains the following fields:
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
      count: %total%,
+
      count:% total%
      items: [{
+
      items: [{
          client_id — идентификатор клиента;
+
           client_id - client identifier;
          name — название клиента;
+
           name - the name of the client;
          day_limit — дневной лимит клиента в рублях;
+
           day_limit - client's daily limit in rubles;
          balance - баланс клиента
+
           balance - client's balance
      },..]
+
      }, ..]
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
  
==Архивирование клиентов рекламного агенства==
+
== Archiving advertising agency clients ==
Для архивирования клиентов рекламного агенства используется метод <b>ads.clients.delete</b><br/>
+
For archiving ad agency clients, use the <b> ads.clients.delete method </b> <br/>
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>ids</td>
+
       <td> ids </td>
      <td>Список id клиентов через запятую или массив с id клиентами.  
+
       <td> List of clients' id by comma or array with id clients.
            <p>Например: “id1, id2, , idn“ или [id1, id2, , idn]</p>
+
            <p> For example: “id1, id2, ..., idn“ or [id1, id2, ..., idn] </p>
      </td>
+
      </td>
      <td>обязательный параметр, строка</td>
+
       <td> required parameter, string </td>
  </tr>
+
   </tr>
  
 
</table>
 
</table>
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на каждый запрос. Каждый ответ является либо 0, что означает успешное удаление, либо массив error.
+
Returns an array of responses to each request. Each answer is either 0, which means successful deletion, or an error array.
  
==Подвязывание клиента к рекламному агенству==
+
== Tying a client to an advertising agency ==
Для подвязывания клиента к рекламному агенству используется метод <b>ads.clients.bind.put</b><br/>
+
To bind a client to an advertising agency, use the <b> ads.clients.bind.put method </b> <br/>
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>email</td>
+
       <td> email </td>
      <td>email адрес клиента</td>
+
       <td> client email address </td>
      <td>строка от 3 до 60 символов, обязательный параметр</td>
+
       <td> string from 3 to 60 characters, required parameter </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>password</td>
+
       <td> password </td>
      <td>пароль клиента (от кабинета)</td>
+
       <td> client password (from account) </td>
      <td>строка от 3 до 60 символов, обязательный параметр</td>
+
       <td> string from 3 to 60 characters, required parameter </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает:  
+
Returns:
 
<code>
 
<code>
 
<pre>
 
<pre>
 
{
 
{
“bind”: true
+
“Bind”: true
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
в случае успеха. Или error в случае возникновения ошибки.
+
in case of success. Or error in case of an error.
  
==Открепление клиента от рекламного агенства==
+
== Detaching a client from an advertising agency ==
Для открепления клиента от рекламного агенства используется метод <b>ads.clients.unbind.put</b><br/>
+
To detach a client from an advertising agency, use the <b> ads.clients.unbind.put method </b> <br/>
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>client_id</td>
+
       <td> client_id </td>
      <td>id клиента</td>
+
       <td> client id </td>
      <td>int (числовое значение)</td>
+
       <td> int (numeric value) </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает:  
+
Returns:
 
<code>
 
<code>
 
<pre>
 
<pre>
 
{
 
{
“unbind”: true
+
“Unbind”: true
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
в случае успеха. Или error в случае возникновения ошибки.
+
in case of success. Or error in case of an error.
  
==Пополнение счета клиента==
+
== Customer account replenishment ==
Для пополнения счета клиента используется метод <b>ads.clients.balance.put</b><br/>
+
To replenish the client’s account, use the <b> ads.clients.balance.put</b> method<br/>
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>client_id</td>
+
       <td> client_id </td>
      <td>id клиента для пополнения</td>
+
       <td> customer id to replenish </td>
      <td>int (числовое значение), обязательный параметр</td>
+
       <td> int (numeric value), required parameter </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>sum</td>
+
       <td> sum </td>
      <td>сума в рублях</td>
+
       <td> rubles in rubles </td>
      <td>int (числовое значение)</td>
+
       <td> int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>back_url</td>
+
       <td> back_url </td>
      <td>url куда переадресует клиента система пополнения</td>
+
       <td> url where the recharge system forwards the client </td>
      <td>string (строка)</td>
+
       <td> string (string) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>system_id</td>
+
       <td> system_id </td>
      <td>id системы пополнения:
+
       <td> replenishment system id:
            <p>data.balance.systems.get</p>
+
             <p> data.balance.systems.get </p>
      </td>
+
       </td>
      <td>int (числовое значение), обязательный параметр</td>
+
       <td> int (numeric value), required parameter </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает url для оплаты:  
+
Returns the url for payment:
 
<code>
 
<code>
 
<pre>
 
<pre>
 
{
 
{
response: {
+
response: {
url: %url%
+
url:% url%
                  }
+
                  }
 
}
 
}
  
Line 1,298: Line 1,505:
 
</code>
 
</code>
  
==Создание рекламных объявлений==
+
== Creating advertisements ==
Для создания рекламных объявлений используется метод <b>ads.materials.put</b><br/>
+
To create ads using the method <b> ads.materials.put </b> <br/>
Максимальное допустимое количество объявлений, создаваемых с помощью одного запроса — 20.
+
The maximum allowable number of ads generated by a single request is 20.
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>data</td>
+
       <td> data </​​td>
      <td>сериализованный JSON-массив объектов, описывающих создаваемые объявления. Описание объектов ad_specification см. ниже. </td>
+
       <td> is a serialized JSON array of objects describing the created ads. The description of ad_specification objects is given below. </td>
      <td>обязательный параметр, строка</td>
+
       <td> required parameter, string </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>ad_specification</td>
+
       <td> ad_specification </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>campaign_id</td>
+
       <td> campaign_id </td>
      <td>id кампании, в которой будет создаваться объявление</td>
+
       <td> id of the campaign in which the ad will be created </td>
      <td>обязательный параметр, int (числовое значение)</td>
+
       <td> required parameter, int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>title</td>
+
       <td> title </td>
      <td>заголовок объявления</td>
+
       <td> ad title </td>
      <td>обязательный параметр</td>
+
       <td> required parameter </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>text</td>
+
       <td> text </td>
      <td>описание объявления</td>
+
       <td> ad description </td>
      <td>обязательно</td>
+
       <td> Required </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>link_url</td>
+
       <td> link_url </td>
      <td>ссылка рекламируемого объекта в формате: http://yoursite.cоm</td>
+
       <td> link of the advertised object in the format: http://yoursite.com/ </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>link_media</td>
+
       <td> link_media </td>
      <td>загруженный ранее медиа объект (jpg, gif):
+
       <td> previously loaded media object (jpg, gif):
              <p>data.upload.media</p>
+
              <p> data.upload.media </p>
      </td>
+
       </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>pause_after_moderate</td>
+
       <td> pause_after_moderate </td>
      <td>установка объявления на паузу после модерации</td>
+
       <td> pause posting moderation </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>size</td>
+
       <td> size </td>
      <td>только для банеров:
+
       <td> for banners only:
              <p>ads.materials.banner.sizes</p>
+
              <p> ads.materials.banner.sizes </p>
      </td>
+
       </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>categories</td>
+
       <td> categories </td>
      <td>Стаки по категориям, аналогично как и для кампаний:
+
       <td> Stacks by category, similar to campaigns:
        <p>массив [category_id => cost]</p>
+
         <p> array [category_id => cost] </p>
      </td>
+
       </td>
<td>Не обязательно, если не задавать будут использоваться ставки из категорий кампании</td>
+
<td> Not required if you do not set bids from campaign categories </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
  
==Обновление данных рекламных объявлений==
+
== Update ad data ==
Для обновления данных рекламных объявлений используется метод <b>ads.materials.update</b><br/>
+
Use the <b> ads.materials.update </b> <br/> method to update ad data.
Максимальное допустимое количество объявлений, создаваемых с помощью одного запроса — 20.
+
The maximum allowable number of ads generated by a single request is 20.
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> data </​​td>
 +
       <td> is a serialized JSON array of objects describing the created ads. The ad_specification object description is below. </Td>
 +
       <td> required parameter, string </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> ad_specification </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> material_id </td>
 +
       <td> ad id </td>
 +
       <td> required parameter, int (numeric value) </td>
 +
   </tr>
 +
   <tr bgcolor = #F5F5F5>
 +
       <td> status </td>
 +
       <td> start /pause material:
 +
           <p> 0 - suspended; </p>
 +
           <p> 1 - running </p>
 +
       </td>
 +
       <td> optional parameter, int (numeric value), default 1 </td>
 +
   </tr>
 +
<tr bgcolor = #F5F5F5>
 +
        <td>bids</td>
 +
        <td>Geo bids:
 +
          <p>array "bids":{"countryID":{"bid":cost}}</p>
 +
          <p>coutries ID list - /ads.targeting.countries.get</p>
 +
        </td>
 +
  <td>optional parameter</td>
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
       <td>data</td>
+
       <td>link_url</td>
       <td>сериализованный JSON-массив объектов, описывающих создаваемые объявления. Описание объектов ad_specification см. ниже</td>
+
       <td>link of the advertised object in the format: http://yoursite.com/</td>
      <td>обязательный параметр, строка</td>
+
       <td>optional parameter</td>
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>ad_specification</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>material_id</td>
+
      <td>id объявления</td>
+
      <td>обязательный параметр, int (числовое значение)</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>status</td>
+
      <td>запуск/приостановка материала:
+
          <p>0 - приостановлена;</p>
+
          <p>1 - запущена</p>
+
      </td>
+
       <td>необязательный параметр, int (числовое значение), по умолчанию 1</td>
+
 
   </tr>
 
   </tr>
 
</table>
 
</table>
  
==Архивирование рекламных объявлений==
+
== Archiving advertisements ==
Для архивирования рекламных объявлений используется метод <b>ads.materials.delete</b><br/>
+
For advertising ads using the method <b> ads.materials.delete </b> <br/>
Максимальное допустимое количество клиентов, редактируемых с помощью одного запроса — 50.
+
The maximum number of clients edited with a single query is 50.
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>account_id</td>
+
       <td> account_id </td>
      <td>идентификатор рекламного кабинета</td>
+
       <td> advertising account ID </td>
      <td>обязательный параметр, int (числовое значение)</td>
+
       <td> required parameter, int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>ids</td>
+
       <td> ids </td>
      <td>сериализованный JSON-массив, содержащий идентификаторы объявлений</td>
+
       <td> serialized JSON array containing ad IDs </td>
      <td>обязательный параметр, строка</td>
+
       <td> required parameter, string </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на каждый запрос. Каждый ответ является либо 0, что означает успешное удаление, либо массив error.
+
Returns an array of responses to each request. Each answer is either 0, which means successful deletion, or an error array.
  
==Получение списка рекламных объявлений==
+
== Getting a list of advertisements ==
Для получения списка рекламных объявлений используется метод <b>ads.materials.get</b>
+
Use the <b> ads.materials.get </b> method to get the list of ads.
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>account_id</td>
+
       <td> account_id </td>
      <td>идентификатор рекламного кабинета</td>
+
       <td> advertising account ID </td>
      <td>обязательный параметр, int (числовое значение)</td>
+
       <td> required parameter, int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>client_id</td>
+
       <td> client_id </td>
      <td>Для рекламных агентств. Идентификатор клиента, у которого запрашиваются рекламные объявления.</td>
+
       <td> For advertising agencies. Client ID from which advertisements are requested. </Td>
      <td>int (числовое значение)</td>
+
       <td> int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>archive</td>
+
       <td> archive </td>
      <td>Флаг, задающий необходимость вывода архивных объявлений:  
+
       <td> A flag that specifies whether to display archived ads:
          <p>0 - выводить только активные объявления;</p>
+
           <p> 0 - display only active ads; </p>
          <p>1 - выводить все объявления</p>
+
           <p> 1 - display all ads </p>
      </td>
+
       </td>
      <td>Флаг, может принимать значения 1 или 0</td>
+
       <td> Flag, can be 1 or 0 </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>campaign_ids</td>
+
       <td> campaign_ids </td>
      <td>фильтр по рекламным кампаниям.
+
       <td> ad campaign filter.
            <p>Сериализованный JSON-массив, содержащий id кампаний. Если параметр равен null, то будут выводиться рекламные объявления всех кампаний.</p>
+
             <p> Serialized JSON array containing campaign id. If the parameter is null, advertisements of all campaigns will be displayed. </P>
      </td>
+
       </td>
      <td>строка</td>
+
       <td> string </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>material_ids</td>
+
       <td> material_ids </td>
      <td>фильтр по рекламным кампаниям.
+
       <td> ad campaign filter.
            <p>Сериализованный JSON-массив, содержащий id объявлений. Если параметр равен null, то будут выводиться все рекламные объявления.</p>
+
             <p> Serialized JSON array containing ad id. If the parameter is null, all advertisements will be displayed. </P>
      </td>
+
       </td>
      <td>строка</td>
+
       <td> string </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>limit</td>
+
       <td> limit </td>
      <td>ограничение на количество возвращаемых объявлений. Используется, только если параметр ad_ids равен null, а параметр campaign_ids содержит id только одной кампании.  
+
       <td> limit on the number of ads returned. Used only if the ad_ids parameter is null, and the campaign_ids parameter contains the id of only one campaign.
      </td>
+
       </td>
      <td>int (числовое значение)</td>
+
       <td> int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>offset</td>
+
       <td> offset </td>
      <td>смещение. Используется в тех же случаях, что и параметр limit</td>
+
       <td> offset. Used in the same cases as the limit parameter </td>
      <td>int (числовое значение)</td>
+
       <td> int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>ad_format</td>
+
       <td> ad_format </td>
      <td>формат объявления: ads.campaigns.formats.get</td>
+
       <td> ad format: ads.campaigns.formats.get </td>
      <td>обязательный параметр, int (числовое значение)</td>
+
       <td> required parameter, int (numeric value) </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив объектов ad, каждый из которых содержит следующие поля:  
+
Returns an array of ad objects, each of which contains the following fields:
  <ul type="disc">
+
  <ul type = "disc">
      <li><b>id</b> — идентификатор объявления</li>
+
       <li> <b> id </b> - ad id </li>
      <li><b>name</b> — название объявления</li>
+
       <li> <b> name </b> - the name of the ad </li>
      <li><b>campaign_id</b> — идентификатор кампании</li>
+
       <li> <b> campaign_id </b> - Campaign ID </li>
      <li><b>link_url</b></li>
+
       <li> <b> link_url </b> </li>
      <li><b>arhive</b></li>
+
       <li> <b> arhive </b> </li>
      <li><b>ad_format</b> — формат объявления</li>
+
       <li> <b> ad_format </b> - ad format </li>
      <li><b>cost_type</b> — тип оплаты</li>
+
       <li> <b> cost_type </b> - payment type </li>
      <li><b>all_limit</b> — общий лимит объявления в рублях</li>
+
       <li> <b> all_limit </b> - total ad limit in rubles </li>
            <ul type="circle">
+
            <ul type = "circle">
                      <li>0 — лимит не задан</li>
+
                       <li> 0 - no limit is set </li>
            </ul>
+
            </ul>
      <li><b>status </b> — статус объявления:</li>
+
       <li> <b> status </b> - ad status: </li>
            <ul type="circle">
+
            <ul type = "circle">
                      <li>0 — объявление остановлено;</li>
+
                       <li> 0 - ad stopped; </li>
                      <li>1 — объявление запущено;</li>
+
                       <li> 1 - the ad is running; </li>
                      <li>2 — объявление удалено</li>
+
                       <li> 2 - ad deleted </li>
            </ul>
+
            </ul>
      <li><b>approved </b> — статус модерации объявления:</li>
+
       <li> <b> approved </b> - ad moderation status: </li>
            <ul type="circle">
+
            <ul type = "circle">
                      <li>0 — объявление ожидает модерации;</li>
+
                       <li> 0 - the ad is awaiting moderation; </li>
                      <li>10 — объявление одобрено;</li>
+
                       <li> 10 - Ad has been approved. </li>
                      <li>20 — объявление отклонено</li>
+
                       <li> 20 - ad disapproved </li>
            </ul>
+
            </ul>
  </ul>
+
  </ul>
  
==Получение списка размеров баннеров==
+
== Getting a list of banner sizes ==
Для получение списка размеров баннеров используется метод <b>ads.materials.banner.sizes.get</b><br/>
+
For a list of banner sizes, use the <b> ads.materials.banner.sizes.get </b> <br/> method
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на запросы в массиве response:
+
Returns an array of responses to requests in the response array:
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
      count: %total%,
+
        count:% total%
      items: [{
+
        items: [{
            id: %banner_id%,
+
             id:% banner_id%,
            title: ‘%banner title%’
+
             title: ‘% banner title%’
      },..]
+
        }, ..]
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
  
==Получение списка стран==
+
== Getting the list of countries ==
Для получение списка стран используется метод <b>data.geo.countries.get</b><br/>
+
To get the list of countries, use the <b> data.geo.countries.get </b> <br/> method
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на запросы в массиве response:
+
Returns an array of responses to requests in the response array:
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
  count: %,
+
    count:%
  items: [{
+
    items: [{
      id: %country_id%,
+
        id:% country_id%,
      title: %country_name%
+
        title:% country_name%
  },..]
+
    }, ..]
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
  
==Получение списка регионов по заданому фильтру==
+
== Getting a list of regions for a given filter ==
Для получения списка регионов по заданому фильтру используется метод <b>data.geo.regions.get</b><br/>
+
To get a list of regions for a given filter, use the <b> data.geo.regions.get </b> <br/> method
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>country_id</td>
+
       <td> country_id </td>
      <td>идентификатор страны, полученный в методе ads.geo.countries</td>
+
       <td> country identifier obtained in the ads.geo.countries method </td>
      <td>положительное число, обязательный параметр</td>
+
       <td> positive number, required parameter </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на запросы в массиве response:
+
Returns an array of responses to requests in the response array:
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
        count: %,
+
        count:%
        items: [{
+
        items: [{
              id: %region_id%,
+
               id:% region_id%
              title: %region_name%
+
               title:% region_name%
        },..]
+
        }, ..]
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
  
==Получение списка доступных платежных систем==
+
== Get a list of available payment systems ==
Для получения списка доступных платежных систем используется метод <b>data.balance.systems.get</b><br/>
+
To get a list of available payment systems, use the <b> data.balance.systems.get </b> <br/> method
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на запросы в массиве response:
+
Returns an array of responses to requests in the response array:
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
        count: %total%,
+
         count:% total%
        items: [{
+
         items: [{
              id: %pay_system_id%,
+
                id:% pay_system_id%,
              title: %pay system title%’
+
                title: pay% pay system title% ’
        },..]
+
         }, ..]
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
  
==Загрузка медиа файлов==
+
== Download media files ==
Для загрузки медиа файлов (jpg, png, gif) используется метод <b>data.upload.media.update</b><br/>
+
To upload media files (jpg, png, gif), use the <b> data.upload.media.update </b> <br/> method
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>ad_format</td>
+
       <td> ad_format </td>
      <td>формат объявления: /ads.formats.get</td>
+
       <td> ad format: /ads.formats.get </td>
      <td>int (числовое значение)</td>
+
       <td> int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>file</td>
+
       <td> file </td>
      <td>CURLFile object</td>
+
       <td> CURLFile object or url or base64 </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив с ссылкой на конечный объект или error в случае ошибки
+
Returns an array with a reference to the target object or error in case of an error.
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
        image: “%link%”
+
        image: “% link%”
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
Пример отправки файла с использование curl в php:
+
An example of sending a file using curl in php:
 
<code>
 
<code>
 
<pre>
 
<pre>
      $token = ‘полученный токен’;
+
       $ token = ‘received token’;
      $ad_format = ‘формат объявления’;
+
       $ ad_format = объявления ad format ’;
      $app_id = ‘ваш app id’;
+
       $ app_id = ‘your app id’;
      $file = '@/полный путь к файлу';
+
       $ file = '@ /full path to file';
 
</pre>
 
</pre>
 
<pre>
 
<pre>
      $finfo = finfo_open(FILEINFO_MIME_TYPE);
+
       $ finfo = finfo_open (FILEINFO_MIME_TYPE);
      $finfo = finfo_file($finfo, $link);
+
       $ finfo = finfo_file ($ finfo, $ link);
      $cFile = new \CURLFile($link, $finfo, basename($link));
+
       $ cFile = new \ CURLFile ($ link, $ finfo, basename ($ link));
 
</pre>
 
</pre>
  
 
<pre>
 
<pre>
      $post = array('file'=>$cFile, 'ad_format' => $ad_format, 'app_id' => $app_id);
+
       $ post = array ('file' => $ cFile, 'ad_format' => $ ad_format, 'app_id' => $ app_id);
      $ignoreParams = array('file'); //поле file не участвует в построении подписи
+
       $ ignoreParams = array ('file'); //file field is not involved in the construction of the signature
 
</pre>
 
</pre>
 
<pre>
 
<pre>
      ksort( $post );
+
       ksort ($ post);
 
</pre>
 
</pre>
 
<pre>
 
<pre>
      $result = array ();
+
       $ result = array ();
      foreach( $post as $key => $value ) {
+
       foreach ($ post as $ key => $ value) {
        if(false == in_array($key, $ignoreParams)) {
+
         if (false == in_array ($ key, $ ignoreParams)) {
      $result[] = $key . '=' . urlencode( $value );
+
$ result [] = $ key. '='. urlencode ($ value);
        }
+
}
      }
+
       }
 
</pre>
 
</pre>
 
<pre>
 
<pre>
      $result = implode( '&', $result );
+
       $ result = implode ('&', $ result);
      $signature = md5( $result . $token );
+
       $ signature = md5 ($ result. $ token);
 
</pre>
 
</pre>
 
<pre>
 
<pre>
      $target_url = 'http://api.kadam.net/data.upload.media?signature=' . $signature;
+
       $ target_url = 'http://api.kadam.net/data.upload.media?signature='. $ signature;
 
</pre>
 
</pre>
 
<pre>
 
<pre>
      $ch = curl_init();
+
       $ ch = curl_init ();
      curl_setopt($ch, CURLOPT_URL,$target_url);
+
       curl_setopt ($ ch, CURLOPT_URL, $ target_url);
      curl_setopt($ch, CURLOPT_POST, true);
+
       curl_setopt ($ ch, CURLOPT_POST, true);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
+
       curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ post);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
+
       curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1);
 
</pre>
 
</pre>
 
<pre>
 
<pre>
      $result = curl_exec ($ch); //ответ сервера
+
       $ result = curl_exec ($ ch); //server response
 
</pre>
 
</pre>
 
</code>
 
</code>
  
==Получение текущего времени сервера==
+
== Get the current server time ==
Для получения текущего времени сервера в формате ISO 8601 используется метод <b>server.time.get</b><br/>
+
To get the current server time in ISO 8601 format, use the <b> server.time.get </b> <br/> method
  
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Возвращает массив ответов на запросы в массиве response:
+
Returns an array of responses to requests in the response array:
 
<code>
 
<code>
 
<pre>
 
<pre>
      {
+
        {
          iso8601: %time%
+
            iso8601:% time%
      }
+
        }
 
</pre>
 
</pre>
 
</code>
 
</code>
  
==Статистика для Вебмастера==
+
== Statistics for Webmasters ==
Для получения статистики по вебмастерам используется метод <b>webmaster.reports.report.get</b><br/>
+
For statistics on webmasters use the method <b> webmaster.reports.report.get </b> <br/>
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>secret</td>
+
       <td> secret </td>
      <td>Ключ доступа для вебмастера(обязательный)</td>
+
       <td> Access key for webmasters (mandatory) </td>
      <td>Можно получить по требованию</td>
+
       <td> Available on demand </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>date_from</td>
+
       <td> date_from </td>
      <td>Начало периода</td>
+
       <td> Start of Period </td>
      <td>строка вида "YYYY-MM-DD", не обязательный параметр, в случае отсутствия будет взята текущая дата</td>
+
       <td> a string of the form "YYYY-MM-DD" is an optional parameter; if absent, the current date will be taken </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>date_to</td>
+
       <td> date_to </td>
      <td>Окончание периода</td>
+
       <td> End of Period </td>
      <td>строка вида "YYYY-MM-DD", не обязательный параметр, в случае отсутствия будет взята текущая дата</td>
+
       <td> a string of the form "YYYY-MM-DD" is an optional parameter; if absent, the current date will be taken </td>
  </tr>      
+
   </tr>
 
</table>
 
</table>
<b>Максимальный период выгрузки 1 месяц</b><br/>
+
<b> Maximum unloading period 1 month </b> <br/>
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
  <ul type="disc">
+
  <ul type = "disc">
      <li><b>blockviews</b> — К-во просмотров блоков</li>
+
       <li> <b> blockviews </b> - Block Views </li>
      <li><b>moneyin</b> — Заработано денег</li>
+
       <li> <b> moneyin </b> - Earned money </li>
 
</ul>
 
</ul>
Возвращает данные в виде
+
Returns data as
<code>
+
<code>
 
<pre>
 
<pre>
 
Array
 
Array
 
(
 
(
    [responce] => Array
+
    [responce] => Array
        (
+
        (
            [2017-11-10] => Array
+
            [2017-11-10] => Array
                (
+
                (
                    [blockviews] => 300
+
                    [blockviews] => 300
                    [moneyin] => 100.00
+
                    [moneyin] => 100.00
                )
+
                )
  
        )
+
        )
  
 
)
 
)
 
</pre>
 
</pre>
</code>
+
</code>
  
==Перевода денег для дочерних аккаунтов агенства==
+
== Money transfer for subsidiary accounts of the agency ==
Для перевода денег используется метод <b>ads.clients.balance.update</b><br/>
+
To transfer money, use the <b> ads.clients.balance.update method </b> <br/>
  
 
<table>
 
<table>
  <tr bgcolor = #DCDCDC>
+
   <tr bgcolor = #DCDCDC>
      <th width = 130 align = left>Параметры</th>
+
       <th width = 130 align = left> Parameters </th>
      <th width = 300 align = left>Значение</th>
+
       <th width = 300 align = left> Value </th>
      <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left> Additional attributes </th>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>client_id</td>
+
       <td> client_id </td>
      <td>Идентификатор клиента, ему будут перечислены деньги.</td>
+
       <td> Customer ID, money will be transferred to it. </td>
      <td>Обязательное</td>
+
       <td> Required </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>sum</td>
+
       <td> sum </td>
      <td>сумма перевода</td>
+
       <td> transfer amount </td>
      <td>Обязательное</td>
+
       <td> Required </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>type</td>
+
       <td> type </td>
      <td>Тип операции</td>
+
       <td> Operation Type </td>
      <td>Обязательное - всегда type = "transfer"</td>
+
       <td> Required - always type = "transfer" </td>
  </tr>      
+
   </tr>
 
<tr bgcolor = #F5F5F5>
 
<tr bgcolor = #F5F5F5>
      <td>comment</td>
+
       <td> comment </td>
      <td>Комментарий</td>
+
       <td> Comment </td>
      <td>Обязательное - допускается пустое значение</td>
+
       <td> Required - null value allowed </td>
  </tr>      
+
   </tr>
 
</table>
 
</table>
<b>Операцию можно совершать только при наличии достаточного кол-ва средств на аккаунте</b><br/>
+
<b> The operation can be performed only if there are sufficient funds on the account </b> <br/>
<b>Деньни будут сняты у поьзователя указанного в app_id </b><br/>
+
<b> Money will be withdrawn from the user specified in the app_id </b> <br/>
<b>Результат:</b><br/>
+
<b> Result: </b> <br/>
Результатом операции будет списание средств с основного пользователя - транзакция вывода. И перевод денег на аккаунт агенства - транзакция ввода.  
+
The result of the operation will be the withdrawal of funds from the primary user - an output transaction. And the transfer of money to the agency account is an input transaction.
  
Возвращает данные в виде
+
Returns data as
<code>
+
<code>
 
<pre>
 
<pre>
 
Array
 
Array
 
(
 
(
    [status] => "success"
+
    [status] => "success"
  
 
)
 
)
 
</pre>
 
</pre>
В случае ошибки - код ошибки
+
In case of error - error code
</code>
+
</code>

Latest revision as of 12:23, 24 July 2023

Contents

PHP SDK

Install from github: https://github.com/kadam-official/php-sdk
Install from composer:

       composer require kadam/php-sdk

API authorization with a Bearer Token

To authorize in the system via API with Bearer Token you need to add to your request the "Authorization" header with "Bearer X" value where "X" is your personal token. You can get the token by asking your manager. The lifetime of token is not limited. You can change your token in the settings of your personal account.

API authorization with a signature

To access the API, you will need a user ID (app_id) and a signature (signature). Calling different methods is carried out using queries on this template:

        api.kadam.net?%action%.%method%?%params%
        % action% - what are we turning to
        % method% - type of treatment
get - get
put - write
post - update
delete - delete
        % params% - request parameters

        required parameters% params%

        app_id - user id
        signature - signature

Example:

       [GET] http://api.kadam.net/campaigns.get?app_id=%app_id%&signature=%signature%

or

       [GET] http://api.kadam.net/campaigns?app_id=%app_id%&signature=%signature%
       [GET] - http access method

Signature (signature) is created using a temporary token (access_token), which can be obtained using the app_id and secret key parameters.
Parameters app_id (user ID) and the key "secret key" are available on request to support.
Getting a token:

       [GET] http://api.kadam.net/auth.token?app_id=%app_id%&secret_key=%key%
       -> {“access_token”: “...”}

Generating signature for the [GET] method:

       md5 ( %sort_params% . %access_token% )
       %sort_params% - all parameters passed (except signature) are sorted by name

Example:

       app_id=1&campaign_id=3…
       [PUT] http://api.kadam.net/campaigns?signature=%signature%
       +post fields -> %params%

Example for php. Getting a list of campaigns:

       <?
        $your_secret_key = "jqhwekq8734quo37o498q3p498qp34";
       $your_app_id = 1;
       $auth_url = "http://api.kadam.net/auth.token?app_id={$your_app_id}&secret_key={$your_secret_key}";
       $auth = file_get_contents($auth_url);
       $auth = json_decode($auth, true);

       if ( !is_array( $auth ) || !isset( $auth['access_token'] ) ) {
           die( 'something wrong! ' . print_r( $res, true ) );
       }

       $token    = $auth['access_token'];
       $params = array(
	    'client_id' => $your_app_id,
        'app_id' => $your_app_id,
       );

       ksort( $params );

       $result = array ();
       foreach( $params as $key => $value ) {
           $result[] = $key . '=' . urlencode( $value );
       }
       $params = implode( '&', $result );
       $signature = md5( $params . $token );

       $campaign_url = 'http://api.kadam.net/ads.campaigns.get?' . $params . '&signature=' . $signature;

       $campaigns = file_get_contents($campaign_url);
       $campaigns = json_decode($campaigns, true);

       if ( !is_array( $campaigns ) || !isset( $campaigns['response'] ) ) {
           die( 'something wrong! ' . print_r( $campaigns, true ) );
       }
       
       print_r($campaigns);
       

Campaign Statistics

To get campaign statistics, use the method ads.stats.campaign.get

                                                                                       
Parameters Values Optional attributes
campaigns One or some campaign's id int (numeric value), required parameter
group Group by:

date - by dates

campaign - by campaigns

string, listed with a comma, required parameter
date_from The starting date of the statistics to display. Different date formats are used for different parameter period values:

day: YYYY-MM-DD, example: 2011-09-27;

month: YYYY-MM, example: 2011-09

required parameter, string
date_to The final date of the displayed statistics. Different date formats are used for different parameter period values:

day: YYYY-MM-DD, example: 2011-09-27;

month: YYYY-MM, example: 2011-09

required parameter, string
sort One or some parameters for sorting data, listed with a comma. optional parameter
limit Number of rows returned optional parameter, int (numeric value)
offset Offset on returned rows (use with limit parameter) optional parameter, int (numeric value)

Result:
Returns an object with data

{
   "response":{
      "count": %number rows returned%,
      "items":[
         {
            “date” // date; if group by date
            "id" // id campaign; if group by campaign
            "views"
            "clicks"
            "conversions"
            "rejections"
            "holds"
            "moneyOut" // spent
            "moneyIn" // income
            "ctr" 
            "cpm"
            "cpc"
         }
      ]
   }
}

Sorting

Sort Ascending

sort = {parameter}
Example: api.kadam.net?sort=views

Sort descending

sort = - {parameter}
Example: api.kadam.net?sort=-views

Sort by several parameters

sort = {parameter1}, - {parameter2}, {parameter3}
Example: api.kadam.net?sort=views,-clicks,leads


Statistics on sites in the advertiser's account

Statistics on sites in the advertiser's account references statistics on views and clicks on the site in the context of each campaign.
To get statistics on sites, use the ads.stats.campaign.placement.get method (GET request)

                                                                                                                                                                                                                                                       
Parameters Value Additional attributes
campaigns One or some id campaigns, listed with a comma string; mandatory parameter
date_from Start date of the statistics output. string, mandatory parameter, format YYYY-MM-DD (example: 2017-05-15), filter parameter
date_to The end date of the statistics output. string, mandatory parameter, format YYYY-MM-DD (example: 2017-05-15), filter parameter
sort One or some parameters for sorting data, listed with a comma. optional parameter
limit Number of rows returned optional parameter, int (numeric value)
offset Offset on returned rows (use with limit parameter) optional parameter, int (numeric value)
signature Signature (generated using a time token, see above) required parameter, string
app_id user id required parameter, int (numeric value)

Result:
Returns an object with data, example:

{
   "response":{
      "count": %количество возвращаемых элементов%,
      "items":[
         {
            "id" // id campaign
            "placement" // id placement
            "views"
            "clicks"
            "conversions"
            "rejections"
            "holds"
            "moneyOut"
            "moneyIn"
            "ctr"
            "cpm"
            "cpc"
            "prelandvisit"
            "prelanduseful"
            "prelandscroll"
            "landvisit"
            "landuseful"
            "landscroll"
            "blackList"
            "multiplier" // stake multiplier
         }
      ]
   }
}

Sorting

Sort Ascending

sort = {parameter}
Example: api.kadam.net?sort=views

Sort descending

sort = - {parameter}
Example: api.kadam.net?sort=-views

Sort by several parameters

sort = {parameter1}, - {parameter2}, {parameter3}
Example: api.kadam.net?sort=views,-clicks,leads

Filtration

{parameter} = {value}
Examples:
api.kadam.net?attr=10
api.kadam.net?attr=string
api.kadam.net?attr=string&date_from=01.05.2016&date_to=01.07.2016

Change the multiplier for statistics on sites in the advertiser's account

To change the multiplier for site statistics, use the ads.stats.campaign.placement.put method (GET request). Bearer-token authorization required. Parameters (all are required):

  • app_id - user id, numeric value (int)
  • campaign_id - campaign id, numeric value (int)
  • multiplier - new multiplier value, numeric value (float)
  • placement - place id, numeric value (int)

The block and macros parameters in the account are not displayed, they can be obtained through the method described in the paragraph "Statistics by sites in the advertiser's account".

Statistics on all campaign materials

To get statistics on all campaign materials, use the ads.stats.creative.get method

                                                                                                                                                                                       
Parameters Value Additional attributes
campaigns One or some id campaigns, listed with a comma string; mandatory parameter if not set creatives
creatives One or some id creatives, listed with a comma string; mandatory parameter if not set campaigns
group Group by:

date - by dates

creative - by creatives

string, listed with a comma, required parameter
date_from The starting date of the displayed statistics. Different date formats are used for different values ​​of the period parameter:            

1. day: YYYY-MM-DD, Example: 2011-09-27

           

2. month: YYYY-MM, example: 2011-09

       
required parameter, string
date_to End date of output statistics. Different date formats are used for different values ​​of the period parameter:            

1. day: YYYY-MM-DD, Example: 2011-09-27

           

2. month: YYYY-MM, example: 2011-09

       
required parameter, string
sort One or some parameters for sorting data, listed with a comma. optional parameter
limit Number of rows returned optional parameter, int (numeric value)
offset Offset on returned rows (use with limit parameter) optional parameter, int (numeric value)

Result:
Returns an object with data

{
   "response":{
      "count": %количество возвращаемых элементов%,
      "items":[
         {
            "date" // date; returned if group by dates
            "id" // id creative; returned if group by creatives
            "views"
            "clicks"
            "conversions"
            "rejections",
            "holds"
            "moneyOut" // spent
            "moneyIn" // income
            "ctr"
            "cpm"
            "cpc"
         }
      ]
   }
}

Material statistics

For statistics on the material, use the method ads.analytic.material.get

                                                                                                                                                               
Parameters Value Additional attributes
material_id material id int (numeric value), required parameter
period Method for grouping data by date:            

1. day - statistics by day;

           

2. month - statistics by months;

           

Temporary restrictions are set by date_from and date_to parameters

       
required parameter, string
date_from The starting date of the displayed statistics. Different date formats are used for different values ​​of the period parameter:            

1. day: YYYY-MM-DD, Example: 2011-09-27

           

2. month: YYYY-MM, example: 2011-09

       
required parameter, string
date_to End date of output statistics. Different date formats are used for different values ​​of the period parameter:            

1. day: YYYY-MM-DD, Example: 2011-09-27

           

2. month: YYYY-MM, example: 2011-09

       
required parameter, string

Result:
Returns an object with data

{
response: {
count:% total items%
items: {
date
shows
clicks
ctr
cpm
money
                       }
                  }
}

Creating an advertising campaign

To create a new advertising campaign, use the ads.campaigns.put
method Fifty (50) campaigns can be created with a single request.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
Parameters Value Additional attributes
data </​​td>         a serialized JSON array of objects describing the campaigns being created. See the client_specification object description below. required parameter, string
client_specification
app_id user id required parameter, int (numeric value)
client_id id of the client in whose advertising account the campaign will be created. It can also take the value app_id (itself)         required parameter, int (numeric value)
ad_format Ad Format:            

10 - Teaser;

           

20 - Banner;

           

30 - Push Notifications;

           

40 - Clickunder;

           

60 - Contextual

       
required parameter, int (numeric value)
cost_type Payment method:            

0 - CPC;

           

1 - CPA;

           

2 - CPM

       
required parameter, int (numeric value)
name campaign name         required parameter, string
Link_url link to the advertised object in the format: http: //yoursite.cоm         required parameter, string
pushType Push type:

1 - On-site Push;

2 - Classic;

4 - In-app push;

int (numeric value)

example: "pushType: 1,2,4"

real_url link to the real domain of the advertised object in the format: http: //yoursite.cоm         required parameter, string
sex Gender:            

3 - any;

           

2 - male;

           

1 - female

       
required parameter, int (numeric value)
age The age of the target audience. Age category number from 1 to 6 (up to 17, 18-25, 26-34, 35-49, 50-60, over 61) required parameter, a sequence of numbers separated by a comma
countryTarget

Countries id:

/ads.targeting.countries.get

required parameter

array [country_id => [ bid => 0.1, leadCost => 0.2 ] ]

regionTarget

ID regions:

/ads.targeting.regions.get

required parameter, a sequence of numbers separated by a comma
cityTarget

ID cities:

/ads.targeting.cities.get

required parameter, a sequence of numbers separated by a comma

cpa_mode Type of conversion notifications for CPA: /ads.targeting.modes.get int (numeric value), mandatory for CPA campaigns
categories

category IDs:

           

/data.categories.get?ad_format =%

           

       
required parameter, a sequence of numbers separated by a comma
tags keyword targeting

required parameter, a sequence of keywords separated by a comma: [“key1”, “key2”, .., “keyN”]

           

Keywords with price. Only for payment - for clicks or for views: {“key1”: “cost”, “key2”: “cost”, .., “keyN”: “cost”}

           

cost - float

           

example: "data [tags] [qwerty]: 1" is the qwerty keyword with a 1rub rate.

       
day_limit Daily limit in rubles. For all types except clickunder positive number
all_limit Total limit in rubles. For all types except clickunder positive number
click_limit Maximum count. transitions per day. For all types except clickunder. For views and clicks. positive number
conversion_limit Maximum count. conversions per day. For all types except clickunder. Only for CPA positive number
adult_content presence of adult content in the advertising campaign:            

0 - No;

           

1 - Yes

       
optional parameter, int (numeric value), default 0
adult_site Display campaign ads on adult content sites:            

0 - No;

           

1 - Yes

       
optional parameter, int (numeric value), default 0
time_show Time Targeting:            

& nbsp; & nbsp; * - display in any hours and days of the week

           

& nbsp; & nbsp; {} is an array, where the key is the name of the day of the week ["Sn", "Mn", "Tu", "Wd", "Th", "Fr", "Sa"]:

           

& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; {} - ‘mn’: ‘*’ - all watches are weekly

           

& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; {} - ‘mn’: [0, .., 23] - hours, separated by commas

       
optional parameter, * default
platforms platform targeting: /data.platforms comma separated numbers
browsers browser targeting: /data.browsers comma separated numbers
black_list black list of sites where ads will not be shown comma separated site ID number sequence
white_list white list of sites where ads will not be shown comma separated site ID number sequence
black_list_ip ip lock sequence of ip addresses separated by a comma or an array
unique_day_count frequency of material shown to one user (times) positive number
unique_days frequency of advertising material shown to one user (days) positive number
deviceTarget

ID devices:

/ads.targeting.devices.get

sequence of numbers separated by a comma

langTarget

ID browser languages:

/ads.targeting.langs.get

sequence of numbers separated by a comma

Result:
Returns an array of responses to queries in the data array. The corresponding object in the output array contains the id of the created campaign, and the error_code and error_desc fields in case of an error.

Errors:

 102 - unknown client
   103 - overlimit campaigns 

Editing ad campaigns

To edit ad campaigns, use the ads.campaigns.update
method The maximum number of campaigns edited with a single query is 50.
Version log: 1.0.1 - added status parameter

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
Parameters Value Additional attributes
data </​​td>         is a serialized JSON array of objects describing changes in campaigns. Object descriptions client_mod_specification see below. required parameter, string
client_specification
campaign_id id of the edited campaign         required parameter, positive number
name campaign name optional parameter, a string between 3 and 60 characters
link_url link to the advertised object in the format http: //yoursite.com optional parameter, string
real_url link to the real domain of the advertised object in the format: http: //yoursite.cоm         optional parameter, string
sex Gender:            

3 - any;

           

2 - male;

           

1 - female

       
optional parameter, int (numeric value)
age age: /data.ages optional parameter, int (numeric value)
countryTarget

Countries id:

/ads.targeting.countries.get

required parameter

array [country_id => [ bid => 0.1, leadCost => 0.2 ] ]

regionTarget

ID regions:

/ads.targeting.regions.get

required parameter, a sequence of numbers separated by a comma
cityTarget

ID cities:

/ads.targeting.cities.get

required parameter, a sequence of numbers separated by a comma

categories category IDs:            

/data.categories.get?ad_format =%

           

category_id: {region_id: cost}

       
optional parameter
tags keyword targeting optional parameter, comma separated keyword sequence
day_limit daily limit in rubles. for all types except clickunder optional parameter, positive number
adult_content presence of adult content in the advertising campaign:            

0 - No;

           

1 - Yes

       
optional parameter, int (numeric value), default 0
adult_site display campaign ads on adult content sites:            

0 - No;

           

1 - Yes

       
optional parameter, int (numeric value), default 0
time_show Time Targeting:            

& nbsp; & nbsp; * - display in any hours and days of the week

           

& nbsp; & nbsp; {} is an array, where the key is the name of the day of the week ["Sn", "Mn", "Tu", "Wd", "Th", "Fr", "Sa"]:

           

& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; {} - ‘mn’: ‘*’ - all watches are weekly

           

& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; {} - ‘mn’: [0, .., 23] - hours, separated by commas

       
optional parameter, * default
platforms platform targeting: /data.platforms comma separated numbers
browsers browser targeting: /data.browsers comma separated numbers
black_list black list of sites where ads will not be shown comma separated site ID number sequence
white_list white list of sites where ads will not be shown comma separated site ID number sequence
black_list_ip ip lock sequence of ip addresses separated by a comma or an array
status start /pause campaign:            

0 - suspended;

           

1 - running

       
optional parameter, int (numeric value), default 1
deviceTarget

ID devices:

/ads.targeting.devices.get

sequence of numbers separated by a comma

langTarget

ID browser languages:

/ads.targeting.langs.get

sequence of numbers separated by a comma

Result:
Returns an array of responses to each request in the data array. The corresponding object in the output array contains the id of the client being changed and, in case of an error, the error_code and error_desc fields.

Errors:

 100 - unknown campaign
    102 - unknown client 

List of campaign advertising campaign

To get a list of campaign advertising campaigns use the method ads.campaigns.get

                                                                                                                                                                                                                                                               
Parameters Value Additional attributes
client_id Client ID from which ad campaigns are requested int (numeric value)
include_archive A flag that specifies whether to display archived ads:            

0 - show only active campaigns;

           

1 - show all campaigns

       
Flag, can be 1 or 0
campaign_ids Filter for displayed ad campaigns.            

Serialized JSON array containing campaign id. Only campaigns that are present in the campaign_ids and are campaigns of the specified advertising cabinet will be displayed. If the parameter is null, then all campaigns will be displayed.

       
String
with_bwlist Black and white list transfer flag any value (for example 1)
with_tags Keyword Transfer Flag any value (for example 1)
limit limit on the number of campaigns returned. Used only if the campaign_ids parameter is null int (numeric value)
offset offset. Used in the same cases as the limit parameter int (numeric value)

Result:
Returns an array of campaign objects, each of which contains the following fields:

response: {
       count:% total%
       items: [{
id - campaign identifier
name - campaign name
status - campaign status (0 - campaign stopped, 1 - campaign started, 2 - campaign deleted)
day_limit - campaign daily limit in rubles (0 - no limit is set)
all_limit - total campaign limit in rubles (0 - no limit is set)
ad_format - ad format
cost_type - payment type
link_url - link to the advertised object
sex
age - age
regions - region identifiers
categories - category identifiers.
adult_content - the presence of adult content
adult_site - display campaign ads on adult content sites
           tags - keywords
           bw_list - black and white list
      }, ..]
}

Errors:

 102 - unknown client 

Archiving an advertising campaign

To archive an existing advertising campaign, use the ads.campaigns.delete
method Ten (10) campaigns can be archived with a single request.

                                                               
Parameters Value Additional attributes
ids Campaign id list separated by comma or array with id campaigns.           

For example:

          

“id1, id2, ..., idn“ or [id1, id2, ..., idn]

       
required parameter, string

Result:
Returns an array of responses to each request. Each answer is either 0, which means successful deletion, or an error array.

Errors:

 100 - unknown campaign
   101 - campaign already archive
   102 - unknown client 

Receiving codes for CPA campaigns

Use the ads.campaigns.cpa.mode.get
method to get the codes for the CPA campaigns

                                                               
Parameters Value Additional attributes
campaign_id campaign id int (numeric value), required parameter

Result:
Returns an object with data.

{
response: {
url:% url%
                  }
}

Getting a list of categories for a given filter

To return the list of categories for a given filter, use the ads.campaigns.categories.get
method

                                                                                               
Parameters Value Additional attributes
ad_format ad format:             

ads.campaigns.formats.get

       
required parameter, int (numeric value)
category_id category id. limits displaying only by category id optional parameter, int (numeric value)

Result:
Returns an array of responses to queries in the response array.

response: {
            count:% total%
            items: [{
                       % category_id%: {
                            % region_id%: {
min:% min_cost%
max:% max_cost%
                             }
                       }
                  }, ..]
}

Getting the list of ad formats

Use the ads.campaigns.formats.get
method to get the list of ad formats.

Result:
Returns an array of responses to queries in the response array.

response: {
       count:% total%
       items: [{
             id:% format_id%
             title: ‘% format title%’
       }, ..]
}

Getting the list of platforms

For a list of platforms, use the ads.targeting.platforms.get
method

Result:
Returns an array of responses to queries in the response array.

response: {
       count:%
       items: [{
           id:% platform_id%
           title:% platform_name%,
           mobile:% is mobile%
       }, ..]
}

Getting Browser List

For a list of browsers, use the ads.targeting.browsers.get
method

Result:
Returns an array of responses to queries in the response array.

response: {
       count:%
       items: [{
           id:% browser_id%,
           title:% browser_name%,
       }, ..]
}

Getting a list of conversion notifications for the CPA

To get a list of conversion notifications for CPA, use the ads.targeting.cpa.modes.get
method

Result:
Returns an array of responses to queries in the response array.

response: {
       count:% total%
       items: [{
           id:% mode_id%
           title: ‘% mode title%’
       }, ..]
}

Getting a list of ages

To get the list of views, use the ads.targeting.ages.get
method

Result:
Returns an array of responses to queries in the response array.

response: {
       count:%
       items: [{
           id:% age_id%
           title:% age_name%
       }, ..]
}

Getting a list of countries

To get the list of countries, use the ads.targeting.countries.get method
Result:
Returns an array of responses to queries in the response array.

response: {
       count: %total%,
       items: [{
             id: %format_id%,
             title: ‘%format title%’
       },..]
}

Getting a list of regions

To get the list of regions, use the ads.targeting.regions.get method
Result:
Returns an array of responses to queries in the response array.

response: {
       count: %total%,
       items: [{
             id: %format_id%,
             title: ‘%format title%’
       },..]
}

Getting a list of cities

To get the list of cities, use the ads.targeting.cities.get method
Result:
Returns an array of responses to queries in the response array.

response: {
       count: %total%,
       items: [{
             id: %format_id%,
             title: ‘%format title%’
       },..]
}

Getting a list of devices

To get the list of devices, use the ads.targeting.devices.get method
Result:
Returns an array of responses to queries in the response array.

response: {
       count: %total%,
       items: [{
             id: %format_id%,
             title: ‘%format title%’
       },..]
}

Getting a list of browser languages

To get the list of devices, use the browser languages ads.targeting.langs.get method
Result:
Returns an array of responses to queries in the response array.

response: {
       count: %total%,
       items: [{
             id: %format_id%,
             title: ‘%format title%’
       },..]
}

Creating advertising agency clients

To create ad agency clients, use the ads.clients.put method
The allowable number of clients created with a single request is 50.

                                                                                                                                       
Parameters Value Additional attributes
data </​​td>         a serialized JSON array of objects describing the campaigns being created. See the client_specification object description below. required parameter, string
client_specification
name client name string from 3 to 60 characters, required parameter
day_limit daily limit in rubles int (numeric value)

Result:
Returns an array of responses to queries in the data array. The corresponding object in the output array contains the client information or the error array in case of an error (for each client separately).

{
    client_id - client identifier;
    name - the name of the client;
    day_limit - client's daily limit in rubles;
}

Editing advertising agency clients

To edit ad agency clients, use the ads.clients.update method
The maximum number of clients edited with a single query is 50.

                                                                                                                                                                       
Parameters Value Additional attributes
data </​​td>         is a serialized JSON array of objects describing changes in clients. Description of client_mod_specification objects see below. required parameter, string
client_mod_specification
client_id ID of the client being edited required parameter, positive number
name client name a string between 3 and 60 characters
day_limit daily limit in rubles positive number

Result:
Returns an array of responses to each request in the data array. The corresponding object in the output array contains the id of the client being changed and, in case of an error, the error_code and error_desc fields.

Getting a list of advertising agency clients

To return the list of clients of an advertising agency, use the ads.clients.get method

                                                               
Parameters Value Additional attributes
client_ids A list of client ids separated by commas. For example: “id1, id2, ..., idn“ optional parameter, string

Result:
Returns an array of client objects of the agency, each of which contains the following fields:

response: {
      count:% total%
      items: [{
           client_id - client identifier;
           name - the name of the client;
           day_limit - client's daily limit in rubles;
           balance - client's balance
      }, ..]
}

Archiving advertising agency clients

For archiving ad agency clients, use the ads.clients.delete method

                                                               
Parameters Value Additional attributes
ids List of clients' id by comma or array with id clients.             

For example: “id1, id2, ..., idn“ or [id1, id2, ..., idn]

      
required parameter, string

Result:
Returns an array of responses to each request. Each answer is either 0, which means successful deletion, or an error array.

Tying a client to an advertising agency

To bind a client to an advertising agency, use the ads.clients.bind.put method

                                                                                               
Parameters Value Additional attributes
email client email address string from 3 to 60 characters, required parameter
password client password (from account) string from 3 to 60 characters, required parameter

Result:
Returns:

{
“Bind”: true
}

in case of success. Or error in case of an error.

Detaching a client from an advertising agency

To detach a client from an advertising agency, use the ads.clients.unbind.put method

                                                               
Parameters Value Additional attributes
client_id client id int (numeric value)

Result:
Returns:

{
“Unbind”: true
}

in case of success. Or error in case of an error.

Customer account replenishment

To replenish the client’s account, use the ads.clients.balance.put method

                                                                                                                                                               
Parameters Value Additional attributes
client_id customer id to replenish int (numeric value), required parameter
sum rubles in rubles int (numeric value)
back_url url where the recharge system forwards the client string (string)
system_id replenishment system id:              

data.balance.systems.get

       
int (numeric value), required parameter

Result:
Returns the url for payment:

{
response: {
url:% url%
                  }
}

Creating advertisements

To create ads using the method ads.materials.put
The maximum allowable number of ads generated by a single request is 20.

                                                                                                                                                                                                                                                                                               
Parameters Value Additional attributes
data </​​td>         is a serialized JSON array of objects describing the created ads. The description of ad_specification objects is given below. required parameter, string
ad_specification
campaign_id id of the campaign in which the ad will be created required parameter, int (numeric value)
title ad title required parameter
text ad description Required
link_url link of the advertised object in the format: http://yoursite.com/
link_media previously loaded media object (jpg, gif):               

data.upload.media

       
pause_after_moderate pause posting moderation
size for banners only:               

ads.materials.banner.sizes

       
categories Stacks by category, similar to campaigns:          

array [category_id => cost]

       
Not required if you do not set bids from campaign categories

Update ad data

Use the ads.materials.update
method to update ad data. The maximum allowable number of ads generated by a single request is 20.

                                                                                                                                       
Parameters Value Additional attributes
data </​​td>         is a serialized JSON array of objects describing the created ads. The ad_specification object description is below. required parameter, string
ad_specification
material_id ad id required parameter, int (numeric value)
status start /pause material:            

0 - suspended;

           

1 - running

       
optional parameter, int (numeric value), default 1
bids Geo bids:

array "bids":{"countryID":{"bid":cost}}

coutries ID list - /ads.targeting.countries.get

optional parameter
link_url link of the advertised object in the format: http://yoursite.com/ optional parameter

Archiving advertisements

For advertising ads using the method ads.materials.delete
The maximum number of clients edited with a single query is 50.

                                                                                               
Parameters Value Additional attributes
account_id advertising account ID required parameter, int (numeric value)
ids serialized JSON array containing ad IDs required parameter, string

Result:
Returns an array of responses to each request. Each answer is either 0, which means successful deletion, or an error array.

Getting a list of advertisements

Use the ads.materials.get method to get the list of ads.

                                                                                                                                                                                                                                                                                               
Parameters Value Additional attributes
account_id advertising account ID required parameter, int (numeric value)
client_id For advertising agencies. Client ID from which advertisements are requested. int (numeric value)
archive A flag that specifies whether to display archived ads:            

0 - display only active ads;

           

1 - display all ads

       
Flag, can be 1 or 0
campaign_ids ad campaign filter.              

Serialized JSON array containing campaign id. If the parameter is null, advertisements of all campaigns will be displayed.

       
string
material_ids ad campaign filter.              

Serialized JSON array containing ad id. If the parameter is null, all advertisements will be displayed.

       
string
limit limit on the number of ads returned. Used only if the ad_ids parameter is null, and the campaign_ids parameter contains the id of only one campaign.         int (numeric value)
offset offset. Used in the same cases as the limit parameter int (numeric value)
ad_format ad format: ads.campaigns.formats.get required parameter, int (numeric value)

Result:
Returns an array of ad objects, each of which contains the following fields:

  
           
  • id - ad id
  •        
  • name - the name of the ad
  •        
  • campaign_id - Campaign ID
  •        
  • link_url
  •        
  • arhive
  •        
  • ad_format - ad format
  •        
  • cost_type - payment type
  •        
  • all_limit - total ad limit in rubles
  •             
                             
    • 0 - no limit is set
    •             
           
  • status - ad status:
  •             
                             
    • 0 - ad stopped;
    •                        
    • 1 - the ad is running;
    •                        
    • 2 - ad deleted
    •             
           
  • approved - ad moderation status:
  •             
                             
    • 0 - the ad is awaiting moderation;
    •                        
    • 10 - Ad has been approved.
    •                        
    • 20 - ad disapproved
    •             
      

Getting a list of banner sizes

For a list of banner sizes, use the ads.materials.banner.sizes.get
method

Result:
Returns an array of responses to requests in the response array:

response: {
        count:% total%
        items: [{
             id:% banner_id%,
             title: ‘% banner title%’
        }, ..]
}

Getting the list of countries

To get the list of countries, use the data.geo.countries.get
method

Result:
Returns an array of responses to requests in the response array:

response: {
    count:%
    items: [{
        id:% country_id%,
        title:% country_name%
    }, ..]
}

Getting a list of regions for a given filter

To get a list of regions for a given filter, use the data.geo.regions.get
method

                                                               
Parameters Value Additional attributes
country_id country identifier obtained in the ads.geo.countries method positive number, required parameter

Result:
Returns an array of responses to requests in the response array:

response: {
        count:%
        items: [{
               id:% region_id%
               title:% region_name%
        }, ..]
}

Get a list of available payment systems

To get a list of available payment systems, use the data.balance.systems.get
method

Result:
Returns an array of responses to requests in the response array:

response: {
         count:% total%
         items: [{
                id:% pay_system_id%,
                title: pay% pay system title% ’
         }, ..]
}

Download media files

To upload media files (jpg, png, gif), use the data.upload.media.update
method

                                                                                       
Parameters Value Additional attributes
ad_format ad format: /ads.formats.get int (numeric value)
file CURLFile object or url or base64

Result:
Returns an array with a reference to the target object or error in case of an error.

response: {
        image: “% link%”
}

An example of sending a file using curl in php:

       $ token = ‘received token’;
       $ ad_format = объявления ad format ’;
       $ app_id = ‘your app id’;
       $ file = '@ /full path to file';
       $ finfo = finfo_open (FILEINFO_MIME_TYPE);
       $ finfo = finfo_file ($ finfo, $ link);
       $ cFile = new \ CURLFile ($ link, $ finfo, basename ($ link));
       $ post = array ('file' => $ cFile, 'ad_format' => $ ad_format, 'app_id' => $ app_id);
       $ ignoreParams = array ('file'); //file field is not involved in the construction of the signature
       ksort ($ post);
       $ result = array ();
       foreach ($ post as $ key => $ value) {
         if (false == in_array ($ key, $ ignoreParams)) {
$ result [] = $ key. '='. urlencode ($ value);
}
       }
       $ result = implode ('&', $ result);
       $ signature = md5 ($ result. $ token);
       $ target_url = 'http://api.kadam.net/data.upload.media?signature='. $ signature;
       $ ch = curl_init ();
       curl_setopt ($ ch, CURLOPT_URL, $ target_url);
       curl_setopt ($ ch, CURLOPT_POST, true);
       curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ post);
       curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1);
       $ result = curl_exec ($ ch); //server response

Get the current server time

To get the current server time in ISO 8601 format, use the server.time.get
method

Result:
Returns an array of responses to requests in the response array:

        {
            iso8601:% time%
        }

Statistics for Webmasters

For statistics on webmasters use the method webmaster.reports.report.get

                                                                                                                               
Parameters Value Additional attributes
secret Access key for webmasters (mandatory) Available on demand
date_from Start of Period a string of the form "YYYY-MM-DD" is an optional parameter; if absent, the current date will be taken
date_to End of Period a string of the form "YYYY-MM-DD" is an optional parameter; if absent, the current date will be taken

Maximum unloading period 1 month
Result:

  
           
  • blockviews - Block Views
  •        
  • moneyin - Earned money

Returns data as

Array
(
    [responce] => Array
        (
            [2017-11-10] => Array
                (
                    [blockviews] => 300
                    [moneyin] => 100.00
                )

        )

)

Money transfer for subsidiary accounts of the agency

To transfer money, use the ads.clients.balance.update method

                                                                                                                                                           
Parameters Value Additional attributes
client_id Customer ID, money will be transferred to it. Required
sum transfer amount Required
type Operation Type Required - always type = "transfer"
comment Comment Required - null value allowed

The operation can be performed only if there are sufficient funds on the account
Money will be withdrawn from the user specified in the app_id
Result:
The result of the operation will be the withdrawal of funds from the primary user - an output transaction. And the transfer of money to the agency account is an input transaction.

Returns data as

Array
(
    [status] => "success"

)

In case of error - error code