PHPackages                             sohaibilyas/sedotmp-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sohaibilyas/sedotmp-php

ActiveLibrary[API Development](/categories/api)

sohaibilyas/sedotmp-php
=======================

PHP SDK for SedoTMP - Sedo Traffic Monetization Platform (sedotmp.com).

v0.2.7(4mo ago)088MITPHPPHP ^8.2.0CI passing

Since Oct 23Pushed 4mo agoCompare

[ Source](https://github.com/sohaibilyas/sedotmp-php)[ Packagist](https://packagist.org/packages/sohaibilyas/sedotmp-php)[ RSS](/packages/sohaibilyas-sedotmp-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (12)Used By (0)

SedoTMP PHP SDK
===============

[](#sedotmp-php-sdk)

A simple PHP SDK for interacting with SedoTMP - Sedo Traffic Monetization Platform (sedotmp.com).

> **Requires [PHP 8.2+](https://php.net/releases/)**

Installation
------------

[](#installation)

Install via [Composer](https://getcomposer.org):

```
composer require sohaibilyas/sedotmp-php
```

Usage
-----

[](#usage)

### Getting Started

[](#getting-started)

```
use SohaibIlyas\SedoTmp\SedoTmp;

$client = new SedoTmp('your-client-id', 'your-client-secret');
```

### Authentication

[](#authentication)

#### Getting a New Access Token

[](#getting-a-new-access-token)

Call `getAccessToken()` to fetch and cache an access token:

```
$client = new SedoTmp('your-client-id', 'your-client-secret');

$token = $client->getAccessToken();

$categories = $client->content()->getCategories();
$campaigns = $client->platform()->getContentCampaigns(0);
```

#### Using an Existing Access Token

[](#using-an-existing-access-token)

If you already have a token (e.g., from cache or session), use `setAccessToken()` to avoid making an authentication request:

```
$client = new SedoTmp('your-client-id', 'your-client-secret');
$client->setAccessToken('your-existing-token');

$categories = $client->content()->getCategories();
```

#### Complete Example with Token Caching

[](#complete-example-with-token-caching)

```
$client = new SedoTmp('your-client-id', 'your-client-secret');

if (isset($_SESSION['sedo_token'])) {
    $client->setAccessToken($_SESSION['sedo_token']);
} else {
    $token = $client->getAccessToken();
    $_SESSION['sedo_token'] = $token;
}

$categories = $client->content()->getCategories();
$campaigns = $client->platform()->getContentCampaigns(0);
```

### Content API

[](#content-api)

#### Get Categories

[](#get-categories)

```
$categories = $client->content()->getCategories();
```

### Platform API

[](#platform-api)

#### Get Content Campaigns

[](#get-content-campaigns)

Retrieve content campaigns with pagination:

```
$campaigns = $client->platform()->getContentCampaigns(page: 0);
```

#### Get Single Content Campaign

[](#get-single-content-campaign)

Retrieve a specific content campaign by ID:

```
$campaign = $client->platform()->getContentCampaign('310a2938-6824-4bf9-afdf-994c3a673864');
```

#### Create Content Campaign

[](#create-content-campaign)

Create a new content campaign:

```
$campaignData = [
    'publishDomainName' => 'sohaibilyas.com',
    'article' => [
        'country' => 'US',
        'locale' => 'en',
        'featuredImage' => [
            'generate' => true
        ],
        'title' => 'Summer vacation',
        'excerpt' => 'The best summer vacation deals',
        'topics' => ['Summer vacation'],
        'categoryId' => '2e5c8fbb-f078-498b-82e5-d45263e21f67',
        'type' => 'CreateArticle',
    ],
    'campaign' => [
        'name' => 'Summer vacation',
        'trackingData' => [
            'trafficSource' => 'META',
            'trackingSettings' => [
                'type' => 'PixelMetaTrackingSettings',
                'pixelMetaPixelId' => '012345678910',
                'pixelMetaLandingPageEvent' => 'Subscribe',
                'pixelMetaClickEvent' => 'Purchase'
            ],
            'trackingMethod' => 'PIXEL'
        ],
        'type' => 'CreateCampaign'
    ],
];

$result = $client->platform()->createContentCampaign($campaignData);
```

#### Get Campaign Report

[](#get-campaign-report)

Retrieve campaign report data with dimensions, filters, sorting, and pagination:

```
$report = $client->platform()->getCampaignReport(
    dimensions: ['DATE', 'HOUR', 'COUNTRY'],
    filter: [
        'startDate' => ['year' => 2024, 'month' => 1, 'day' => 1],
        'endDate' => ['year' => 2024, 'month' => 1, 'day' => 31],
        'campaignId' => '310a2938-6824-4bf9-afdf-994c3a673864',
    ],
    sort: 'CLICKS,asc',
    pagination: ['page' => 0, 'size' => 10]
);
```

**Available dimensions:**

- `DATE`
- `HOUR`
- `PARTNER`
- `CAMPAIGN_ID`
- `COUNTRY`
- `DEVICE_TYPE`

**Available sort fields:**

- `RELATED_LINKS_REQUESTS`
- `RELATED_LINKS_IMPRESSIONS`
- `RELATED_LINKS_CLICKS`
- `RELATED_LINKS_RPM`
- `AD_REQUESTS`
- `MATCHED_AD_REQUESTS`
- `AD_IMPRESSIONS`
- `IMPRESSIONS`
- `CLICKS`
- `CTR`
- `AD_CTR`
- `CPC`
- `AD_RPM`
- `CONVERSION_RATE`
- `REVENUE`
- `DATE`
- `HOUR`
- `PARTNER`
- `CAMPAIGN_ID`
- `COUNTRY`
- `DEVICE_TYPE`

**Pagination options:**

Use page-based pagination:

```
$report = $client->platform()->getCampaignReport(
    pagination: ['page' => 0, 'size' => 10]
);
```

Or use offset-based pagination:

```
$report = $client->platform()->getCampaignReport(
    pagination: ['offset' => 0, 'limit' => 100]
);
```

**Note:** If neither `startDate` nor `endDate` is provided in the filter, they will default to yesterday's date.

#### Get Keyword Performance Report

[](#get-keyword-performance-report)

Retrieve keyword performance data with dimensions, filters, sorting, and pagination:

```
$report = $client->platform()->getKeywordPerformanceReport(
    dimensions: ['DATE', 'COUNTRY', 'DEVICE_TYPE'],
    filter: [
        'startDate' => ['year' => 2024, 'month' => 1, 'day' => 1],
        'endDate' => ['year' => 2024, 'month' => 1, 'day' => 31],
    ],
    sort: 'CLICKS,desc',
    pagination: ['page' => 0, 'size' => 50]
);
```

**Available dimensions:**

- `DATE`
- `PARTNER`
- `CAMPAIGN_ID`
- `COUNTRY`
- `DEVICE_TYPE`

### Postback Templates

[](#postback-templates)

Postback templates define reusable S2S callback configurations for conversion events.

#### Get All Postback Templates

[](#get-all-postback-templates)

```
$templates = $client->platform()->getPostbackTemplates();

$templates = $client->platform()->getPostbackTemplates(
    filter: ['name' => 'My Template'],
    page: ['page' => 0, 'size' => 10, 'sort' => 'name,asc']
);
```

#### Get Single Postback Template

[](#get-single-postback-template)

```
$template = $client->platform()->getPostbackTemplate('cf1a429f-e596-4648-83a2-5a3045b2276a');
```

#### Create Postback Template

[](#create-postback-template)

```
$template = $client->platform()->createPostbackTemplate([
    'name' => 'My Postback Template',
    'postbacks' => [
        [
            'eventName' => 'CLICK',
            'url' => 'https://your-tracker.com/postback?click_id={click_id}&payout={epayout}',
            'clickIdParam' => 'click_id',
        ],
        [
            'eventName' => 'SEARCH',
            'url' => 'https://your-tracker.com/postback?click_id={click_id}&event=search',
            'clickIdParam' => 'click_id',
        ],
    ],
]);
```

#### Update Postback Template

[](#update-postback-template)

```
$template = $client->platform()->updatePostbackTemplate('cf1a429f-e596-4648-83a2-5a3045b2276a', [
    'name' => 'Updated Template Name',
    'postbacks' => [
        [
            'eventName' => 'CLICK',
            'url' => 'https://your-tracker.com/postback?click_id={click_id}',
            'clickIdParam' => 'click_id',
        ],
    ],
]);
```

#### Delete Postback Template

[](#delete-postback-template)

```
$client->platform()->deletePostbackTemplate('cf1a429f-e596-4648-83a2-5a3045b2276a');
```

### Traffic Source Templates

[](#traffic-source-templates)

Traffic source templates define reusable tracking configurations for different traffic sources.

#### Get All Traffic Source Templates

[](#get-all-traffic-source-templates)

```
$templates = $client->platform()->getTrafficSourceTemplates();

$templates = $client->platform()->getTrafficSourceTemplates(
    filter: ['name' => 'Meta Template'],
    page: ['page' => 0, 'size' => 10]
);
```

#### Get Single Traffic Source Template

[](#get-single-traffic-source-template)

```
$template = $client->platform()->getTrafficSourceTemplate('cf1a429f-e596-4648-83a2-5a3045b2276a');
```

#### Create Traffic Source Template

[](#create-traffic-source-template)

```
$template = $client->platform()->createTrafficSourceTemplate([
    'name' => 'Meta Pixel Template',
    'trafficSource' => 'META',
    'trackingMethod' => 'PIXEL',
    'trackingSettings' => [
        'type' => 'PixelMetaTrackingSettings',
        'pixelMetaPixelId' => '012345678910',
        'pixelMetaLandingPageEvent' => 'Subscribe',
        'pixelMetaClickEvent' => 'Purchase',
    ],
]);
```

#### Update Traffic Source Template

[](#update-traffic-source-template)

```
$template = $client->platform()->updateTrafficSourceTemplate('cf1a429f-e596-4648-83a2-5a3045b2276a', [
    'name' => 'Updated Meta Template',
    'trafficSource' => 'META',
    'trackingMethod' => 'S2S',
    'trackingSettings' => [
        'type' => 'S2sMetaTrackingSettings',
        's2sMetaPixelId' => '012345678910',
        's2sMetaAccessToken' => 'your-access-token',
    ],
]);
```

#### Delete Traffic Source Template

[](#delete-traffic-source-template)

```
$client->platform()->deleteTrafficSourceTemplate('cf1a429f-e596-4648-83a2-5a3045b2276a');
```

### Using Templates with Content Campaigns

[](#using-templates-with-content-campaigns)

You can reference templates when creating content campaigns to automatically apply pre-configured tracking settings:

```
$campaignData = [
    'publishDomainName' => 'example.com',
    'article' => [
        'country' => 'US',
        'locale' => 'en',
        'featuredImage' => ['generate' => true],
        'title' => 'Summer vacation deals',
        'topics' => ['Summer vacation'],
        'categoryId' => '2e5c8fbb-f078-498b-82e5-d45263e21f67',
        'type' => 'CreateArticle',
    ],
    'campaign' => [
        'name' => 'Summer Campaign',
        'trackingData' => [
            'trafficSourceTemplateId' => 'cf1a429f-e596-4648-83a2-5a3045b2276a',
            'postbackTemplateId' => 'df2b530g-f697-5759-94b3-6b4156c3387b',
        ],
        'type' => 'CreateCampaign',
    ],
];

$result = $client->platform()->createContentCampaign($campaignData);
```

You can also reference templates by name:

```
$campaignData = [
    'publishDomainName' => 'example.com',
    'article' => [
        'country' => 'US',
        'locale' => 'en',
        'featuredImage' => ['generate' => true],
        'title' => 'Winter sale promotions',
        'topics' => ['Winter sale'],
        'categoryId' => '2e5c8fbb-f078-498b-82e5-d45263e21f67',
        'type' => 'CreateArticle',
    ],
    'campaign' => [
        'name' => 'Winter Campaign',
        'trackingData' => [
            'trafficSourceTemplateName' => 'Meta Pixel Template',
            'postbackTemplateName' => 'My Postback Template',
        ],
        'type' => 'CreateCampaign',
    ],
];

$result = $client->platform()->createContentCampaign($campaignData);
```

### Custom Configuration

[](#custom-configuration)

You can optionally provide custom API version, base URL, and auth URL:

```
$client = new SedoTmp(
    'your-client-id',
    'your-client-secret',
    'v1',
    'https://custom-api.sedotmp.com',
    'https://custom-auth.sedotmp.com/oauth/token'
);
```

Development
-----------

[](#development)

### Testing

[](#testing)

All tests use mocked HTTP clients - no real API calls are made during testing.

Run unit tests using **PEST**:

```
composer test:unit
```

Run the entire test suite:

```
composer test
```

### Code Quality

[](#code-quality)

Keep a modern codebase with **Pint**:

```
composer lint
```

Run refactors using **Rector**:

```
composer refactor
```

Run static analysis using **PHPStan**:

```
composer test:types
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance82

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Recently: every ~14 days

Total

11

Last Release

126d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/91eefecd8eabffbdfd3ff58d10e368db20321e199f3ecf1c37365cfdcc85e175?d=identicon)[sohaibilyas](/maintainers/sohaibilyas)

---

Top Contributors

[![sohaibilyas](https://avatars.githubusercontent.com/u/7788998?v=4)](https://github.com/sohaibilyas "sohaibilyas (12 commits)")

---

Tags

phpapisdkmonetizationtrafficsedotmpsedo

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sohaibilyas-sedotmp-php/health.svg)

```
[![Health](https://phpackages.com/badges/sohaibilyas-sedotmp-php/health.svg)](https://phpackages.com/packages/sohaibilyas-sedotmp-php)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M23](/packages/php-opencloud-openstack)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
