API/en — различия между версиями

Материал из Справочник сервиса Kadam.net
Перейти к: навигация, поиск
(Новая страница: «API setting»)
 
 
Строка 1: Строка 1:
 
<languages/>
 
<languages/>
==API авторизация==
+
== API authorization ==
Для доступа в API понадобятся ID пользователя (app_id) и подпись (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:
 
<code>
 
<code>
 
<pre>
 
<pre>
      api.kadam.net?%action%.%method%?%params%
+
        api.kadam.net?%action%.%method%?%params%
 
</pre>
 
</pre>
 
<pre>
 
<pre>
      %action% - к чему обращаемся
+
        % action% - what are we turning to
      %method% - тип обращения
+
        % method% - type of treatment
    get - получить
+
get - get
    put - записать
+
put - write
    post - обновить
+
post - update
    delete - удалить
+
delete - delete
      %params% - параметры запроса
+
        % params% - request parameters
      обязательные параметры %params%
+
 
      app_id - id пользователя
+
        required parameters% params%
      signature - подпись
+
 
 +
        app_id - user id
 +
        signature - signature
 
</pre>
 
</pre>
 
</code>
 
</code>
Пример:
+
Example:
 
<code>
 
<code>
 
<pre>
 
<pre>
Строка 26: Строка 29:
 
</pre>
 
</pre>
 
</code>
 
</code>
или
+
or
 
<code>
 
<code>
 
<pre>
 
<pre>
 
       [GET] http://api.kadam.net/campaigns?app_id=%app_id%&signature=%signature%
 
       [GET] http://api.kadam.net/campaigns?app_id=%app_id%&signature=%signature%
       [GET] - метод обращения по http
+
       [GET] - http access method
 
</pre>
 
</pre>
 
</code>
 
</code>
'''Подпись (signature)''' создается с помощью временного токена (access_token), который можно получить используя параметры app_id и secret key.
+
'''Signature (signature)''' is created using a temporary token (access_token), which can be obtained using the app_id and secret key parameters.
<br>Параметры app_id (ID пользователя) и ключ "secret key" можно получить по запросу в поддержку.
+
<br /> Parameters app_id (user ID) and the key "secret key" are available on request to support.
<br>Получение токена:
+
<br /> Getting a token:
 
<code>
 
<code>
 
<pre>
 
<pre>
Строка 42: Строка 45:
 
</pre>
 
</pre>
 
</code>
 
</code>
Формирование signature для метода [GET]:
+
Generating signature for the [GET] method:
 
<code>
 
<code>
 
<pre>
 
<pre>
 
       md5 ( %sort_params% . %access_token% )
 
       md5 ( %sort_params% . %access_token% )
       %sort_params% - все передаваемые параметры (кроме signature) сортируются по имени
+
       %sort_params% - all parameters passed (except signature) are sorted by name
 
</pre>
 
</pre>
 
</code>
 
</code>
Пример:
+
Example:
 
<code>
 
<code>
 
<pre>
 
<pre>
Строка 57: Строка 60:
 
</pre>
 
</pre>
 
</code>
 
</code>
Пример для php. Получение списка кампаний:
+
Example for php. Getting a list of campaigns:
 
<code>
 
<code>
 
<pre>
 
<pre>
Строка 66: Строка 69:
 
       $auth = file_get_contents($auth_url);
 
       $auth = file_get_contents($auth_url);
 
       $auth = json_decode($auth, true);
 
       $auth = json_decode($auth, true);
 +
 
       if ( !is_array( $auth ) || !isset( $auth['access_token'] ) ) {
 
       if ( !is_array( $auth ) || !isset( $auth['access_token'] ) ) {
 
           die( 'something wrong! ' . print_r( $res, true ) );
 
           die( 'something wrong! ' . print_r( $res, true ) );
 
       }
 
       }
 +
 
       $token    = $auth['access_token'];
 
       $token    = $auth['access_token'];
 
       $params = array(
 
       $params = array(
Строка 74: Строка 79:
 
         'app_id' => $your_app_id,
 
         'app_id' => $your_app_id,
 
       );
 
       );
 +
 
       ksort( $params );
 
       ksort( $params );
 +
 
       $result = array ();
 
       $result = array ();
 
       foreach( $params as $key => $value ) {
 
       foreach( $params as $key => $value ) {
Строка 81: Строка 88:
 
       $params = implode( '&', $result );
 
       $params = implode( '&', $result );
 
       $signature = md5( $params . $token );
 
       $signature = md5( $params . $token );
 +
 
       $campaign_url = 'http://api.kadam.net/ads.campaigns.get?' . $params . '&signature=' . $signature;
 
       $campaign_url = 'http://api.kadam.net/ads.campaigns.get?' . $params . '&signature=' . $signature;
 +
 
       $campaigns = file_get_contents($campaign_url);
 
       $campaigns = file_get_contents($campaign_url);
 
       $campaigns = json_decode($campaigns, true);
 
       $campaigns = json_decode($campaigns, true);
 +
 
       if ( !is_array( $campaigns ) || !isset( $campaigns['response'] ) ) {
 
       if ( !is_array( $campaigns ) || !isset( $campaigns['response'] ) ) {
 
           die( 'something wrong! ' . print_r( $campaigns, true ) );
 
           die( 'something wrong! ' . print_r( $campaigns, true ) );
 
       }
 
       }
 +
     
 
       print_r($campaigns);
 
       print_r($campaigns);
 +
     
 
</pre>
 
</pre>
 
</code>
 
</code>
==Статистика по кампании==
+
 
Для получения статистики по кампании используется метод <b>ads.analytic.campaign.get</b><br/>
+
== Campaign Statistics ==
 +
To get campaign statistics, use the method <b>ads.analytic.campaign.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>Values</th>
       <th width = 350 align = left>Дополнительные атрибуты</th>
+
       <th width = 350 align = left>Optional attributes</th>
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
 
       <td>campaign_id</td>
 
       <td>campaign_id</td>
       <td>id кампании</td>
+
       <td>campaign's id</td>
       <td>int (числовое значение), обязательный параметр</td>
+
       <td>int (numeric value), required parameter</td>
 
   </tr>
 
   </tr>
 
   <tr bgcolor = #F5F5F5>
 
   <tr bgcolor = #F5F5F5>
 
       <td>region_id</td>
 
       <td>region_id</td>
       <td>id региона: data.geo.regions.get</td>
+
       <td>region's id: data.geo.regions.get</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>The way data is grouped by date:  
           <p>day — статистика по дням;</p>
+
           <p>day — daily statistics;</p>
           <p>month - статистика по месяцам</p>
+
           <p>month - monthly statistics</p>
           <p>Временные ограничения задаются параметрами date_from и date_to</p>
+
           <p>Temporary restrictions are set by parameters date_from and date_to</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 statistics to display. Different date format is used for different parameter ''period'' values:  
           <p>day: YYYY-MM-DD, пример: 2011-09-27;</p>
+
           <p>day: YYYY-MM-DD, example: 2011-09-27;</p>
           <p>month: YYYY-MM, пример: 2011-09</p>
+
           <p>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>The final date of the displayed statistics. Different date format is used for different parameter ''period'' values:  
           <p>day: YYYY-MM-DD, пример: 2011-09-27;</p>
+
           <p>day: YYYY-MM-DD, example: 2011-09-27;</p>
           <p>month: YYYY-MM, пример: 2011-09</p>
+
           <p>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>
Строка 152: Строка 165:
 
</pre>
 
</pre>
 
</code>
 
</code>
==Статистика по площадкам в кабинете рекламодателя==
+
 
Под статистикой по площадкам в кабинете рекламодателя подразумевается статистика по показам и кликам на площадке в разрезе каждой кампании.
+
== Statistics on sites in the advertiser's account ==
<br>Для получения статистики по площадкам используется метод <b>ads.campaigns.statblock.get</b> (GET запрос)
+
Statistics on sites in the advertiser's account means statistics on views 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)
 
<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>date_from</td>
+
       <td> date_from </td>
      <td>Начальная дата выводимой статистики.</td>
+
       <td> Start date of the statistics output. </td>
      <td>строка, формат YYYY-MM-DD (пример: 2017-05-15), параметр фильтрации</td>
+
       <td> string, 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>Конечная дата выводимой статистики.</td>
+
       <td> The end date of the statistics output. </td>
      <td>строка, формат YYYY-MM-DD (пример: 2017-05-15), параметр фильтрации</td>
+
       <td> string, format YYYY-MM-DD (example: 2017-05-15), filter parameter </td>
  </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> required parameter, int (numeric value), filter parameter </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>signature</td>
+
       <td> signature </td>
      <td>Подпись (генерируется с помощью временного токена, см. выше)</td>
+
       <td> Signature (generated using a time token, see above) </td>
      <td>обязательный параметр, строка</td>
+
       <td> required parameter, string </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>app_id</td>
+
       <td> app_id </td>
      <td>id пользователя</td>
+
       <td> user id </td>
      <td>обязательный параметр, int (числовое значение)</td>
+
       <td> required parameter, int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>macros</td>
+
       <td> macros </td>
      <td>id площадки</td>
+
       <td> site id </td>
      <td>int (числовое значение), параметр сотировки, параметр фильтрации</td>
+
       <td> int (numeric value), write parameter, filter option </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>leads</td>
+
       <td> leads </td>
      <td>Лиды</td>
+
       <td> Leads</td>
      <td>int (числовое значение), параметр сотировки, параметр фильтрации</td>
+
       <td> int (numeric value), write parameter, filter option </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>views</td>
+
       <td> views </td>
      <td>Показы</td>
+
       <td> Views </td>
      <td>int (числовое значение), параметр сотировки, параметр фильтрации</td>
+
       <td> int (numeric value), write parameter, filter option </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>clicks</td>
+
       <td> clicks </td>
      <td>Клики</td>
+
       <td> Clicks </td>
      <td>int (числовое значение), параметр сотировки, параметр фильтрации</td>
+
       <td> int (numeric value), write parameter, filter option </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>conversions</td>
+
       <td> conversions </td>
      <td>Подтвердженные конверсии</td>
+
       <td> Confirmed Conversions </td>
      <td>int (числовое значение), параметр сотировки, параметр фильтрации</td>
+
       <td> int (numeric value), write parameter, filter option </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>rejections</td>
+
       <td> rejections </td>
      <td>Отказанные конверсии</td>
+
       <td> Failed Conversions </td>
      <td>int (числовое значение), параметр сотировки, параметр фильтрации</td>
+
       <td> int (numeric value), write parameter, filter option </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>ctr</td>
+
       <td> ctr </td>
      <td>CTR</td>
+
       <td> CTR </td>
      <td>int (числовое значение), параметр сотировки, параметр фильтрации</td>
+
       <td> int (numeric value), write parameter, filter option </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>cpm</td>
+
       <td> cpm </td>
      <td>CPM</td>
+
       <td> CPM </td>
      <td>int (числовое значение), параметр сотировки, параметр фильтрации</td>
+
       <td> int (numeric value), write parameter, filter option </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>cpc</td>
+
       <td> cpc </td>
      <td>CPC</td>
+
       <td> CPC </td>
      <td>int (числовое значение), параметр сотировки, параметр фильтрации</td>
+
       <td> int (numeric value), write parameter, filter option </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>prelandvisit</td>
+
       <td> prelandvisit </td>
      <td>Визиты преленда</td>
+
       <td> Pre-landing Visits </td>
      <td>int (числовое значение), параметр сотировки, параметр фильтрации</td>
+
       <td> int (numeric value), write parameter, filter option </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>prelanduseful</td>
+
       <td> prelanduseful </td>
      <td>Полезные визиты преленда</td>
+
       <td> Pre-landing Useful visits </td>
      <td>int (числовое значение), параметр сотировки, параметр фильтрации</td>
+
       <td> int (numeric value), write parameter, filter option </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>prelandscroll</td>
+
       <td> prelandscroll </td>
      <td>Скролл преленда</td>
+
       <td> Pre-landing Scroll </td>
      <td>int (числовое значение), параметр сотировки, параметр фильтрации</td>
+
       <td> int (numeric value), write parameter, filter option </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
<b>Результат:</b><br/>
+
<b> Result: </b> <br />
Возвращает объект с данными, пример:
+
Returns an object with data, example:
 
<code>
 
<code>
 
<pre>
 
<pre>
 
{
 
{
  "response": {
+
  "response": {
    "count": 1,
+
    "count": 1,
    "items": [
+
    "items": [
      {
+
      {
        "macros": "12345678901234",
+
        "macros": "12345678901234",
        "block": "1234",
+
        "block": "1234",
        "domain": "123456789",
+
        "domain": "123456789",
        "leads": "0",
+
        "leads": "0",
        "views": "123",
+
        "views": "123",
        "clicks": "0",
+
        "clicks": "0",
        "conversions": "0",
+
        "conversions": "0",
        "rejections": "0",
+
        "rejections": "0",
        "ctr": "0.0000",
+
        "ctr": "0.0000",
        "cpm": "0.00",
+
        "cpm": "0.00",
        "cpc": null,
+
        "cpc": null,
        "moneyOut": "0.000000",
+
        "moneyOut": "0.000000",
        "moneyIn": null,
+
        "moneyIn": null,
        "prelandvisit": "0",
+
        "prelandvisit": "0",
        "prelanduseful": "0",
+
        "prelanduseful": "0",
        "prelandscroll": "0",
+
        "prelandscroll": "0",
        "landvisit": "0",
+
        "landvisit": "0",
        "landuseful": "0",
+
        "landuseful": "0",
        "landscroll": "0",
+
        "landscroll": "0",
        "multiplier": null,
+
        "multiplier": null,
        "blackList": "0"
+
        "blackList": "0"
      }
+
      }
    ],
+
    ],
    "request": {
+
    "request": {
      "campaignId": 123456,
+
      "campaignId": 123456,
      "limit": 10,
+
      "limit": 10,
      "offset": 0
+
      "offset": 0
    }
+
    }
  }
+
  }
 
}
 
}
 
</pre>
 
</pre>
</code>
+
</code>
'''Сортировка'''
+
 
Сортировка по возрастанию
+
'''Sorting'''
<code><pre>
+
 
sort={параметр}
+
Sort Ascending
Пример: api.kadam.net?sort=views
+
<code> <pre>
</pre></code>
+
sort = {parameter}
Сортировка по убыванию
+
Example: api.kadam.net?sort=views
<code><pre>
+
</pre> </code>
sort=-{параметр}
+
 
Пример: api.kadam.net?sort=-views
+
Sort descending
</pre></code>
+
<code> <pre>
Сортировка по нескольким параметрам
+
sort = - {parameter}
<code><pre>
+
Example: api.kadam.net?sort=-views
sort={параметр1},-{параметр2},{параметр3}
+
</pre> </code>
Пример: api.kadam.net?sort=views,-clicks,leads
+
 
</pre></code>
+
Sort by several parameters
'''Фильтрация'''
+
<code> <pre>
<code><pre>
+
sort = {parameter1}, - {parameter2}, {parameter3}
{параметр}={значение}
+
Example: api.kadam.net?sort=views,-clicks,leads
Примеры:
+
</pre> </code>
 +
 
 +
'''Filtration'''
 +
<code> <pre>
 +
{parameter} = {value}
 +
Examples:
 
api.kadam.net?attr=10
 
api.kadam.net?attr=10
 
api.kadam.net?attr=string
 
api.kadam.net?attr=string
 
api.kadam.net?attr=string&date_from=01.05.2016&date_to=01.07.2016
 
api.kadam.net?attr=string&date_from=01.05.2016&date_to=01.07.2016
</pre></code>
+
</pre> </code>
==Изменение множителя для статистики по площадкам в кабинете рекламодателя==
+
 
Для изменения множителя для статистики по площадкам используется метод <b>ads.campaigns.statblock</b> (PUT запрос)
+
== Change the multiplier for statistics on sites in the advertiser's account ==
Параметры (все являются обязательными):
+
To change the multiplier for site statistics, use the <b> ads.campaigns.statblock </b> method (PUT request)
 +
 
 +
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> signature - signature, string (string) </li>
<li>campaign_id - id кампании, числовое значение (int)</li>
+
<li> campaign_id - campaign id, numeric value (int) </li>
<li>block - числовое значение (int)</li>
+
<li> block - a numeric value (int) </li>
<li>domain - числовое значение (int)</li>
+
<li> domain - numeric value (int) </li>
<li>multiplier - новое значение множителя, числовое значение (float)</li>
+
<li> multiplier - new multiplier value, numeric value (float) </li>
<li>multiplierOld - старое значение множителя, числовое значение (float)</li>
+
<li> multiplierOld - old multiplier value, numeric value (float) </li>
<li>macros - id площадки, числовое значение (int)</li>
+
<li> macros - pad id, numeric value (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".
Для получения статистики по всем материалам кампании используется метод <b>ads.analytic.materials.get</b><br/>
+
 
 +
== Statistics on all campaign materials ==
 +
To get statistics on all campaign materials, use the <b> ads.analytic.materials.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>
  <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>
  <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 format is 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 format is 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: {
teaser_id
+
teaser_id
date
+
date
shows
+
shows
clicks
+
clicks
ctr
+
ctr
cpm
+
cpm
money
+
money
                      }
+
                       }
                  }
+
                  }
 
}
 
}
 
