添加分类
读 1 分钟
category/add
参数:
- token - 授权(字符串)
- name - 分类名称(字符串)
- uniq_ips - 该类别中所有广告位的唯一 IP 地址 (整数)
方法调用示例:
<?php
$post = array(
'token' => $token,
'name' => 'mysite.ru-new',
'uniq_ips' => 1
);
if( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, 'https://www.ipweb.ru/api/v2/category/add');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
$out = curl_exec($curl);
echo $out;
curl_close($curl);
}
// Результат:
{
"status": "ok",
"error_code": 0
}
Categories of Advertising Campaigns
26 - less than 2 characters in category name27 - a category with this name already exists
28 - the category is not found
29 - error setting unique ip for the category