Integration Guide

iFrame, Postback, Offers API, Web SDK and Android SDK

BASE URL https://www.pro.adswedmedia.com
1

iFrame Integration

Easiest
1

Apply

Create a publisher account and submit your application for review.

2

Get Keys

After approval, copy your Public Key and Secret Key from Setup.

3

Embed

Paste the tracking link in an iFrame and configure your postback URL.

Embed Code

Replace YOUR_KEY with your Public Key and USER_ID with your user's unique identifier.

HTML
<iframe
  src="https://www.pro.adswedmedia.com/offer/YOUR_KEY/USER_ID"
  width="100%"
  height="700"
  frameborder="0"
  allow="clipboard-write"
></iframe>
2

Postback (Server-to-Server)

Security
When a user completes an offer, we send a HTTP GET request to your postback URL with these parameters.

Parameters

ParameterTypeDescription
subIdstringYour user's unique identifier
transIdstringUnique transaction ID (use for deduplication)
rewardnumberAmount of virtual currency to credit
payoutnumberOffer payout in USD
signaturestringMD5 hash for verification
statusinteger1 = credit   2 = chargeback (subtract)
offer_idstringCompleted offer ID
offer_namestringCompleted offer name
round_rewardnumberReward rounded to your site's decimal setting
userIpstringUser's IP address
countrystringISO 2-letter country code
uuidstringUnique click ID
event_idstringEvent ID (multi-reward offers only)
event_namestringEvent name (multi-reward offers only)

Signature Verification

Formula: MD5( subId + transId + reward + SECRET_KEY )

PHP
// Verify the postback signature
$secret    = 'YOUR_SECRET_KEY';
$subId     = $_GET['subId'] ?? '';
$transId   = $_GET['transId'] ?? '';
$reward    = $_GET['reward'] ?? '';
$signature = $_GET['signature'] ?? '';

if (md5($subId . $transId . $reward . $secret) != $signature) {
    echo "ERROR"; return;
}

// Prevent duplicate credits
if (isDuplicate($transId)) { echo "DUP"; return; }

// Credit or chargeback
if ($_GET['status'] == '1') {
    creditUser($subId, $reward);
} else {
    subtractUser($subId, $reward);
}
echo "OK";
Respond with OK for success or DUP for duplicates. We retry up to 5 times on timeout (60s max).
3

Offers API

API v2
GET/api/v1/offers
Rate limit: 10 requests/hour per site credentials. Returns X-RateLimit-Remaining header.

Parameters

ParameterRequiredTypeDescription
site_keyrequiredstringSite public key
site_secretrequiredstringSite secret key
typeoptionalstringoffer or multireward
limitoptionalintegerResults per page, 1-500. Default: 100
offsetoptionalintegerSkip N results (pagination)
countryoptionalstringISO 2-letter code: US, DE, BR
deviceoptionalstringandroid, ios, desktop
min_payoutoptionalfloatMinimum USD payout
updated_sinceoptionalstringISO 8601 date for incremental sync

Error Codes

MISSING_CREDENTIALS400Both site_key and site_secret are required
INVALID_CREDENTIALS401No site found with the provided keys
SITE_PENDING403Site is pending approval
INVALID_TYPE422Only offer or multireward accepted
INVALID_DATE422updated_since must be a valid ISO 8601 date
RATE_LIMIT_EXCEEDED429Too many requests

Response Format

JSON
{
  "success": true,
  "version": "v1",
  "total": 245,
  "offset": 0,
  "limit": 100,
  "has_more": true,
  "offers": [
    {
      "id": 1,
      "title": "Install Game App",
      "description": "Download and reach level 5",
      "image": "https://www.pro.adswedmedia.com/asset/images/offers/example.jpg",
      "payout": 0.85,
      "currency": "USD",
      "level": "easy",
      "stars": 4,
      "categories": ["games"],
      "countries": ["US", "GB"],
      "devices": ["android", "ios"],
      "payment_term": "net30",
      "android_min_os": "8.0",
      "ios_min_os": null,
      "tracking_url": "https://www.pro.adswedmedia.com/redirect/manual-offer/1/user/{user_id}/site/KEY",
      "updated_at": "2026-03-15T14:30:00+00:00",
      "created_at": "2026-03-01T10:00:00+00:00"
    }
  ]
}
GET/api/v1/status