</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 format is 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 format is 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
 +
The number of campaigns created with a single request is 50. <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>
 +
       <td> data </​​td>
 +
       <td> a serialized JSON array of objects describing the campaigns being created. See the client_specification object description below. </Td>
 +
       <td> required parameter, string </td>
 +
   </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>
 +
       <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>
 +
       <td> regions </td>
 +
       <td> Regions, from 1 to 10 (1 - Russia, 2 - Ukraine, etc.) </td>
 +
       <td> required parameter, a sequence of numbers separated by a comma </td>
 +
   </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> <p> array [category_id => cost] </p> </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>data</td>
+
       <td> adult_content </td>
      <td>сериализованный JSON-массив объектов, описывающих создаваемые кампании. Описание объектов client_specification см. ниже.</td>
+
       <td> presence of adult content in the advertising campaign:
      <td>обязательный параметр, строка</td>
+
           <p> 0 - No; </p>
  </tr>
+
           <p> 1 - Yes </p>
  <tr bgcolor = #F5F5F5>
+
       </td>
      <td>client_specification</td>
+
       <td> optional parameter, int (numeric value), default 0 </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>app_id</td>
+
       <td> adult_site </td>
      <td>id пользователя</td>
+
       <td> Display campaign ads on adult content sites:
      <td>обязательный параметр, int (числовое значение)</td>
