Removing Advertising Campaigns:

campaign/delete

Parameters:

  • token — authorization (string)
  • id — id of the ad campaign (int)
  • 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
}
Possible error codes
General
1 - no request parameters
7 - access denied
16 - unknown error
37 - temporarily unavailable, try again later
38 - no entities matching the request parameters
41 - daily API request limit has been reached more detailsRemoving Advertising Campaigns 18 - executions awaiting confirmation
19 - not enough credits in the account
40 - executions awaiting confirmation, forced payment error
IPweb

Rate the material:

Rating: 3.32 out of 5. Total ratings: 14.
Last modified

I don't understand anything! Help :-(