# Quickstart

This guide will walk you through the steps you need to take to start monetizing with AdBreak Media. Start by learning how to integrate the AdBreak Media Offer wall & API

{% hint style="info" %}
**Quick Info :** Maximize your revenue with AdBreak Media, the leader in rewarded advertising. Monetize your website or app's user base effortlessly with non-intrusive ads. Partner with us to unlock your earning potential. Start earning more now!
{% endhint %}

## How does it work?

Empower your users to earn additional virtual currency within your app or website. Present them with a curated list of offers to effortlessly accumulate more virtual currency.

<figure><img src="/files/pmWFuZpxDtGwU4k3swmZ" alt="offerwall image"><figcaption></figcaption></figure>

When a user successfully completes a selected offer, the app developer earns their payment while the user receives their well-deserved reward. It's a win-win situation for everyone involved!

## I am ready to start

Cool, let's start by creating an Account on AdBreak Media, click [here](https://adbreakmedia.com)

{% hint style="info" %}
**Good to know:** Leverage the power of our Featured Offer section by integrating our static API, resulting in increased revenue and heightened attention. Take a moment to explore our comprehensive documentation, which offers straightforward implementation steps. Experience substantial growth firsthand, as we have witnessed a remarkable 300% increase from users who have implemented our static API to showcase featured offers.
{% endhint %}


# Account Setup

Let us guide you through the step-by-step process of setting up your account and unlocking your earning potential with AdBreak Media.

{% hint style="warning" %}

#### REQUIREMNTS:

Before you Begin:

* Must Have an Active AdBreak Media Account
* All Profile information filled
  {% endhint %}

### Step 1 Create a new Placement

1. Click on `Placement` in the left menu
2. click on `add placement`&#x20;

{% hint style="info" %}
You must have a unique Property/App ID for each website you want to integrate the Offer Wall on. For example, if you have multiple website URLs, they each must be setup separately from the AdBreak Media Dashboard.
{% endhint %}

3. Choose the Placement type : `Android` ,  `IOS`  ,  `website`  from the form, complete and create the property

{% hint style="info" %}
Once a placement is created, it undergoes a review process, which typically takes a few hours. This is done to ensure that your placement complies with our policies and meets the demand, guaranteeing the highest level of quality and integrity.

{% endhint %}

4. Once approved, you can fill all the required fields like : `Currency Name` , `Exchange Rate` etc.


# Postback

Experience a seamless journey towards setting up your own Postback as we walk you through each step, providing comprehensive guidance along the way.

{% hint style="info" %}
**Quick Info :** \
When a user successfully completes an offer, we immediately trigger a call to the Postback URL you have provided in your placement. This call contains all the relevant information required to credit your users, serving as a real-time notification to your server.
{% endhint %}

### Postback Parameters

<table><thead><tr><th width="183.33333333333331" align="center">PARAMETER</th><th width="404" align="center">DESCRIPTION</th><th align="center">EXAMPLE</th></tr></thead><tbody><tr><td align="center">[YOUR_USER_ID]</td><td align="center">This is the unique identifier code of the user who completed action on your platform.</td><td align="center">123GnL</td></tr><tr><td align="center">[REWARD_VALUE]</td><td align="center">The amount of your virtual currency to be credited to your user.</td><td align="center">9000</td></tr><tr><td align="center">[OFFER_NAME]</td><td align="center">The Name of the offer completed.</td><td align="center">Lords Mobile</td></tr><tr><td align="center">[MULTI_EVENT]</td><td align="center">Boolean: <code>true</code> for a multi-event offer, <code>false</code> otherwise.</td><td align="center">false</td></tr><tr><td align="center">[EVENT_NAME]</td><td align="center">Name of the event action that got conversion</td><td align="center">Lords Mobile Castle level 7</td></tr><tr><td align="center">[EVENT_ID]</td><td align="center">ID of the event action that got conversion</td><td align="center">476ede1881042f072794e3cfb5c</td></tr><tr><td align="center">[STATUS]</td><td align="center">For determining the reward amount, <code>completed</code> status adds currency while <code>rejected</code> status subtracts it..</td><td align="center">completed</td></tr><tr><td align="center">[OFFER_ID]</td><td align="center">ID of the offer as displayed on the AdBreak Media dashboard</td><td align="center">5620</td></tr><tr><td align="center">[USER_IP]</td><td align="center">IP address of the user that completed the offer</td><td align="center">139.144.178.218</td></tr><tr><td align="center">[PAYOUT]</td><td align="center">Amount in USD that you earned for this conversion</td><td align="center">90.00</td></tr><tr><td align="center">[TXID]</td><td align="center">Unique ID of the conversion generated by AdBreak Media</td><td align="center">1b6acc68414e699ebab37e0d5d2a17ab</td></tr><tr><td align="center">[COUNTRY]</td><td align="center">Country (ISO2 form) from the lead comes.</td><td align="center">US</td></tr><tr><td align="center">[HASH]</td><td align="center">SHA256 hash that can be used to verify that the call has been made from our servers.</td><td align="center">2cfbbd0297294396caf5c7db13bc36d5</td></tr><tr><td align="center">[SUB1]</td><td align="center">Extra Param that you passed though offerwall</td><td align="center">Sa123s</td></tr><tr><td align="center">[SUB2]</td><td align="center">Extra Param that you passed though offerwall</td><td align="center">Na70t</td></tr></tbody></table>