+
           <p> 0 - No; </p>
  </tr>
+
           <p> 1 - Yes </p>
  <tr bgcolor = #F5F5F5>
+
       </td>
      <td>client_id</td>
+
       <td> optional parameter, int (numeric value), default 0 </td>
      <td>id клиента, в рекламном кабинете которого будет создаваться кампания. Так же может принимать значение app_id (самого себя)
+
   </tr>
      </td>
+
   <tr bgcolor = #F5F5F5>
      <td>обязательный параметр, int (числовое значение)</td>
+
       <td> time_show </td>
  </tr>
+
       <td> Time Targeting:
  <tr bgcolor = #F5F5F5>
+
           <p> & nbsp; & nbsp; * - display in any hours and days of the week </p>
      <td>ad_format</td>
+
           <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>
      <td>Формат объявления:
+
           <p> & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; {} - ‘mn’: ‘*’ - all watches are weekly </p>
          <p>10 - Тизерная;</p>
+
           <p> & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; {} - ‘mn’: [0, .., 23] - hours, separated by commas </p>
          <p>20 - Баннерная;</p>
+
       </td>
          <p>30 - Push-уведомления;</p>
+
       <td> optional parameter, * default </td>
          <p>40 - Clickunder;</p>
+
   </tr>
          <p>60 - Контекстная</p>
