Removing Advertising Campaigns:
Read 3 minutes
campaign/delete
Parameters:
- token — authorization (string)
- id — id of the ad campaign (int)
- child_campaigns - [not necessary] deleting child advertising campaigns (int, default: 0)
- forced_pay - [not necessary] for advertising campaigns with deferred moderation, allows you to attempt to force payment for pending executions (int, default: 0). Values:
- 0 - no forced payment
- 1 - forced payment for pending executions
Example of the method request:
<?php
$post = array(
'token' => $token,
'id' => 999999
);
if ($curl = curl_init()) {
curl_setopt($curl, CURLOPT_URL, 'https://www.ipweb.ru/api/v2/campaign/delete');
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);
}
// Result:
{
"error": "Access denied",
"error_code": 7
}
====================================================================================
<?php
$post = array(
'token' => $token,
'id' => 999998
);
if ($curl = curl_init()) {
curl_setopt($curl, CURLOPT_URL, 'https://www.ipweb.ru/api/v2/campaign/delete');
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);
}
// Result:
{
"status": "ok",
"error_code": 0
}
====================================================================================
<?php
$post = array(
'token' => $token,
'id' => 999998,
'forced_pay' => 1
);
if ($curl = curl_init()) {
curl_setopt($curl, CURLOPT_URL, 'https://www.ipweb.ru/api/v2/campaign/delete');
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);
}
// Result:
{
"status": "ok",
"error_code": 0
}
Removing Advertising Campaigns
18 - actions awaiting confirmation19 - not enough credits in the account
40 - actions awaiting confirmation, forced payment error