`REWARD_VALUE` and `PAYOUT` parameters are always absolute values, you will need to check status parameter to see if you need to add or subtract that amount from your users.

All values are URL encoded.

### Examples

This is how we call your postback url :

#### Without Values

```
https://example.com/api/adbreakmedia?user=[YOUR_USER_ID]&reward=[REWARD_VALUE]&offerName=[OFFER_NAME]&offerId=[OFFER_ID]&ip=[USER_IP]&status=[STATUS]&transaction_id=[TXID]&country=[COUNTRY]&is_multi=[MULTI_EVENT]&ename=[EVENT_NAME]&eid=[EVENT_ID]&hash=[HASH]&sub1=[SUB1]&sub2=[SUB2]
```

#### With Values

{% tabs %}
{% tab title="Completed" %}
{% hint style="success" %}
<https://example.com/api/adbreakmedia?user=abc123\\&coins=999\\&offerName=Lords%20Mobile\\&offerId=5620\\&ip=139.144.178.218\\&status=completed\\&transaction\\_id=1b6acc68414e699ebab37e0d5d2a17ab\\&country=US\\&is\\_multi=true\\&ename=Lords%20Mobile%20Castle%20level%207\\&eid=476ede1881042f072794e3cfb5c\\&hash=0c4c8e302e7a074a8a1c2600cd1af07505843adb2c026ea822f46d3b5a98dd1f>
{% endhint %}
{% endtab %}

{% tab title="Rejected" %}
{% hint style="danger" %}
<https://example.com/api/adbreakmedia?user=abc123\\&coins=999\\&offerName=Lords%20Mobile\\&offerId=5620\\&ip=139.144.178.218\\&status=rejected\\&transaction\\_id=1b6acc68414e699ebab37e0d5d2a17ab\\&country=US\\&is\\_multi=true\\&ename=Lords%20Mobile%20Castle%20level%207\\&eid=476ede1881042f072794e3cfb5c\\&hash=0c4c8e302e7a074a8a1c2600cd1af07505843adb2c026ea822f46d3b5a98dd1f>
{% endhint %}

> Please note that only the status will be changed to "rejected" in the callback, while all other values will remain the same. If you are using the transaction ID as a unique parameter, please ensure that you take appropriate action considering that the transaction ID will remain the same in the rejected callback.
> {% endtab %}
> {% endtabs %}

{% hint style="info" %}
&#x20;**Note :**&#x20;

Our servers expect an HTTP Status Code 200 from your Postback URL. If this response is not received from your URL, we will attempt to resend the Postback up to 5 times. There is a 1 hour delay between each attempt. After 5th attempt, you will receive a Postback failure email from us.\
\
Please be aware that the message returned by your postback endpoint should not include error messages such as `fail` or `error`. Otherwise, it will be considered a postback failure.
{% endhint %}

### Security

For enhanced security and to prevent tampering, please ensure that the postback URL used is exclusively designated for AdBreak Media. Additionally, consider whitelisting the server IP `139.144.178.218` for added protection.

You should also verify the hash received in the Postback to ensure that the call comes from our servers. Hash parameter should match SHA256 of :&#x20;

```
[YOUR_USER_ID]+[OFFER_ID]+[TXID]+[PUBLISHER_SECRET_KEY]
```

{% hint style="info" %}
To obtain your publisher secret key, please navigate to the dashboard settings/secret credentials section. Make sure to use this key for your postback verification purposes.
{% endhint %}

{% tabs %}
{% tab title="PHP" %}

```php
<?php
    function calculateSHA256Hash($data) {
        return hash('sha256', $data);
    }

    $serverIPs = ["139.144.178.218"];
    $serverIP = $_SERVER["HTTP_X_FORWARDED_FOR"] ?? $_SERVER["REMOTE_ADDR"] ?? "No Need";

    if (!in_array($serverIP, $serverIPs)) {
        http_response_code(400);
        exit("Access Denied");
    }

    $user = $_GET['user'];
    $offerId = $_GET['offerId'];
    $txid = $_GET['txid'];
    $received_hash = $_GET['hash'];

    $secret = '4bd91dc2fd97f2d2ecad9425019c179ffd26c5a866e991192ea8c43bf79e0a63';
    $calculated_hash = calculateSHA256Hash($user . $offerId . $txid . $secret);

    if ($received_hash === $calculated_hash) {
        // Your actions here
        http_response_code(200);
        echo "Approved";
    } else {
        http_response_code(400);
        echo "Unauthorized";
    }
?>

```