+
   <tr bgcolor = #F5F5F5>
      </td>
+
       <td> platforms </td>
      <td>обязательный параметр, int (числовое значение)</td>
+
       <td> platform targeting: /data.platforms </td>
  </tr>
+
       <td> comma separated numbers </td>
  <tr bgcolor = #F5F5F5>
+
   </tr>
      <td>cost_type</td>
+
   <tr bgcolor = #F5F5F5>
      <td>Способ оплаты:
+
       <td> browsers </td>
          <p>0 - СРС;</p>
+
       <td> browser targeting: /data.browsers </td>
          <p>1 - СРА;</p>
+
       <td> comma separated numbers </td>
          <p>2 - СРМ</p>
+
   </tr>
      </td>
+
   <tr bgcolor = #F5F5F5>
      <td>обязательный параметр, int (числовое значение)</td>
+
       <td> black_list </td>
  </tr>
+
       <td> black list of sites where ads will not be shown </td>
  <tr bgcolor = #F5F5F5>
+
       <td> comma separated site ID number sequence </td>
      <td>name</td>
+
   </tr>
      <td>название кампании
+
   <tr bgcolor = #F5F5F5>
      </td>
+
       <td> white_list </td>
      <td>обязательный параметр, строка</td>
+
       <td> white list of sites where ads will not be shown </td>
  </tr>
+
       <td> comma separated site ID number sequence </td>
  <tr bgcolor = #F5F5F5>
+
   </tr>
      <td>Link_url</td>
+
   <tr bgcolor = #F5F5F5>
      <td>ссылка на рекламируемый объект в формате: http://yoursite.cоm
+
       <td> black_list_ip </td>
      </td>
+
       <td> ip lock </td>
      <td>обязательный параметр, строка</td>
+
       <td> sequence of ip addresses separated by a comma or an array </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>real_url</td>
+
       <td> unique_day_count </td>
      <td>ссылка на реальный домен рекламируемого объекта в формате: http://yoursite.cоm
+
       <td> frequency of material shown to one user (times) </td>
      </td>
+
       <td> positive number </td>
      <td>обязательный параметр, строка</td>
+
   </tr>
  </tr>
+
   <tr bgcolor = #F5F5F5>
  <tr bgcolor = #F5F5F5>
+
       <td> unique_days </td>
      <td>sex</td>
+
       <td> frequency of advertising material shown to one user (days) </td>
      <td>Пол:
+
       <td> positive number </td>
          <p>3 - любой;</p>
+
   </tr>
          <p>2 - мужской;</p>
+
          <p>1 - женский</p>
+
      </td>
+
      <td>обязательный параметр, int (числовое значение)</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>age</td>
+
      <td>Возраст целевой аудитории. Номер возрастной категории от 1 до 6 (до 17, 18-25, 26-34, 35-49, 50-60, старше 61)</td>
+
      <td>обязательный параметр, последовательность чисел, разделенных запятой</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>regions</td>
+
      <td>Регионы, от 1 до 10 (1 - Россия, 2 - Украина и т.д.)</td>
+
      <td>обязательный параметр, последовательность чисел, разделенных запятой</td>
+
  </tr>
+
  <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><p>масив [category_id => cost]</p></td>
+
  </tr>
+
  <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>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>day_limit</td>
+
      <td>Дневной лимит в рублях. Для всех типов кроме clickunder</td>
+
      <td>положительное число</td>
+
  </tr>
+
  <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>необязательный параметр, int (числовое значение), по умолчанию 0</td>
+
  </tr>
+
  <tr bgcolor = #F5F5F5>
+
      <td>adult_site</td>
+
      <td>Отображать объявления кампании на сайтах с контентом для взрослых:  
+
          <p>0 - Нет;</p>
+
          <p>1 - Да</p>
+
      </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>
+
 
</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>
==Редактирование рекламных кампаний==
+
 
Для редактирования рекламных кампаний используется метод <b>ads.campaigns.update</b><br>
+
== Editing ad campaigns ==
Максимальное допустимое количество кампаний, редактируемых с помощью одного запроса — 50.<br>
+
To edit ad campaigns, use the <b> ads.campaigns.update </b> <br /> method
Version log: 1.0.1 - добавлен параметр status
+
The maximum number of campaigns edited with a single query is 50. <br />
 +
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>
+
   <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 campaigns. Object descriptions client_mod_specification see 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>campaign_id</td>
+
       <td> campaign_id </td>
      <td>id редактируемой кампании
+
       <td> id of the edited campaign
      </td>
+
       </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> campaign name </td>
      <td>необязательный параметр, строка длиной от 3 до 60 символов</td>
+
       <td> optional parameter, a string between 3 and 60 characters </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 to the advertised object in the format http: //yoursite.com </td>
      <td>необязательный параметр, строка</td>
+
       <td> optional parameter, string </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>real_url</td>
+
       <td> real_url </td>
      <td>ссылка на реальный домен рекламируемого объекта в формате: http://yoursite.cоm  
+
       <td> link to the real domain of the advertised object in the format: http: //yoursite.cоm
      </td>
