rtbhouse / sdk
RTB House SDK
Installs: 33 885
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 5
Forks: 3
Open Issues: 2
Requires
- php: ^7.4 || ^8
- guzzlehttp/guzzle: ^7.5.0
Requires (Dev)
- phpunit/phpunit: ^9
README
Overview
This library provides an easy-to-use PHP interface to RTB House API. It allows you to read and manage you campaigns settings, browse offers, download statistics etc.
API docs: https://api.panel.rtbhouse.com/api/docs
Installation
RTB House SDK can be installed with composer:
$ composer require rtbhouse/sdk
Usage example
Let's write a script which fetches campaign stats (imps, clicks, postclicks) and shows the result.
First, create config.php
file with your credentials:
define('USERNAME', 'jdoe'); define('PASSWORD', 'abcd1234');
Then create example.php
with code:
require_once('vendor/autoload.php'); require_once('config.php'); $api = new \RTBHouse\ReportsApi\ReportsApiSession(USERNAME, PASSWORD); $advertisers = $api->getAdvertisers(); $stats = $api->getSummaryStats( $advertisers[0]['hash'], '2020-10-01', '2020-10-31', ['day'], ['impsCount', 'clicksCount', 'campaignCost', 'conversionsCount', 'ctr'], \RTBHouse\ReportsApi\Conversions::ATTRIBUTED_POST_CLICK ); print_r($stats);