{% endtab %}

{% tab title="Node JS" %}

```typescript
const http = require('http');
const crypto = require('crypto');
const ipRangeCheck = require('ip-range-check');

function calculateSHA256Hash(data) {
  const hash = crypto.createHash('sha256');
  hash.update(data);
  return hash.digest('hex');
}

const server = http.createServer((req, res) => {
  const serverIPs = ["139.144.178.218"];
  let serverIP = req.headers["x-real-ip"] || req.headers["x-forwarded-for"] || "No Need";

  if (!ipRangeCheck(serverIP, serverIPs)) {
    res.writeHead(400);
    res.end("Access Denied");
    return;
  }

  const { hash, user, offerId, txid } = req.url.split('?')[1]
    .split('&')
    .reduce((acc, param) => {
      const [key, value] = param.split('=');
      acc[key] = value;
      return acc;
    }, {});

  const secret = '4bd91dc2fd97f2d2ecad9425019c179ffd26c5a866e991192ea8c43bf79e0a63';
  const generatedHash = calculateSHA256Hash(user + offerId + txid + secret);

  if (hash === generatedHash) {
    //your action here
    
    res.writeHead(200);
    res.end("Approved");
  } else {
    res.writeHead(400);
    res.end("Unauthorized");
  }
});

server.listen(3000, () => {
  console.log('Server is running on port 3000');
});

```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'digest'
require 'sinatra'
require 'ipaddr'

def calculate_sha256_hash(data)
  Digest::SHA256.hexdigest data
end

get '/endpoint' do
  server_ips = ["139.144.178.218"]
  server_ip = request.env["HTTP_X_FORWARDED_FOR"] || request.env["REMOTE_ADDR"] || "No Need"

  unless server_ips.include? server_ip
    status 400
    return "Access Denied"
  end
  
  user = params['user']
  offerId = params['offerId']
  txid = params['txid']
  received_hash = params['hash']
  
  secret = '4bd91dc2fd97f2d2ecad9425019c179ffd26c5a866e991192ea8c43bf79e0a63'
  calculated_hash = calculate_sha256_hash("#{user}#{offerId}#{txid}#{secret}")

  if received_hash == calculated_hash
    # your actions here
    status 200
    "Approved"
  else
    status 400
    "Unauthorized"
  end
end
```

{% endtab %}

{% tab title="Python" %}

```python
from flask import Flask, request, abort
import hashlib

app = Flask(__name__)

def calculate_sha256_hash(data):
    return hashlib.sha256(data.encode()).hexdigest()

@app.route('/endpoint', methods=['GET'])
def endpoint():
    server_ips = ["139.144.178.218"]
    server_ip = request.headers.get('X-Real-IP', request.remote_addr)
    
    if server_ip not in server_ips:
        abort(400, "Access Denied")

    user = request.args.get('user')
    offerId = request.args.get('offerId')
    txid = request.args.get('txid')
    received_hash = request.args.get('hash')

    secret = '4bd91dc2fd97f2d2ecad9425019c179ffd26c5a866e991192ea8c43bf79e0a63'
    calculated_hash = calculate_sha256_hash(user + offerId + txid + secret)

    if received_hash == calculated_hash:
        # Your actions here
        return "Approved", 200
    else:
        abort(400, "Unauthorized")

if __name__ == '__main__':
    app.run(debug=True)