+
       </td>
      <td>необязательный параметр, строка</td>
+
       <td> optional parameter, string </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>sex</td>
+
       <td> sex </td>
      <td>Пол:  
+
       <td> Gender:
          <p>3 - любой;</p>
+
           <p> 3 - any; </p>
          <p>2 - мужской;</p>
+
           <p> 2 - male; </p>
          <p>1 - женский</p>
+
           <p> 1 - female </p>
      </td>
+
       </td>
      <td>необязательный параметр, int (числовое значение)</td>
+
       <td> optional parameter, int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>age</td>
+
       <td> age </td>
      <td>возраст: /data.ages</td>
+
       <td> age: /data.ages </td>
      <td>необязательный параметр, int (числовое значение)</td>
+
       <td> optional parameter, int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>categories</td>
+
       <td> categories </td>
      <td>идентификаторы категорий:
+
       <td> category IDs:
          <p>/data.categories.get?ad_format=%</p>
+
           <p> /data.categories.get?ad_format =% </p>
          <p>category_id: {region_id: cost}</p>
+
           <p> category_id: {region_id: cost} </p>
      </td>
+
       </td>
      <td>необязательный параметр</td>
+
       <td> optional parameter </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>tags</td>
+
       <td> tags </td>
      <td>таргетинг по ключевым словам</td>
+
       <td> keyword targeting </td>
      <td>необязательный параметр, последовательность ключевых слов, разделенных запятой</td>
+
       <td> optional parameter, comma separated keyword sequence </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>day_limit</td>
+
       <td> day_limit </td>
      <td>дневной лимит в рублях. для всех типов кроме clickunder</td>
+
       <td> daily limit in rubles. for all types except clickunder </td>
      <td>необязательный параметр, положительное число</td>
+
       <td> optional parameter, positive number </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>adult_content</td>
+
       <td> adult_content </td>
      <td>присутсвие контента для взрослых в рекламной кампании:  
+
       <td> presence of adult content in the advertising campaign:
          <p>0 - Нет;</p>
+
           <p> 0 - No; </p>
          <p>1 - Да</p>
+
           <p> 1 - Yes </p>
      </td>
+
       </td>
      <td>необязательный параметр, int (числовое значение), по умолчанию 0</td>
+
       <td> optional parameter, int (numeric value), default 0 </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>adult_site</td>
+
       <td> adult_site </td>
      <td>отображать объявления кампании на сайтах с контентом для взрослых:  
+
       <td> display campaign ads on adult content sites:
          <p>0 - Нет;</p>
+
           <p> 0 - No; </p>
          <p>1 - Да</p>
+
           <p> 1 - Yes </p>
      </td>
+
       </td>
      <td>необязательный параметр, int (числовое значение), по умолчанию 0</td>
+
       <td> optional parameter, int (numeric value), default 0 </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>time_show</td>
+
       <td> time_show </td>
      <td>Временной таргетинг:  
+
       <td> Time Targeting:
          <p>&nbsp;&nbsp; * - отображение в любые часы и дни недели</p>
+
           <p> & nbsp; & nbsp; * - display in any hours and days of the week </p>
          <p>&nbsp;&nbsp; {} - массив, где ключ имя дня недели ["Sn","Mn","Tu","Wd","Th","Fr","Sa"]:</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’: ‘*’ - все часы понендельника</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] - часы через запятую</p>
+
           <p> & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; {} - ‘mn’: [0, .., 23] - hours, separated by commas </p>
      </td>
+
       </td>
      <td>необязательный параметр, * по умолчанию</td>
+
       <td> optional parameter, * default </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>platforms</td>
+
       <td> platforms </td>
      <td>таргетинг по платформам: /data.platforms</td>  
+
       <td> platform targeting: /data.platforms </td>
      <td>последовательность чисел, разделенных запятой</td>
+
       <td> comma separated numbers </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>browsers</td>
+
       <td> browsers </td>
      <td>таргетинг по браузерам: /data.browsers</td>  
+
       <td> browser targeting: /data.browsers </td>
      <td>последовательность чисел, разделенных запятой</td>
+
       <td> comma separated numbers </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>black_list</td>
+
       <td> black_list </td>
      <td>черный список площадок на которых не будет показана реклама</td>  
+
       <td> black list of sites where ads will not be shown </td>
      <td>последовательность чисел ID площадок, разделенных запятой</td>
+
       <td> comma separated site ID number sequence </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>white_list</td>
+
       <td> white_list </td>
      <td>белый список площадок на которых не будет показана реклама</td>  
+
       <td> white list of sites where ads will not be shown </td>
      <td>последовательность чисел ID площадок, разделенных запятой</td>
+
       <td> comma separated site ID number sequence </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>black_list_ip</td>
+
       <td> black_list_ip </td>
      <td>блокировка по ip</td>  
+
       <td> ip lock </td>
      <td>последовательность ip адресов, разделенных запятой или массивом</td>
+
       <td> sequence of ip addresses separated by a comma or an array </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>status</td>
+
       <td> status </td>
      <td>запуск/приостановка кампании:  
+
       <td> start /pause campaign:
          <p>0 - приостановлена;</p>
+
           <p> 0 - suspended; </p>
          <p>1 - запущена</p>
+
           <p> 1 - running </p>
      </td>
+
       </td>
      <td>необязательный параметр, int (числовое значение), по умолчанию 1</td>
+
       <td> optional parameter, int (numeric value), default 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>
==Список кампаний рекламного кабинета==
+
 
Для получения списка кампаний рекламного кабинета используется метод <b>ads.campaigns.get</b>
+
== List of campaign advertising campaign ==
 +
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>
==Архивирование рекламной кампании==
+
 
Для архивирования рекламной кампании используется метод <b>ads.campaigns.delete</b><br>  
+
== Archiving an advertising campaign ==
Максимальное допустимое количество клиентов, редактируемых с помощью одного запроса — 10.<br/>
+
To archive an advertising campaign, use the <b> ads.campaigns.delete </b> <br /> method
 +
The maximum number of clients edited with a single query is 10. <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>
==Получение кодов для СРА кампаний==
+
 
Для получения кодов по СРА кампаниям используется метод <b>ads.campaigns.cpa.mode.get</b><br/>
+
== Receiving codes for CPA campaigns ==
 +
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>
==Получение списка категорий по заданому фильтру==
+
 
