“mobile”/ Voluum
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

PHP Code Help Needed - Adcombo

Discussion in 'Programming and Scripts' started by craig88, Apr 10, 2018.

  1. craig88

    craig88 Affiliate affiliate

    43
    14
    8
    Hi Guys,

    I'm trying to do an API intergration so that my webpage sends a customers details directly to the network so they can then follow up with the order. But I'm struggling with PHP code not being correct.

    This is the help URL which they have provided: Incoming orders API - AdCombo Docs - AdCombo Confluence

    This is my PHP code

    any idea what is wrong?

    <!DOCTYPE html>
    <html lang="en">

    <body>

    <?php
    const API_URL = "https://api.adcombo.com/api/v2/order/create/";
    const API_KEY = "123456789";
    $isCurlEnabled = function(){
    return function_exists('curl_version');
    };
    if (!$isCurlEnabled) {
    echo "<pre>";
    echo "pls install curl\n";
    echo "For *unix open terminal and type this:\n";
    echo 'sudo apt-get install curl && apt-get install php-curl';
    die;
    }
    $args = [
    'api_key' => '123456789',
    'name' = $_GET['personsname']; ,
    'phone' = $_GET['phonenumber']; ,
    'offer_id' => '11111',
    'country_code' => $_GET['country_code_selector']; ,
    'price' => 60,
    'base_url' => 'my-domain.com - This website is for sale! - my-domain Resources and Information.' ,
    'ip' => 'INSERT CLIENTS IP ADDRESS',
    'referrer' => 'http://my-click-site.com',
    'subacc' => 'INSERT SUBACCOUNT 1',
    'subacc2' => 'INSERT SUBACCOUNT 2',
    'subacc3' => 'INSERT SUBACCOUNT 3',
    'subacc4' => 'INSERT SUBACCOUNT 4',
    'utm_campaign' => 'INSERT utm_campaign',
    'utm_content' => 'INSERT utm_content',
    'utm_medium' => 'INSERT utm_medium',
    'utm_source' => 'INSERT utm_source',
    'utm_term' => 'INSERT utm_term',
    // you can add any extra field to get it in postback
    'clickid' => 'INSERT YOUR CLICK ID',
    ];
    $url = API_URL.'?'.http_build_query($args);
    $curl = curl_init();
    curl_setopt_array($curl, array(
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true
    ));
    $res = curl_exec($curl);
    curl_close($curl);
    $res = json_decode($res, true);
    if ($res['code'] == 'ok') {
    echo $res['msg'] . ": " . $res['order_id'];
    } else {
    echo $res['error'];
    }


    ?>
    </body>
    </html>
     
  2. CPA Evolution
  3. Joy kalyan

    Joy kalyan Affiliate affiliate

    7
    2
    3
    what error do you get?
     
  4. Joy kalyan

    Joy kalyan Affiliate affiliate

    7
    2
    3
    You've typo on your code, Replace this 3 line
    PHP:
    'name' $_GET['personsname']; ,
    'phone' $_GET['phonenumber']; ,
    'country_code' => $_GET['country_code_selector']; ,
    with this, then let me know curl result.

    PHP:
    'name' $_GET['personsname'],
    'phone' $_GET['phonenumber'],
    'country_code' => $_GET['country_code_selector'],
     
    Graybeard and craig88 like this.
  5. craig88

    craig88 Affiliate affiliate

    43
    14
    8
    Thanks it's working great now!
     
    Joy kalyan likes this.
  6. Subodh Bhargav

    Subodh Bhargav Affiliate affiliate

    2
    2
    3
    Sir, I also want to Set Up API for Adcombo like you. What are the steps to do so? Actually, I am new. Please Help.
    Where I should put this code on my website and what variable I have to change?
     
    Lord Patrick likes this.
  7. liam1102

    liam1102 Affiliate affiliate

    2
    0
    1
    i am using wordpess, so can you pls guide me where to put that code in wordpess?
     
banners