```

{% endtab %}
{% endtabs %}

> If you encounter any difficulties while setting up the postback, please don't hesitate to reach out to us at <publishers@adbreakmedia.com>. Our team will be more than happy to assist you as soon as possible!


# Web Offerwall

Integrating Adbreakmedia's offerwall into your website is a quick and simple process, follow this guide, it just take few minutes

{% hint style="info" %}
**Quick Info :**&#x20;

Deliver personalized incentives and rewards to your users through AdBreak Media's flexible Offer Wall. Our offerwall seamlessly adapts to any screen, displaying targeted, translated ads based on user device and location.
{% endhint %}

### Integration

Obtain your placement identifier from publisher Dashboard, Determine your unique userId and use the following code to integrate :&#x20;

{% tabs %}
{% tab title="Iframe" %}

#### Without Values :&#x20;

Make sure you replace \[PLACEMENT\_IDENTIFIER] with your placement identifier and \[USER\_ID] with your unique user id.

{% code overflow="wrap" fullWidth="true" %}

```html
<iframe src="https://wall.adbreakmedia.com/[PLACEMENT_IDENTIFIER]/[USER_ID]" allow="autoplay;encrypted-media"></iframe>
```

{% endcode %}

#### With Values :&#x20;

It's just a demo, do not use this, use your own replaced values

{% code overflow="wrap" %}

```html
<iframe src="https://wall.adbreakmedia.com/demoIdentifer/k1234" allow="autoplay;encrypted-media"></iframe>
```

{% endcode %}

#### Sub Ids (Optional) :

You can pass up to 2 Sub Ids : `sub1` & `sub2` , after passing subid, the iframe may look like :&#x20;

{% code overflow="wrap" %}

```html
<iframe src="https://wall.adbreakmedia.com/[PLACEMENT_IDENTIFIER]/[USER_ID]/?sub1=[YOUR_SUB_ID1]&sub2=[YOUR_SUB_ID2]" allow="autoplay;encrypted-media"></iframe>
```

{% endcode %}

#### Recommendation :&#x20;

* `allow="autoplay;encrypted-media"` attribute for best user experience
* You can use css to define iframe height
* You can also use height / width property directly
  {% endtab %}

{% tab title="Direct Link" %}
**Without Values :**&#x20;

Make sure you replace \[PLACEMENT\_IDENTIFIER] with your placement identifier and \[USER\_ID] with your unique user id.

{% code overflow="wrap" fullWidth="true" %}

```url
https://wall.adbreakmedia.com/[PLACEMENT_IDENTIFIER]/[USER_ID]
```

{% endcode %}

#### With Values :&#x20;

It's just a demo, do not use this, use your own replaced values

```html
https://wall.adbreakmedia.com/demoIdentifer/k1234
```

#### Sub Ids (Optional) :

You can pass up to 2 Sub Ids : `sub1` & `sub2` , after passing subid, the iframe may look like :&#x20;

{% code overflow="wrap" %}

```uri
https://wall.adbreakmedia.com/[PLACEMENT_IDENTIFIER]/[USER_ID]/?sub1=[YOUR_SUB_ID1]&sub2=[YOUR_SUB_ID2]
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**Important :**\
You must user allow="autoplay;encrypted-media" in iframe, this can provider a great user experience & higher conversions to you.
{% endhint %}

To avoid any tracking-related issues, please ensure that the User Id you provide does not exceed 254 characters.


# API Reference

Dive into the specifics of each API endpoint by checking out our complete documentation.

## Offerwall API

Seamless client-side integration: no server load, enhanced user choice & experience:

{% content-ref url="/pages/5DwcSuY80AXXkMVjZ4uc" %}
[Client API](/monetization/api-reference/client-api)
{% endcontent-ref %}

## Static API

Control Offers on your own :

{% content-ref url="/pages/aYwbxUwZZ7Knfr97lVEE" %}
[Static API](/monetization/api-reference/static-api)
{% endcontent-ref %}

{% hint style="info" %}
**Good to know:** Streamline your integration process with our Offerwall API, eliminating the need for server management. As a client-side solution, you can enjoy a hassle-free experience while benefiting from automatic user choice selection powered by our advanced machine learning algorithm. Focus on providing a seamless user experience without the complexities of server handling.
{% endhint %}


# Client API

The following api is for client side only, meaning you can directly integrate our offers on your client side using javascript or similar code/framework

## Get Offers

## Get Offers

<mark style="color:blue;">`GET`</mark> `https://api.adbreakmedia.com/api/offers`

Get All active Offers directly for clientside

#### Query Parameters

| Name                                         | Type   | Description                                          |
| -------------------------------------------- | ------ | ---------------------------------------------------- |
| identifier<mark style="color:red;">\*</mark> | String | Your Placement Identifier                            |
| userId<mark style="color:red;">\*</mark>     |        | The `id` of the user                                 |
| sub1                                         |        | Extra value (it will be returned back to you)        |
| sub2                                         |        | Second Extra value (it will be returned back to you) |

{% tabs %}
{% tab title="200 Offers fetched Successfully" %}
{% tabs %}
{% tab title="Offers" %}

{% endtab %}

{% tab title="Other Params" %}

<table><thead><tr><th width="138" align="center">field</th><th width="363" align="center">Description</th><th align="center">Example</th></tr></thead><tbody><tr><td align="center">error</td><td align="center">boolean value : <code>true</code>, <code>false</code></td><td align="center">false</td></tr><tr><td align="center">message</td><td align="center">message to determine offer fetching errors</td><td align="center">Offers fetched successfully</td></tr><tr><td align="center">device</td><td align="center">User's Device based on our detection</td><td align="center">desktop</td></tr><tr><td align="center">userId</td><td align="center">The user id you passed to us</td><td align="center">1234</td></tr><tr><td align="center"></td><td align="center"></td><td align="center"></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