Для возврата списка категорий по заданому фильтру используется метод <b>ads.campaigns.categories.get</b><br/>
+
== Getting a list of categories for a given filter ==
 +
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.foarmats.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>
==Получение списка форматов объявлений==
+
 
Для получения списка форматов объявлений используется метод <b>ads.campaigns.formats.get</b><br/>
+
== Getting the list of ad formats ==
<b>Результат:</b><br/>
+
Use the <b> ads.campaigns.formats.get </b> <br /> method to get the list of ad formats.
Возвращает массив ответов на запросы в массиве response.  
+
 
 +
<b> Result: </b> <br />
 +
Returns an array of responses to queries in the response array.
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
      count: %total%,
+
       count:% total%
      items: [{
+
       items: [{
            id: %format_id%,
+
             id:% format_id%
            title: ‘%format title%’
+
             title: ‘% format title%’
      },..]
+
       }, ..]
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
==Получение списка платформ==
+
 
Для получения списка платформ используется метод <b>ads.targeting.platforms.get</b><br/>
+
== Getting the list of platforms ==
<b>Результат:</b><br/>
+
For a list of platforms, use the <b> ads.targeting.platforms.get </b> <br /> method
Возвращает массив ответов на запросы в массиве response.
+
 
 +
<b> Result: </b> <br />
 +
Returns an array of responses to queries in the response array.
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
      count: %,
+
       count:%
      items: [{
+
       items: [{
          id: %platform_id%,
+
           id:% platform_id%
          title: %platform_name%,
+
           title:% platform_name%,
          mobile: %is mobile%
+
           mobile:% is mobile%
      },..]
+
       }, ..]
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
==Получение списка браузеров==
+
 
Для получения списка браузеров используется метод <b>ads.targeting.browsers.get</b><br/>
+
== Getting Browser List ==
<b>Результат:</b><br/>
+
For a list of browsers, use the <b> ads.targeting.browsers.get </b> <br /> method
Возвращает массив ответов на запросы в массиве response.
+
 
 +
<b> Result: </b> <br />
 +
Returns an array of responses to queries in the response array.
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
      count: %,
+
       count:%
      items: [{
+
       items: [{
          id: %browser_id%,
+
           id:% browser_id%,
          title: %browser_name%,
+
           title:% browser_name%,
      },..]
+
       }, ..]
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
==Получение списка уведомлений о конверсиях для СРА==
+
 
Для получения списка уведомлений о конверсиях для СРА используется метод <b>ads.targeting.cpa.modes.get</b><br/>
+
== Getting a list of conversion notifications for the CPA ==
<b>Результат:</b><br/>
+
To get a list of conversion notifications for CPA, use the <b> ads.targeting.cpa.modes.get </b> <br /> method
Возвращает массив ответов на запросы в массиве response.
+
 
 +
<b> Result: </b> <br />
 +
Returns an array of responses to queries in the response array.
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
      count: %total%,
+
       count:% total%
      items: [{
+
       items: [{
          id: %mode_id%,
+
           id:% mode_id%
          title: ‘%mode title%’
+
           title: ‘% mode title%’
      },..]
+
       }, ..]
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
==Получение списка возрастов==
+
 
Для получения списка возврастов используется метод <b>ads.targeting.ages.get</b><br/>
+
== Getting a list of ages ==
<b>Результат:</b><br/>
+
To get the list of views, use the <b> ads.targeting.ages.get </b> <br /> method
Возвращает массив ответов на запросы в массиве response.
+
 
 +
<b> Result: </b> <br />
 +
Returns an array of responses to queries in the response array.
 
<code>
 
<code>
 
<pre>
 
<pre>
 
response: {
 
response: {
      count: %,
+
       count:%
      items: [{
+
       items: [{
          id: %age_id%,
+
           id:% age_id%
          title: %age_name%
+
           title:% age_name%
      },..]
+
       }, ..]
 
}
 
}
 
</pre>
 
</pre>
 
</code>
 
</code>
==Создание клиентов рекламного агенства==
+
 
Для создания клиентов рекламного агенства используется метод <b>ads.clients.put</b><br/>
+
== Creating advertising agency clients ==
Допустимое количество создаваемых клиентов с помощью одного запроса — 50.
+
To create ad agency clients, use the <b> ads.clients.put method </b> <br />
 +
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/>
+
 
Возвращает массив ответов на запросы в массиве data. Соответствующий объект в выходном массиве содержит информацию клиента или массив error в случае возникновения ошибки (для каждого клиента отдельно).  
+
<b> Result: </b> <br />
 +
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>
==Редактирование клиентов рекламного агенства==
+
 
Для редактирования клиентов рекламного агенства используется метод <b>ads.clients.update</b><br/>
+
== Editing advertising agency clients ==
Максимальное допустимое количество клиентов, редактируемых с помощью одного запроса — 50.
+
To edit ad agency clients, use the <b> ads.clients.update method </b> <br />
 +
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/>
+
 
Возвращает массив ответов на каждый запрос в массиве data. Соответствующий объект в выходном массиве содержит id изменяемого клиента и, в случае возникновения ошибки, поля error_code иerror_desc.
+
<b> Result: </b> <br />
==Получение списка клиентов рекламного агенства==
+
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.
Для возврата списка клиентов рекламного агенства используется метод <b>ads.clients.get</b><br/>
+
 
 +
== Getting a list of advertising agency clients ==
 +
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/>
+
 
Возвращает массив объектов client — клиентов агентства, каждый из которых содержит следующие поля:  
+
<b> Result: </b> <br />
 +
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>
==Архивирование клиентов рекламного агенства==
+
 
Для архивирования клиентов рекламного агенства используется метод <b>ads.clients.delete</b><br/>
+
== Archiving advertising agency clients ==
 +
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/>
+
 
Возвращает массив ответов на каждый запрос. Каждый ответ является либо 0, что означает успешное удаление, либо массив error.
+
<b> Result: </b> <br />
==Подвязывание клиента к рекламному агенству==
+
Returns an array of responses to each request. Each answer is either 0, which means successful deletion, or an error array.
Для подвязывания клиента к рекламному агенству используется метод <b>ads.clients.bind.put</b><br/>
+
 
 +
== Tying a client to an advertising agency ==
 +
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.
==Открепление клиента от рекламного агенства==
+
 
