# SDK - Affiliate Offer Table

The Affiliate Offer Table SDK is a simple utility that displays affiliate offers in a table form based on API data. Simply enter your affiliate API information, and this SDK will automatically display the offers in an organized table structure. It is a quick and simple approach to show offer information without extensive setup.

***

### Setup&#x20;

Instructions to Enable the Offer18 Affiliate Offer Table SDK

#### 1. Create a New HTML File

#### 2. Add the SDK Configuration and Script

Inside the `<body>` tag, add the following script to configure and load the Offer18 SDK. Replace the placeholder values with your actual affiliate details:

{% code overflow="wrap" %}

```html
<script>
  OFFER18_API_CONFIG = {
    "aid": "<--AFFILIATE-ID-->",  // Replace with your Affiliate ID
    "mid": "<--ACCOUNT-ID-->",             // Replace with your Account ID (MID)
    "key": "<--API-KEY-->"             // Replace with your API Key
  };
</script>
<script src="https://web-resources.offer18.net/sdk/web/affiliate-api/OfferTable.js"></script>
```

{% endcode %}

#### 3. Add Your Affiliate API Details

In the `OFFER18_API_CONFIG` object

* **aid**: Enter your unique Affiliate ID.&#x20;
* **mid**: Enter your Account ID (MID).
* **key**: Enter your API Key.

These fields are mandatory for Affiliate Offer Table SDK

***

### Additional Configuration Options

You can enhance the `OFFER18_API_CONFIG` object by adding optional parameters to customize the display and filtering of offers in the Affiliate Offer Table. Below is a list of additional configuration options available.

<table data-header-hidden><thead><tr><th width="164"></th><th width="142"></th><th></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td>fields</td><td>Array</td><td><p>Specifies the fields to display in the table, in the order provided.<br><br><strong>Available Fields:</strong></p><pre class="language-html" data-overflow="wrap"><code class="lang-html">"offerid", "name", "logo", "status", "category", "price", "currency", "model", "date_start", "date_end", "preview_url", "offer_terms", "offer_kpi",  "capping", "events", "payout", "impression_url", "click_url", "authorized", "creatives", "targeting"
</code></pre></td></tr><tr><td>offer_id</td><td>String</td><td>Comma-separated string of specific offer IDs to display. Shows only these offers.</td></tr><tr><td>page</td><td>String</td><td>Specifies the page number for pagination.</td></tr><tr><td>category</td><td>String</td><td>Filters offers by a specific category (e.g., "Finance," "E-commerce").</td></tr><tr><td>model</td><td>String</td><td>Specifies the model of the offer, such as CPA (Cost Per Action) or CPL (Cost Per Lead).</td></tr><tr><td>country</td><td>String</td><td>Comma-separated list of country codes to filter offers by location.</td></tr><tr><td>offer_status</td><td>String</td><td>Set to <code>"1"</code> to display only active offers.</td></tr><tr><td>authorized</td><td>String</td><td>Set to <code>"1"</code> to show only authorized offers.</td></tr></tbody></table>

***

### Example File

Here's an example of a fully configured `OFFER18_API_CONFIG` object with both required and optional parameters:

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

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

<body>
  <script>
    OFFER18_API_CONFIG = {
      "aid": "12345",
      "mid": "67890",
      "key": "000000000000000000000000000000",
       
       // Optional Configuration
      "fields": ["offerid", "name", "logo", "status", "category", "price", "currency", "model", "date_start", "date_end", "preview_url", "offer_terms", "offer_kpi",  "capping", "events", "payout", "impression_url", "click_url", "authorized", "creatives", "targeting"],        // Array of fields to display, in the desired order
      "offer_id": "123,456,789",             // Comma-separated string of specific offer IDs
      "page": "1",                           // Page number to display
      "category": "Finance",                 // Category of offers to display
      "model": "CPA",                        // Model of the offer (e.g., CPA, CPL)
      "country": "US,CA",                    // Comma-separated list of country codes
      "offer_status": "1",                   // Set to "1" to show only active offers
      "authorized": "1"                      // Set to "1" to display only authorized offers
    };
  </script>
  <script src="https://web-resources.offer18.net/sdk/web/affiliate-api/OfferTable.js"></script>
</body>

</html>
```
