Get the Affiliate Offers

HTTP method End Point Description
GET /affiliate/offers Get all the offers
GET /affiliate/offers/{offerId} Get info about a specific offer

All Affiliate Offers

Sample Request

<?php

    $filter = array();
    if($_POST["offerid"] != ""){
    $filter["offerid"] = $_POST["offerid"];
    }
    if($_POST["datefrom"] != ""){
    $filter["datefrom"] = $_POST["datefrom"];
    }
    if($_POST["dateto"] != ""){
    $filter["dateto"] = $_POST["dateto"];
    }

    $filter = base64_encode(serialize($filter));

    // Initialize cURL and make the request
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://{network}/api/v1/affiliate/offers/?api_key={api_key}&filter='.$filter);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($ch);
    curl_close($ch);

    // Decode the response into a PHP associative array
    $response = json_decode($response, true);

    // Make sure that there wasn't a problem decoding the repsonse
    if(json_last_error()!==JSON_ERROR_NONE){
        throw new RuntimeException(
            'API response not well-formed (json error code: '.json_last_error().')'
        );
    }

    // Print out the response details.
    echo '<pre>'.print_r($response, true).'';
    echo PHP_EOL;
?>

Response body

{
  "success": "1",
  "data": {
    "offers": [
      {
        "id": "4",
        "name": "testoffer",
        "status": "active",
        "advertiser_email": "advertiser@demo.adsgraphy.com",
        "preview_url": "http://hiindia.net/cpa.html?id={transaction_id}",
        "country": "IN",
        "default_payout": "1.00",
        "payout_type": "cpa_flat",
        "default_revenue": "1.50",
        "revenue_type": "cpa_flat",
        "cpc_count": "0",
        "cpa_count": "0",
        "revenue_cost": null,
        "payout_cost": "0.00",
        "image_name": null
      },
      {
        "id": "6",
        "name": "test-order-id22",
        "status": "active",
        "advertiser_email": "advertiser@demo.adsgraphy.com",
        "preview_url": "http://hiindia.net?id={transaction_id}",
        "country": "",
        "default_payout": "1.00",
        "payout_type": "cpa_percentage",
        "default_revenue": "2.00",
        "revenue_type": "cpa_percentage",
        "cpc_count": "0",
        "cpa_count": "0",
        "revenue_cost": null,
        "payout_cost": "0.00",
        "image_name": null
      },
      {
        "id": "8",
        "name": "Amount offer test",
        "status": "active",
        "advertiser_email": "advertiser@demo.adsgraphy.com",
        "preview_url": "http://hiindia.net/ravi/ravi_test.php",
        "country": "",
        "default_payout": "5.00",
        "payout_type": "cpa_flat",
        "default_revenue": "0.00",
        "revenue_type": "cpa_flat",
        "cpc_count": "0",
        "cpa_count": "0",
        "revenue_cost": null,
        "payout_cost": "0.00",
        "image_name": null
      }
    ]
  }
}

results matching ""

    No results matching ""