Для открепления клиента от рекламного агенства используется метод <b>ads.clients.unbind.put</b><br/>
+
== Detaching a client from an advertising agency ==
 +
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.
==Пополнение счета клиента==
+
 
Для пополнения счета клиента используется метод <b>ads.clients.balance.put</b><br/>
+
== Customer account replenishment ==
 +
To replenish the client’s account, use the <b> ads.clients.balance.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> 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/>
+
 
Возвращает url для оплаты:  
+
<b> Result: </b> <br />
 +
Returns the url for payment:
 
<code>
 
<code>
 
<pre>
 
<pre>
 
{
 
{
response: {
+
response: {
url: %url%
+
url:% url%
                  }
+
                  }
 
}
 
}
 +
 
</pre>
 
</pre>
 
</code>
 
</code>
==Создание рекламных объявлений==
+
 
Для создания рекламных объявлений используется метод <b>ads.materials.put</b><br/>
+
== Creating advertisements ==
Максимальное допустимое количество объявлений, создаваемых с помощью одного запроса — 20.
+
To create ads using the method <b> ads.materials.put </b> <br />
 +
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>
==Обновление данных рекламных объявлений==
+
 
Для обновления данных рекламных объявлений используется метод <b>ads.materials.update</b><br/>
+
== Update ad data ==
Максимальное допустимое количество объявлений, создаваемых с помощью одного запроса — 20.
+
Use the <b> ads.materials.update </b> <br /> method to update ad data.
 +
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 ad_specification object description is 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>material_id</td>
+
       <td> material_id </td>
      <td>id объявления</td>
+
       <td> ad id </td>
      <td>обязательный параметр, int (числовое значение)</td>
+
       <td> required parameter, int (numeric value) </td>
  </tr>
+
   </tr>
  <tr bgcolor = #F5F5F5>
+
   <tr bgcolor = #F5F5F5>
      <td>status</td>
+
       <td> status </td>
      <td>запуск/приостановка материала:  
+
       <td> start /pause material:
          <p>0 - приостановлена;</p>
+
           <p> 0 - suspended; </p>
          <p>1 - запущена</p>
+
           <p> 1 - running </p>
      </td>
+
       </td>
      <td>необязательный параметр, int (числовое значение), по умолчанию 1</td>
+
       <td> optional parameter, int (numeric value), default 1 </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
==Архивирование рекламных объявлений==
+
 
Для архивирования рекламных объявлений используется метод <b>ads.materials.delete</b><br/>
+
== Archiving advertisements ==
Максимальное допустимое количество клиентов, редактируемых с помощью одного запроса — 50.
+
For advertising ads using the method <b> ads.materials.delete </b> <br />
 +
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/>
+
 
Возвращает массив ответов на каждый запрос. Каждый ответ является либо 0, что означает успешное удаление, либо массив error.
+
<b> Result: </b> <br />
==Получение списка рекламных объявлений==
+
Returns an array of responses to each request. Each answer is either 0, which means successful deletion, or an error array.
Для получения списка рекламных объявлений используется метод <b>ads.materials.get</b>
+
 
 +
== Getting a list of advertisements ==
 +
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/>
+
 
Возвращает массив объектов ad, каждый из которых содержит следующие поля:  
+
<b> Result: </b> <br />
  <ul type="disc">
+
Returns an array of ad objects, each of which contains the following fields:
      <li><b>id</b> — идентификатор объявления</li>
+
  <ul type = "disc">
      <li><b>name</b> — название объявления</li>
+
       <li> <b> id </b> - ad id </li>
      <li><b>campaign_id</b> — идентификатор кампании</li>
+
       <li> <b> name </b> - the name of the ad </li>
      <li><b>link_url</b></li>
+
       <li> <b> campaign_id </b> - Campaign ID </li>
      <li><b>arhive</b></li>
+
       <li> <b> link_url </b> </li>
      <li><b>ad_format</b> — формат объявления</li>
+
       <li> <b> arhive </b> </li>
      <li><b>cost_type</b> — тип оплаты</li>
+
       <li> <b> ad_format </b> - ad format </li>
      <li><b>all_limit</b> — общий лимит объявления в рублях</li>
+
       <li> <b> cost_type </b> - payment type </li>
            <ul type="circle">
+
       <li> <b> all_limit </b> - total ad limit in rubles </li>
                      <li>0 — лимит не задан</li>
+
            <ul type = "circle">
            </ul>
+
                       <li> 0 - no limit is set </li>
      <li><b>status </b> — статус объявления:</li>
+
            </ul>
            <ul type="circle">
+
       <li> <b> status </b> - ad status: </li>
                      <li>0 — объявление остановлено;</li>
+
            <ul type = "circle">
                      <li>1 — объявление запущено;</li>
+
                       <li> 0 - ad stopped; </li>
                      <li>2 — объявление удалено</li>
+
                       <li> 1 - the ad is running; </li>
            </ul>
+
                       <li> 2 - ad deleted </li>
      <li><b>approved </b> — статус модерации объявления:</li>
+
            </ul>
            <ul type="circle">
+
       <li> <b> approved </b> - ad moderation status: </li>
                      <li>0 — объявление ожидает модерации;</li>
+
            <ul type = "circle">
                      <li>10 — объявление одобрено;</li>
+
                       <li> 0 - the ad is awaiting moderation; </li>
                      <li>20 — объявление отклонено</li>
+
                       <li> 10 - Ad has been approved. </li>
            </ul>
+
                       <li> 20 - ad disapproved </li>
  </ul>
+
            </ul>
==Получение списка размеров баннеров==
+
  </ul>
Для получение списка размеров баннеров используется метод <b>ads.materials.banner.sizes.get</b><br/>
+
 
<b>Результат:</b><br/>
+
== Getting a list of banner sizes ==
Возвращает массив ответов на запросы в массиве response:
+
For a list of banner sizes, use the <b> ads.materials.banner.sizes.get </b> <br /> method
 +
 
 +
<b> Result: </b> <br />
 +
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>
==Получение списка стран==
+
 
Для получение списка стран используется метод <b>data.geo.countries.get</b><br/>
+
== Getting the list of countries ==
<b>Результат:</b><br/>
+
To get the list of countries, use the <b> data.geo.countries.get </b> <br /> method
Возвращает массив ответов на запросы в массиве response:
+
 
 +
<b> Result: </b> <br />
 +
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>
==Получение списка регионов по заданому фильтру==
+
 