```json
{
  "error": false,
  "message": "Offers fetched successfully",
  "device": "desktop",
  "userId": "1234",
  "user": "c49af49767d9a0eb5c26e2c0d6aea5a58b20a87d",
  "userStatus": "active",
  "userVerification": "none",
  "placementId": 1,
  "placementStatus": "active",
  "currency": "Coins",
  "eventStatus": "inactive",
  "eventMultiplier": 1,
  "eventMessage": "",
  "offers": [
    {
      "id": 5026,
      "name": "Lords Mobile",
      "description": {
        "en": "The true Emperor has fallen. We need a real hero, a true Lord who can unite the Kingdoms. Recruit heroes from various backgrounds, from dwarves and mermaids to dark elves and steampunk robots, and assemble your army in this magical world! Fight and conquer to establish your empire in one of the strategy games!"
      },
      "payout": 9080,
      "events": [
        {
          "id": "646fe4c6753722fa9f6c621b",
          "action": {
            "en": "install , open & defeat level 2 Monster"
          },
          "payout": 9080
        }
      ],
      "epc": 0.2
      "verification": "none",
      "multipleTimes": false,
      "isFeatured": false,
      "icon": "https://play-lh.googleusercontent.com/oFz-KTIgL6yAuuA5XeHapTQLDcoBVgA9JXCTiID70rPcJBGAT9DdiqNDjNLxcYaG6W3W=s120-rw",
      "category": ["app"],
      "url": "https://api.adbreakmedia.com/api/offers/click?offerId=5026&userId=1234&placementId=1",
      "device": ["android"],
      "popularity": "80"
    }
  ]
}
```

{% endtab %}

{% tab title="400: Bad Request Missing Parameters" %}

```json
{
  "error": true,
  "message": "Missing parameters"
}
```

{% endtab %}

{% tab title="404: Not Found Placement Not Active" %}

```json
{
  "error": true,
  "message": "Placement not found or inactive"
}
```

{% endtab %}
{% endtabs %}

<table><thead><tr><th width="151" align="center">field</th><th width="317" align="center">Description</th><th align="center">Example</th></tr></thead><tbody><tr><td align="center">id</td><td align="center">ID of the Offer</td><td align="center">5026</td></tr><tr><td align="center">name</td><td align="center">Offer Name to display to the user</td><td align="center">Lords Mobile</td></tr><tr><td align="center">description</td><td align="center">Offer Description to display to the user</td><td align="center">Discover the kingdom</td></tr><tr><td align="center">payout</td><td align="center">The total payout that will be awarded for completing this Offer (your currency)</td><td align="center">9080</td></tr><tr><td align="center">events.id</td><td align="center">id of the event</td><td align="center">646fe4c6753722fa9f6c621b</td></tr><tr><td align="center">events.action</td><td align="center">predefined requirements for users to trigger conversion</td><td align="center">Defeat Level 2 Monster</td></tr><tr><td align="center">epc</td><td align="center">earning per click value of an offer</td><td align="center">0.2</td></tr><tr><td align="center">verification</td><td align="center">if user is suspicious or the offer is more sensitive on frauds, this is required, <code>none</code> , <code>id</code> , <code>phone</code> , <code>both</code></td><td align="center">none</td></tr><tr><td align="center">multipleTimes</td><td align="center">boolean value, it means if the offer can be completed multiple times or not! <code>true</code>, <code>false</code></td><td align="center">false</td></tr><tr><td align="center">isFeatured</td><td align="center">boolean value, to feature offer on top : <code>true</code>, <code>false</code></td><td align="center">true</td></tr><tr><td align="center">icon</td><td align="center">Offer icon image to display to the user</td><td align="center"><a href="https://play-lh.googleusercontent.com/oFz-KTIgL6yAuuA5XeHapTQLDcoBVgA9JXCTiID70rPcJBGAT9DdiqNDjNLxcYaG6W3W=s120-rw">https://play-lh.googleusercontent.com/oFz-KTIgL6yAuuA5XeHapTQLDcoBVgA9JXCTiID70rPcJBGAT9DdiqNDjNLxcYaG6W3W=s120-rw</a></td></tr><tr><td align="center">category</td><td align="center">category of the offer, <code>app</code>, <code>web</code> etc</td><td align="center">app</td></tr><tr><td align="center">url</td><td align="center">tracking url of the offer</td><td align="center"><a href="https://api.adbreakmedia.com/api/offers/click?offerId=5026&#x26;userId=1234&#x26;placementId=1">https://api.adbreakmedia.com/api/offers/click?offerId=5026&#x26;userId=1234&#x26;placementId=1</a></td></tr><tr><td align="center">device</td><td align="center">Array of supported device <code>android</code>, <code>ios</code>, <code>desktop</code></td><td align="center">android</td></tr><tr><td align="center">popularity</td><td align="center">score of the offer depending on it's performance from 0-100</td><td align="center">80</td></tr></tbody></table>

## Get userHistory

## Get User History

<mark style="color:blue;">`GET`</mark> `https://api.adbreakmedia.com/api/users/userHistory`

Get All user history directly for client side

#### Query Parameters

| Name                                                    | Type   | Description               |
| ------------------------------------------------------- | ------ | ------------------------- |
| placement\_identifier<mark style="color:red;">\*</mark> | String | Your Placement Identifier |
| userId<mark style="color:red;">\*</mark>                | String | The `id` of the user      |

{% tabs %}
{% tab title="200: OK History Fetched Successfully" %}
**Note:** payoutEarned param is only available on multievent offers