Health Check

Returns API status, offer counts, and your site status. Same auth params.

JSON
{
  "success": true,
  "status": "operational",
  "data": {
    "offers_available": 245,
    "multireward_available": 38,
    "site_status": "active",
    "rate_limit_per_hour": 10
  }
}

Report API

Fetch traffic and conversion reports for your site. Get daily, per-offer, or per-country breakdowns.

Overview

EndpointGET https://www.pro.adswedmedia.com/api/v1/reports
MethodGET
Authsite_key + site_secret (query params)
Query Parameters
ParameterRequiredDescription
site_keyRequiredYour site key
site_secretRequiredYour site secret
fromOptionalStart date (YYYY-MM-DD). Default: 30 days ago
toOptionalEnd date (YYYY-MM-DD). Default: today
group_byOptionalday, offer, or country. Default: day
offer_idOptionalFilter by specific offer ID

Response Format

{
  "success": true,
  "site": { "id": 10, "key": "YOUR_KEY" },
  "period": { "from": "2026-03-01", "to": "2026-04-03" },
  "summary": {
    "clicks": 150,
    "conversions": 12,
    "revenue": 45.50,
    "chargebacks": 1,
    "pending": 20.00,
    "paid": 25.50,
    "cvr": 8.0,
    "epc": 0.3033
  },
  "group_by": "day",
  "breakdown": [
    {
      "date": "2026-04-01",
      "clicks": 50,
      "conversions": 4,
      "revenue": 15.25,
      "chargebacks": 0,
      "cvr": 8.0,
      "epc": 0.305
    }
  ]
}
Summary Fields
FieldTypeDescription
clicksintegerTotal clicks in period
conversionsintegerTotal conversions
revenuenumberTotal revenue (USD)
chargebacksintegerTotal chargebacks
pendingnumberPending payout (USD)
paidnumberPaid payout (USD)
cvrnumberConversion rate (%)
epcnumberEarnings per click (USD)
Breakdown Fields (group_by=day)
FieldDescription
dateDate (YYYY-MM-DD)
clicks, conversions, revenue, chargebacks, cvr, epcSame as summary, per day
Breakdown Fields (group_by=offer)
FieldDescription
offer_idOffer identifier
offer_nameOffer title
clicks, conversions, revenue, chargebacks, cvr, epcStats per offer
Breakdown Fields (group_by=country)
FieldDescription
countryCountry name
clicks, conversions, revenue, chargebacksStats per country

Code Examples

Node.js
const axios = require("axios");

async function getReport() {
  const { data } = await axios.get("https://www.pro.adswedmedia.com/api/v1/reports", {
    params: {
      site_key: "YOUR_SITE_KEY",
      site_secret: "YOUR_SITE_SECRET",
      from: "2026-04-01",
      to: "2026-04-03",
      group_by: "day"  // or "offer" or "country"
    }
  });

  if (data.success) {
    console.log("Summary:", data.summary);
    console.log(`Clicks: ${data.summary.clicks}`);
    console.log(`Revenue: $${data.summary.revenue}`);
    console.log(`CVR: ${data.summary.cvr}%`);

    data.breakdown.forEach(row => {
      console.log(`${row.date}: ${row.clicks} clicks, ${row.conversions} conv, $${row.revenue}`);
    });
  }
}

getReport();
PHP
$response = file_get_contents(
    "https://www.pro.adswedmedia.com/api/v1/reports?" . http_build_query([
        "site_key"    => "YOUR_KEY",
        "site_secret" => "YOUR_SECRET",
        "from"        => "2026-04-01",
        "to"          => "2026-04-03",
        "group_by"    => "offer",
    ])
);
$data = json_decode($response, true);

echo "Revenue: $" . $data["summary"]["revenue"];
foreach ($data["breakdown"] as $row) {
    echo $row["offer_name"] . ": " . $row["clicks"] . " clicks\n";
}
4

Web SDK

JS v1.0.0

Quick Start

HTML
<!-- 1. Load the SDK -->
<script src="https://www.pro.adswedmedia.com/sdk/v1/adsw.js"></script>

<!-- 2. Add a button -->
<button id="earn-btn">Earn Rewards</button>