Для получения списка регионов по заданому фильтру используется метод <b>data.geo.regions.get</b><br/>
+
== Getting a list of regions for a given filter ==
 +
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/>
+
 
Возвращает массив ответов на запросы в массиве response:
+
<b> Result: </b> <br />
 +
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>
==Получение списка доступных платежных систем==
+
 
Для получения списка доступных платежных систем используется метод <b>data.balance.systems.get</b><br/>
+
== Get a list of available payment systems ==
<b>Результат:</b><br/>
+
To get a list of available payment systems, use the <b> data.balance.systems.get </b> <br /> method
Возвращает массив ответов на запросы в массиве response:
+
 
 +
<b> Result: </b> <br />
 +
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>
==Загрузка медиа файлов==
+
 
Для загрузки медиа файлов (jpg, png, gif) используется метод <b>data.upload.media.update</b><br/>
+
== Download media files ==
 +
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 </td>
  </tr>
+
   </tr>
 
</table>
 
</table>
<b>Результат:</b><br/>
+
 
Возвращает массив с ссылкой на конечный объект или error в случае ошибки
+
<b> Result: </b> <br />
 +
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>
==Получение текущего времени сервера==
+
 
Для получения текущего времени сервера в формате ISO 8601 используется метод <b>server.time.get</b><br/>
+
== Get the current server time ==
<b>Результат:</b><br/>
+
To get the current server time in ISO 8601 format, use the <b> server.time.get </b> <br /> method
Возвращает массив ответов на запросы в массиве response:
+
 
 +
<b> Result: </b> <br />
 +
Returns an array of responses to requests in the response array:
 
<code>
 
<code>
 
<pre>
 
<pre>
      {
+
        {
          iso8601: %time%
+
            iso8601:% time%
      }
+
        }
 
</pre>
 
</pre>
 
</code>
 
</code>
==Статистика для Вебмастера==
+
 
Для получения статистики по вебмастерам используется метод <b>webmaster.reports.report.get</b><br/>
+
== Statistics for Webmasters ==
 +
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>
==Перевода денег для дочерних аккаунтов агенства==
+
 
Для перевода денег используется метод <b>ads.clients.balance.update</b><br/>
+
== Money transfer for subsidiary accounts of the agency ==
 +
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.
Возвращает данные в виде
+
 
<code>
+
Returns data as
 +
<code>
 
<pre>
 
<pre>
 
Array
 
Array
 
(
 
(
    [status] => "success"
+
    [status] => "success"
 +
 
 
)
 
)
 
</pre>
 
</pre>
В случае ошибки - код ошибки
+
In case of error - error code
</code>
+
</code>

Текущая версия на 14:47, 11 февраля 2019

Другие языки:
English • ‎русский

API authorization

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.analytic.campaign.get

Parameters Values Optional attributes
campaign_id campaign's id int (numeric value), required parameter
region_id region's id: data.geo.regions.get int (numeric value), required parameter
period The way data is grouped by date:

day — daily statistics;

month - monthly statistics

Temporary restrictions are set by parameters date_from and date_to

required parameter, string
date_from The starting date of the statistics to display. Different date format is 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 format is used for different parameter period values:

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

month: YYYY-MM, example: 2011-09

required parameter, string

Result:
Returns an object with data

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

Statistics on sites in the advertiser's account

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

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
Parameters Value Additional attributes
date_from Start date of the statistics output. string, format YYYY-MM-DD (example: 2017-05-15), filter parameter
date_to The end date of the statistics output. string, format YYYY-MM-DD (example: 2017-05-15), filter parameter
campaign_id campaign id required parameter, int (numeric value), filter parameter
signature Signature (generated using a time token, see above) required parameter, string
app_id user id required parameter, int (numeric value)
macros site id int (numeric value), write parameter, filter option
leads Leads int (numeric value), write parameter, filter option
views Views int (numeric value), write parameter, filter option
clicks Clicks int (numeric value), write parameter, filter option
conversions Confirmed Conversions int (numeric value), write parameter, filter option
rejections Failed Conversions int (numeric value), write parameter, filter option
ctr CTR int (numeric value), write parameter, filter option
cpm CPM int (numeric value), write parameter, filter option
cpc CPC int (numeric value), write parameter, filter option
prelandvisit Pre-landing Visits int (numeric value), write parameter, filter option
prelanduseful Pre-landing Useful visits int (numeric value), write parameter, filter option
prelandscroll Pre-landing Scroll int (numeric value), write parameter, filter option

Result:
Returns an object with data, example:

{
  "response": {
    "count": 1,
    "items": [
      {
        "macros": "12345678901234",
        "block": "1234",
        "domain": "123456789",
        "leads": "0",
        "views": "123",
        "clicks": "0",
        "conversions": "0",
        "rejections": "0",
        "ctr": "0.0000",
        "cpm": "0.00",
        "cpc": null,
        "moneyOut": "0.000000",
        "moneyIn": null,
        "prelandvisit": "0",
        "prelanduseful": "0",
        "prelandscroll": "0",
        "landvisit": "0",
        "landuseful": "0",
        "landscroll": "0",
        "multiplier": null,
        "blackList": "0"
      }
    ],
    "request": {
      "campaignId": 123456,
      "limit": 10,
      "offset": 0
    }
  }
}

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.campaigns.statblock method (PUT request)

Parameters (all are required):

  • app_id - user id, numeric value (int)
  • signature - signature, string (string)
  • campaign_id - campaign id, numeric value (int)
  • block - a numeric value (int)
  • domain - numeric value (int)
  • multiplier - new multiplier value, numeric value (float)
  • multiplierOld - old multiplier value, numeric value (float)
  • macros - pad 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.analytic.materials.get method

                                                                                                                                                               
Parameters Value Additional attributes
campaign_id campaign 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 format is 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 format is 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: {
teaser_id
date
shows
clicks
ctr
cpm
money
                       }
                  }
}

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 format is 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 format is 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 The number of campaigns 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
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
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
regions Regions, from 1 to 10 (1 - Russia, 2 - Ukraine, etc.) 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 =%

           

       

array [category_id => cost]

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

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)
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

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 advertising campaign, use the ads.campaigns.delete
method The maximum number of clients edited with a single query is 10.

                                                               
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.foarmats.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%
       }, ..]
}

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

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

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