```
{
    "success": true,
    "history": [
        {
            "id": "c09a559ee2c3d5d9dfb8793b7af822bb4968279a",
            "offer": {
                "id": 4490,
                "name": "Earn Cash ",
                "description": {
                    "en": "Users can earn money by playing games, downloading apps or completing surveys in a modern and exciting experience."
                },
                "multiEvent": false,
                "icon": "https://main-p.agmcdn.com/tyZRqlscOW5jj3tZN8S856UzkquZXMO3Y7TMhZoE.png",
                "category": "web"
            },
            "totalPayout": 21.84,
            "isRequested": false,
            "status": "clicked",
            "createdAt": "2023-06-26T05:41:48.883Z"
        },
        {
            "id": "cf730dc9e29db3c1cf21f0d72b386b5958e4822f",
            "offer": {
                "id": 4990,
                "name": "Idle Bank",
                "description": {
                    "en": "Run your own Idle Bank games, Print money games, serve clients, give out loans and get Rich in the newest Idle Business Tycoon Games."
                },
                "multiEvent": true,
                "icon": "https://main-p.agmcdn.com/Gcx3dhMcPSqrMQ9DZbYK9MImz8aWOsuipzns4Ewy.webp",
                "category": "app"
            },
            "totalPayout": 13.747,
            "payoutEarned": 0,
            "isRequested": false,
            "status": "clicked",
            "createdAt": "2023-08-01T12:20:03.210Z"
        },
        {
            "id": "5b3723dd474e609c320a96627b7567f0e4b276bd",
            "offer": {
                "id": 66429,
                "name": "Honeygain: Make Money Online",
                "description": {
                    "en": "Start earning money by sharing your internet connection with data analysts. Honeygain allows you to reach unused internet's full potential in the most convenient way!"
                },
                "multiEvent": false,
                "icon": "https://is2-ssl.mzstatic.com/image/thumb/Purple122/v4/4f/d0/7e/4fd07e37-beff-4bd4-cbf5-cda6dba52b4f/AppIcon-0-1x_U007emarketing-0-7-0-85-220.png/512x512bb.jpg",
                "category": "web"
            },
            "totalPayout": 0.48,
            "isRequested": false,
            "status": "clicked",
            "createdAt": "2023-08-01T12:17:15.885Z"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** If you have any queries or feel difficulty in integrating our offers, reach out to our publisher support at <publishers@adbreakmedia.com> and they will help you solve your issue.
{% endhint %}


# Static API

Static APIs allow server-side data retrieval. Utilize these APIs to fetch offers directly on your server.

## Get Offers

<mark style="color:blue;">`GET`</mark> `https://api.adbreakmedia.com/api/offers/static`

Get All active Offers directly for server side\
Note : You should only call this api every few minutes, for direct client side integration use\
[Offerwall API ](/monetization/api-reference/client-api)

#### Query Parameters

| Name                                                  | Type   | Description                                                                                                          |
| ----------------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------- |
| placementIdentifier<mark style="color:red;">\*</mark> | String | You can copy this from your placement                                                                                |
| publisherKey<mark style="color:red;">\*</mark>        | String | You can copy this from dashboard setting/secret credentials                                                          |
| country                                               | String | isocode , can  separate by comma for multiple (\&country=NP,US,IN,AU,etc)                                            |
| offerId                                               | String | Id, can be separated by comma for multiple  (\&offerId=123,77672,etc)                                                |
| payout                                                | String | greater than the payout you mention (\&payout=10) will return you offers with payout greater than 10 USD             |
| category                                              | String | filter by category, you can mention multiple separated by comma (\&category=web,app,survey)                          |
| subCategory                                           | String | multiple supported by comma (\&subCategory=Game,App,Casino,Deposit,Purchase,Sweepstakes, Banking etc) case-sensitive |
| sub1                                                  | String | if you want to add some special identifier to be returned back  while getting postback                               |
| sub2                                                  | String | if you want to add some special identifier to be returned back  while getting postback                               |

{% tabs %}
{% tab title="200: OK Offers fetched Successfully" %}

