MaxConv Tracker
Get a powerful tracker with reasonable price, fast global speed, integrated with fb/tiktok/google/microsoft ads, anti-fraud, google-certified and more

Guide Admaven "private" api

LeadStackMedia

Alukard_X

Grand Guru
Joined
Oct 3, 2020
Messages
825
1758137017509-png.70067

1758136966732-png.70065

1758137003395-png.70066
To start or stop campaign:
PHP:
<?php
class AdMavenAPI {
     private $baseUrl =  "https://advertisers.ad-maven.com";
    private $sessionToken  = null;
    private  $apiToken = null;

     public function authenticate($username, $password) {
          $url = $this->baseUrl . "/api/user";
          $data = json_encode([
              "username" => $username,
              "password" =>  $password
         ]);

         $headers =  [
              "accept: application/json, text/plain, */*",
              "content-type: application/json",
              "cache-control: no-cache",
              "pragma:  no-cache",
              "referer: https://advertisers.ad-maven.com/user-login"
         ];

         $ch  = curl_init();
         curl_setopt_array($ch, [
              CURLOPT_URL =>  $url,
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_POST => true,
              CURLOPT_POSTFIELDS =>  $data,
              CURLOPT_HTTPHEADER => $headers,
              CURLOPT_SSL_VERIFYPEER => true,
              CURLOPT_CONNECTTIMEOUT =>  30,
              CURLOPT_TIMEOUT => 30
         ]);

          $response = curl_exec($ch);
         $httpCode =  curl_getinfo($ch, CURLINFO_HTTP_CODE);
         $error = curl_error($ch);
          curl_close($ch);

         if ($error) {
              throw  new Exception("cURL Error: " . $error);
          }

         $responseData = json_decode($response,  true);
       
         if ($responseData['type'] === 'created')  {
              $this->sessionToken = $responseData['message']['token'];
              $this->apiToken = $responseData['message']['api_user_token'];
              return true;
          } else {
              throw new Exception("Authentication  failed: " . json_encode($responseData));
         }
     }

     public function manageCampaign($campaignId, $enable) {
          if (!$this->sessionToken) {
              throw new Exception("Not  authenticated. Please call authenticate() first.");
          }

         $url = $this->baseUrl .  "/api/campaign?campaign_id=" . $campaignId;
         $data =  '[{"_id":' . $campaignId . ',"enable":' .  ($enable ? 'true' : 'false') .  '}]';
       
         $headers = [
              "accept: application/json,  text/plain, */*",
 
Last edited:
To view the premium content in our affiliate marketing forum (including this awesome thread), you must first register and upgrade your account. Register today and become a part of our amazing community!
Top