<script>
  // 3. Initialize
  ADSW.init({
    appKey: 'YOUR_APP_KEY',
    userId: 'USER_123',
    appName: 'My App',
    enablePolling: true
  });

  // 4. Open offerwall on click
  document.getElementById('earn-btn').onclick = function() {
    ADSW.show();
  };

  // 5. Listen for rewards
  ADSW.on('reward', function(data) {
    console.log('Earned', data.reward, data.currency);
  });
</script>
For embed mode (inline): ADSW.show({ mode: 'embed', container: '#my-div', height: '700px' })

Configuration

OptionTypeDefaultDescription
appKeystring-required Your API key
userIdstring-required Stable user ID
appNamestring"Offerwall"Header title
baseUrlstringAutoOverride API base URL
localestring-Language code (en, es, fr)
currencystring-Currency name for display
enablePollingbooleanfalseAuto-poll rewards
pollIntervalnumber15000Poll interval (ms)
showRewardToastbooleantrueToast notification
debugbooleanfalseConsole logging

Events

EventCallback DataDescription
init{ sessionId, site }SDK initialized
ready{}Offerwall iframe loaded
open-Offerwall opened
close-Offerwall closed
reward{ transactionId, offerId, offerName, reward, payout, currency, timestamp }User earned a reward
offer_click{ offerId, offerName, payout }User clicked an offer
error{ message }Error occurred

Methods

MethodDescription
ADSW.init(config, cb)Initialize the SDK
ADSW.show(options)Display offerwall (modal or embed)
ADSW.hide()Close the modal
ADSW.on(event, fn)Register event listener
ADSW.off(event, fn)Remove event listener
ADSW.isReady()Returns true if SDK initialized
ADSW.isVisible()Returns true if offerwall showing
ADSW.getSessionId()Returns current session token
ADSW.destroy()Cleanup all SDK elements
5

Android SDK

Native
POST/api/sdk/v1/init

Init Session

Creates a 24-hour session. Returns a token and the offerwall URL.

ParamRequiredDescription
app_keyrequiredYour site public key
user_idrequiredUnique user identifier
sdk_versionoptionalSDK version for analytics
domainoptionalApp package name or domain
Response
{
  "success": true,
  "session_id": "a1b2c3d4e5f6...64-char-hex",
  "site": {
    "name": "My Reward App",
    "currency": "coins",
    "decimals": 2
  },
  "config": {
    "offerwall_url": "https://www.pro.adswedmedia.com/offer/KEY/user123",
    "poll_interval": 15
  }
}
GET/api/sdk/v1/rewards

Poll Rewards

Returns new rewards since last poll. Send app_key, user_id, and session.

Response
{
  "success": true,
  "count": 1,
  "rewards": [{
    "transactionId": "txn_12345",
    "offerId": 42,
    "offerName": "Install Game",
    "reward": 150.00,
    "payout": 0.85,
    "currency": "coins",
    "timestamp": "2026-03-16T10:30:00+00:00"
  }]
}
Poll every 15 seconds. Session expired? Call /init again. Error code: SESSION_EXPIRED

S2S Callbacks

Optional

Configure a callback URL in your site settings. We send a GET request with HMAC-SHA256 signature.

ParamDescription
eventAlways reward
transaction_idUnique transaction ID
site_keyYour site public key
user_idUser who completed the offer
offer_idCompleted offer ID
offer_nameCompleted offer name
rewardReward amount (your currency)
payoutPayout in USD
currencyYour site's currency name
timestampISO 8601 timestamp
signatureHMAC-SHA256 for verification

Signature: HMAC-SHA256( transaction_id : user_id : reward, SECRET )

PHP
$secret   = 'YOUR_SECRET';
$expected = hash_hmac('sha256',
    $_GET['transaction_id'] . ':' . $_GET['user_id'] . ':' . $_GET['reward'],
    $secret
);

if (!hash_equals($expected, $_GET['signature'])) {
    http_response_code(403); echo 'Invalid'; exit;
}

creditUser($_GET['user_id'], $_GET['reward']);
echo 'OK';
6

Platform Plugins

Ready-to-install plugins for WordPress, WooCommerce, Shopify, and Wix

Our platform plugins let you integrate the AdswedMedia offerwall into your website with zero coding required. Each plugin loads our remote Web SDK and handles user identification, reward notifications, and banner ads automatically.