```json
{
  "error": false,
  "message": "Offers fetched successfully",
  "offers": [
    {
      "id": 3484,
      "name": "Stash: Investing made easy",
      "description": {
        "en": "Invest and build wealth with Stash, the investing app helping millions of Americans invest and save for the future."
      },
      "totalPayout": 65.025,
      "events": [
        {
          "id": "6487089f3e4d2b9af6d6e500",
          "action": {
            "en": "Get the app & create an account"
          }
        },
        {
          "id": "6487089f3e4d2b9af6d6e501",
          "action": {
            "en": "create an account"
          }
        },
        {
          "id": "6487089f3e4d2b9af6d6e502",
          "action": {
            "en": "Take a subscription of $3 or $9. Complete the deposit. The reward will be credited after 3 days. New users only."
          },
          "payout": 65.025
        }
      ],
      "multiEvent": false,
      "subCategory": [
        "Purchase",
        "App"
      ],
      "trackingType": "CPA",
      "icon": "https://play-lh.googleusercontent.com/DDaJXHJIEeL3st4e-Zwlvu5BwmZBsXJ6EDn20eNeVk8BgntKw7BgNLamRUqkZImnO-NY=w480-h960-rw",
      "country": [
        "US"
      ],
      "category": "app",
      "epc": 0,
      "url": "https://api.adbreakmedia.com/api/offers/click?offerId=3484&userId=[YOUR_USER_ID]&placementIdentifier=1234",
      "device": [
        "android"
      ],
      "popularity": "0"
    },
    {
      "id": 3601,
      "name": "NordVPN – fast VPN for privacy",
      "description": {
        "en": "Get yourself an ultra-fast VPN connection and never stop for anything. Download NordVPN and you’ll get a fast and encrypted internet connection wherever you go."
      },
      "totalPayout": 7.2,
      "events": [
        {
          "id": "64870a193e4d2b9af6d6e63d",
          "action": {
            "en": " Install open and Start a free trail"
          },
          "payout": 7.2
        }
      ],
      "multiEvent": false,
      "subCategory": [
        "App"
      ],
      "trackingType": "CPI",
      "videoId": "Q1NB_jMkrrQ",
      "icon": "https://play-lh.googleusercontent.com/X8hJVUEzH6Q5N0g5npd0gz4rYPmvSek1ScQL8cmnIa8bLtXeAcRQJbLaoBAL-4YXIQ",
      "country": [
        "AU",
        "CA",
        "CZ",
        "FR",
        "DE",
        "HK",
        "JP",
        "KR",
        "SG",
        "TW",
        "GB",
        "US"
      ],
      "category": "app",
      "epc": 0.502,
      "url": "https://api.adbreakmedia.com/api/offers/click?offerId=3601&userId=[YOUR_USER_ID]&placementIdentifier=1234",
      "device": [
        "android"
      ],
      "popularity": "3"
    },
    {
      "id": 7884,
      "name": "Mafia City - Android ",
      "description": {
        "en": "Play the game and complete Mansion level 25 within 30 days."
      },
      "totalPayout": 130.68,
      "events": [
        {
          "id": "6494e191192299690b261a8f",
          "action": {
            "en": "Play the game and complete Mansion level 25 within 30 days.This offer rewards within 24 hours. New users only."
          },
          "payout": 130.68
        }
      ],
      "multiEvent": false,
      "subCategory": [
        
      ],
      "trackingType": "CPE",
      "videoId": "LxLbb5VWSOY",
      "featuredImage": "https://i.ytimg.com/vi_webp/LxLbb5VWSOY/sddefault.webp",
      "icon": "https://play-lh.googleusercontent.com/9BFW_EH7vDY4ZRRHO1bbjUVThAV4A4Fb0D6X50MCuE0fujr-WqJio9qa_IBHag0SvTY=s512-rw",
      "country": [
        "AU",
        "CA",
        "GB",
        "NZ"
      ],
      "category": "app",
      "epc": 0,
      "url": "https://api.adbreakmedia.com/api/offers/click?offerId=7884&userId=[YOUR_USER_ID]&placementIdentifier=1234",
      "device": [
        "android"
      ],
      "popularity": "1"
    }
    ]
```

{% endtab %}

{% tab title="400: Bad Request Publisher not found or inactive" %}

```json
{
    "error": true,
    "message": "Publisher not found or inactive"
}
```

{% endtab %}

{% tab title="404: Not Found Invalid Placement key or Placement is not active" %}

