# Client API

## 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.adbreakmedia.com/monetization/api-reference/client-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