How it works: All plugins load the SDK from adswedmedia.com/sdk/v1/adsw.js remotely. No local SDK copies — always up to date.

WordPress

Install the adswedmedia-offerwall plugin, enter your API key in Settings → AdswedMedia, and use shortcodes to display the offerwall on any page or post.

Installation:
  1. Upload adswedmedia-offerwall to /wp-content/plugins/
  2. Activate via Plugins menu
  3. Go to Settings → AdswedMedia and enter your API Key
  4. Add the shortcode to any page
ShortcodeDescription
[adswedmedia_offerwall]Button that opens the offerwall modal
[adswedmedia_offerwall mode="embed"]Embed offerwall directly on the page
[adswedmedia_offerwall button_text="Earn"]Custom button text
[adswedmedia_banner size="300x250"]Banner ad (sizes: 300x250, 728x90, 320x50, 160x600, 468x60)

Also available as a sidebar widget via Appearance → Widgets.

SettingDescriptionDefault
API KeyYour site st_key from the publisher dashboardrequired
Base URLAdswedMedia server URLhttps://adswedmedia.com
Display ModeModal (popup) or Embed (inline)Modal
Button TextText shown on the offerwall buttonEarn Rewards
Reward PollingAuto-show toast when user earns rewardsEnabled
Debug ModeEnable SDK console loggingDisabled

User ID: Logged-in users get wp_{user_id}. Anonymous visitors get a cookie-based ID (anon_{uuid}, 30-day expiry).

WooCommerce

Everything from the WordPress plugin plus store credit, a "My Rewards" tab in the customer account, and a S2S webhook endpoint for server-side reward verification.

Installation:
  1. Upload adswedmedia-woocommerce to /wp-content/plugins/ (WooCommerce must be active)
  2. Go to WooCommerce → Settings → AdswedMedia tab
  3. Enter your API Key and Callback Secret
  4. Copy the S2S Callback URL shown in settings and paste it in your AdswedMedia dashboard as SDK Callback URL
Store Credit
Convert reward points to checkout discounts. Configurable conversion rate (e.g. 100 pts = $1).
My Rewards Tab
Balance, embedded offerwall, transaction history, and redeem button in My Account.
S2S Webhook
REST endpoint with HMAC-SHA256 signature verification and duplicate protection.
Callback URL Format
https://your-store.com/wp-json/adswedmedia/v1/callback

User ID: WooCommerce customers get wc_{user_id} prefix (different from wp_ to avoid collisions).

Shopify

A Theme App Extension that lets you add the offerwall and banners via the Shopify theme editor — drag & drop, no code required.

Installation:
  1. Install the AdswedMedia app from the Shopify App Store
  2. Go to Online Store → Customize
  3. Click Add section and select AdswedMedia Offerwall or AdswedMedia Banner
  4. Enter your API Key in the block settings
  5. Save
Offerwall Block
Modal button or embedded offerwall. Configure display mode, button text, height, and reward notifications.
Banner Block
Banner ads in 5 sizes. Select size from dropdown, banners load and track impressions automatically.

User ID: Logged-in customers use shp_{customer.id}. Guests get a localStorage-based anonymous ID.

Wix

A Wix Blocks app with dashboard settings, offerwall widget, banner widget, and server-side reward handling via Velo HTTP functions.

Installation:
  1. Install AdswedMedia Offerwall from the Wix App Market
  2. Open the app's dashboard page and enter your API Key
  3. Use the Wix Editor to add the AdswedMedia Offerwall or AdswedMedia Banner widget to any page
  4. Optionally configure the Callback Secret for S2S reward verification
Dashboard Settings
API Key, Base URL, display mode, button text, polling, and callback secret.
Widgets
Offerwall (modal or embed) and Banner (5 sizes) — add via Wix Editor.
S2S Callbacks
Velo HTTP function with HMAC verification. Stores rewards in Wix Data collections.
Callback URL Format
https://your-site.com/_functions/adswedmediaCallback

User ID: Wix Members use wix_{member._id}. Anonymous visitors get a localStorage-based ID.

All Plugins Share

Remote SDK — always up to date
Modal & embed display modes
5 banner ad sizes
Automatic reward toast notifications
Logged-in & anonymous user support
Platform-prefixed user IDs (no collisions)
Lightweight (<50KB per plugin)
Settings UI in each platform's admin