# Authentication

All requests must include your unique <mark style="background-color:orange;">App Key</mark> & <mark style="background-color:orange;">Secret Key</mark>, Which you will find in Offer Api section of your Dashboard. As shown in below image.

<figure><img src="https://3792453041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDAvJwGUkFBKS31rzOrgN%2Fuploads%2FQXeCIf5A6q7lYoIjgJdL%2FWhatsApp%20Image%202025-08-08%20at%206.43.51%20PM.jpeg?alt=media&#x26;token=c68b369e-a21c-4439-83d6-41139a66be56" alt=""><figcaption></figcaption></figure>

## How to access the API

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.playtimeads.com/Api/Offers',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'AppKey: <YOUR_APP_KEY>',
    'AppSecretKey: <YOUR_SECRET_KEY>'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% hint style="warning" %}
Replace `“<YOUR_APP_KEY>”` and `"<YOUR_SECRET_KEY>"` with your actual keys provided in your dashboard as shown in above image.
{% endhint %}

## Example Response

```json
{
    "total_offers": 1,
    "total_page": 1,
    "page": 1,
    "limit": 1000,
    "Offers": [
        {
            "campaignId": "XXXXXX01",
            "totalPayout": 9.999,
            "status": "active",
            "campaignName": "Sample Game Campaign",
            "description": "<p>Step 1: Tap Play Now and install the app.<br />\r\nStep 2: Open the app to start.<br />\r\nStep 3: Complete the first level.<br />\r\nStep 4: Keep playing to earn more rewards!</p>\r\n",
            "model": "CPL",
            "app": {
                "title": "Sample Game",
                "packageName": "com.example.samplegame",
                "previewUrl": "https://play.google.com/store/apps/details?id=com.example.samplegame",
                "logo": "https://example.com/images/sample_logo.jpg",
                "bannerImage": "https://example.com/images/sample_thumbnail.jpg"
            },
            "currency": {
                "name": "USD",
                "symbol": "$"
            },
            "payoutEvents": [
                {
                    "event": "level_1_complete",
                    "eventTitle": "Complete Level 1",
                    "eventDesc": "",
                    "payoutAmount": 0.010,
                    "targetCaps": "0"
                },
                {
                    "event": "level_5_complete",
                    "eventTitle": "Complete Level 5",
                    "eventDesc": "",
                    "payoutAmount": 0.050,
                    "targetCaps": "0"
                },
                {
                    "event": "level_10_complete",
                    "eventTitle": "Complete Level 10",
                    "eventDesc": "",
                    "payoutAmount": 0.500,
                    "targetCaps": "0"
                },
                {
                    "event": "boss_level_complete",
                    "eventTitle": "Defeat Final Boss",
                    "eventDesc": "",
                    "payoutAmount": 1.000,
                    "targetCaps": "0"
                },
                {
                    "event": "game_completed",
                    "eventTitle": "Finish the Game",
                    "eventDesc": "",
                    "payoutAmount": 5.000,
                    "targetCaps": "0"
                }
            ],
            "targeting": {
                "os": "android",
                "countries": [
                    {
                        "iso": "US"
                    }
                ]
            },
            "tracking": {
                "clickUrl": "http://tracking.example.com/track/oa/XXXXXXX/XXXXXX01/?clickId={clickId}&gaid={gaid}&sub1={sub1}...&sub10={sub10}",
                "impressionUrl": "https://tracking.example.com/i/XXXXXX01/{publisher_id}"
            }
        }
    ]
}

```

{% hint style="success" %}
**status** – Indicates whether the offer is currently available. Value can be `active` (offer is live) or `paused` (offer is temporarily unavailable, usually due to cap being reached).
{% endhint %}

## Click Url Tracking Parameters&#x20;

| Parameter          | Description                                                                                                                                                                      |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| {clickId}          | Pass the unique user ID from your platform that distinctly identifies each user.                                                                                                 |
| {gaid}             | Pass the user’s Google Advertising ID in this parameter to enable accurate tracking and attribution.                                                                             |
| {sub1}  to {sub10} | These are optional parameters that allow the publisher to send custom user information, which will be returned in same parameter in postback to help identify or track the user. |