```json
{
  "error": true,
  "message": "Invalid Placement key or Placement is not active"
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}

#### Note:

Static APIs have a daily limit of 500 requests. To stay updated and avoid potential issues, it's recommended to make requests every 5 minutes. They are not intended for client-side offer fetching.
{% endhint %}


# Account Setup

Let us guide you through the step-by-step process of showcasing your brand and maximizing your reach with AdBreak Media.

{% hint style="warning" %}

#### REQUIREMENTS:

Before you Begin:

* Must Have an Active AdBreakMedia Advertiser Account
* All Profile information filled
  {% endhint %}

### Step 1 Update Profile Information

1. Click on `Profile` in the left Menu
2. Update your profile information

{% hint style="info" %}

#### Note:

You must fill all profile information including your contact details, it's important for us to getting in touch and help you further optimize your campaigns
{% endhint %}

### Step 2 Create a new campaign

1. Click on `Campaigns` under Pending  Offers Tab, You will see `Create Campaign` button
2. Fill the Campaign and event Details


# Create Campaign

Creating Campaign is simple and straight-forward process, let us guide you step by step on how and what to do!

### Filling information

<table><thead><tr><th width="239">Fields</th><th>Information</th></tr></thead><tbody><tr><td>Upload Icon</td><td>This option allows you to manually upload your icons</td></tr><tr><td>Icon Url</td><td>if you have direct icon url, instead of uploading the Icon, you can directly paste your icon url</td></tr><tr><td>Campaign Name</td><td>This is your app/website name for which the campaign  is running.</td></tr><tr><td>Description</td><td>The basic description of you app/website</td></tr><tr><td>Url</td><td>This is the tracking url, this is responsible for tracking conversions, check bellow on how to configure tracking url</td></tr><tr><td>Preview Url</td><td>Your App/Website direct link</td></tr><tr><td>Targetted Conversion</td><td>Number of total conversions that you are willing to get from this campaign </td></tr><tr><td>Conversions per day</td><td>This is optional, if set, your campaign  will get paused for the remaining day once the threshold is reached.</td></tr><tr><td>Targetted Country</td><td>Choose in which country you would like the campaign to show, you can choose multiple</td></tr><tr><td>Category</td><td>Choose one category depending on your app/website type</td></tr><tr><td>SubCategories</td><td>You can choose multiple subcategories, maximum 2, this describes your App/Website feature</td></tr><tr><td>Device</td><td>Choose in which devices, you would like to run your campaign </td></tr><tr><td>Start &#x26; End Date</td><td>Optional, if you would like to start or end the campaign in specific date, you can select the range of start and end date</td></tr><tr><td>Multievent</td><td>choose true/false, if selected true, you will get a button to create multiple events</td></tr><tr><td>Event-Action</td><td>Requirement of the event which leads to conversion/completion</td></tr><tr><td>Event-Payout</td><td>Amount in USD per successful conversion/completion of the specific event</td></tr><tr><td>Event-ID</td><td>On Multi-event only : this is the event id which is needed on postback, you need to return this event id on s2s postback</td></tr></tbody></table>

### Tracking URL setup

Here are the supported params for tracking url

<table><thead><tr><th width="217">Params</th><th>Description</th></tr></thead><tbody><tr><td>[YOUR_CLICK_ID]</td><td>This is the param for click id that will be passed along with your tracking url and you need to send this back though s2s postback call on each conversion/event complete.</td></tr><tr><td>[YOUR_SOURCE_ID]</td><td>This is the param for traffic source, you can use this to measure the traffic quality or ask us to increase/decrease/stop traffic on this source.</td></tr></tbody></table>

> Example Tracking Url : \
> <https://yourdomain.com/tracking?clickId=[YOUR_CLICK_ID]&source=[YOUR_SOURCE_ID]>

{% hint style="info" %}

#### Hint:

For prompt assistance with campaign setup or tracking URL configuration, please feel free to contact us at <business@adbreakmedia.com> . We are committed to providing you with timely support.
{% endhint %}


# Postback

Setting up the global postback is straightforward. See below for a detailed guide on postback setup.

{% hint style="info" %}

#### Note:

To notify us of a successful event or conversion, please call our postback endpoint. Ensure you replace the parameters listed below before making the call.
{% endhint %}

<mark style="color:blue;">`GET`</mark> `https://postback.adbreakmedia.com/api/advertisers`

You need to hit this url on each conversion

#### Query Parameters

| Name                                        | Type   | Description                                                                                                      |
| ------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------- |
| clickId<mark style="color:red;">\*</mark>   | String | The clickId that we passed to you on tracking url                                                                |
| secretKey<mark style="color:red;">\*</mark> | String | Your account secret key, this can be found on setting/api-credentials                                            |
| eventId                                     | String | this is only required if you are running multi-event campaign, it help us to determine which event got completed |

{% tabs %}
{% tab title="200: OK Success" %}
Success
{% endtab %}

{% tab title="400: Bad Request Missing Parameters" %}
Missing Parameters
{% endtab %}

{% tab title="400: Bad Request Invalid Secret Key" %}
Invalid Secret Key
{% endtab %}

{% tab title="400: Bad Request Invalid Click ID" %}
Invalid Click ID
{% endtab %}

{% tab title="400: Bad Request Missing Event Id in MultiEvent Campaign" %}
Missing Event Id in MultiEvent Campaign
{% endtab %}
{% endtabs %}

### Example Postback

{% hint style="success" %}
<https://postback.adbreakmedia.com/api/advertisers?clickId=m28rGeucSHtb2aNoMJz3HEV7PDhQym\\&secretKey=EU27kXq6DnGaHcNUhWSE6upqtGP7D7\\&eventId=1>
{% endhint %}

{% hint style="info" %}

#### Hint:

For prompt assistance with postback setup or tracking URL configuration, please feel free to contact us at <business@adbreakmedia.com> . We are committed to providing you with timely support.
{% endhint %}


# Publisher Reporting API

Track user activity & access detailed conversion/reversal info via our publisher API. Stay informed & make data-driven decisions effortlessly.

{% hint style="info" %}
Beta Note : \
This is a beta feature thus please contact your account manager. They will provide comprehensive guidance and support, ensuring a smooth integration and maximizing the benefits of this exciting new capability. Feel free to reach out to them for any questions or assistance you may need.
{% endhint %}


