artistan/revive-xmlrpc

package of the library classes to provide XmlRpc routines for accessing revive ad servers

v2.3.4 2018-10-05 14:47 UTC

This package is auto-updated.

Last update: 2024-12-24 08:55:59 UTC


README

remote procedure calls - RPC - is a basic API that has existed on Revive since it was OpenX Source. This is a basic update to that system and extracted into a package which can be used in virtually any Php Project to access your Revive server or manage multiple Revive servers. The response data is not exactly pretty for Ads Display, but hopefully I can come up with a version 3 that format the data into a more friendly format.

Revive AdServer xml api

extracted into a package and updated to use packages rather than pear

requires

  • php-xml

uses

SETUP

composer

    "require": {
        "artistan/revive-xmlrpc": "*"
    }

Using The API

phpdoc documentation

Version 2 xml

these examples were tested in Laravel 5.6 Commands

configuration

loads definitions in this order each step will override/replace the previous step

  1. loads /Assets/Config/revive-xmlrpc.php (defaults)
  2. laravel style configs (if function config exists)
  3. constructor array settings (first param can be an array)
  4. constructor individual settings
laravel config/env
php artisan vendor:publish --provider=artistan/revive-xmlrpc

you can edit the config/revive-xmlrpc.php file add these env variables to or .env files

RVRPC_HOST=ads.me.com
RVRPC_BASEPATH=/api/v2/xmlrpc/
RVRPC_USERNAME=admin
RVRPC_PASSWORD=~test~
RVRPC_PORT=0
RVRPC_SSL=1
RVRPC_TIMEOUT=15
use Artistan\ReviveXmlRpc\OpenAdsV2ApiXmlRpc;
$rpc = new OpenAdsV2ApiXmlRpc();
$list = $rpc->getAgencyList();
custom config initialization

uses ./Assets/Config/revive-xmlrpc.php for config if you do not provide it to the class.

use Artistan\ReviveXmlRpc\OpenAdsV2ApiXmlRpc;

$config = [
	'host'=>'ads.me.com', 
	'basepath'=>'/www/api/v2/xmlrpc/',
	'username'=>'admin', 
	'password'=>'~test~', 
	'port'=>0, 
	'ssl'=>true, 
	'timeout'=>15
]


$rpc = new OpenAdsV2ApiXmlRpc($config);
$list = $rpc->getAgencyList();
full initialization
use Artistan\ReviveXmlRpc\OpenAdsV2ApiXmlRpc;
$rpc = new OpenAdsV2ApiXmlRpc('ads.me.com', '/www/api/v2/xmlrpc/', 'admin', '~test~', 0, true, 15);
$list = $rpc->getAgencyList();

API Version 1 xml

use Artistan\ReviveXmlRpc\OpenAdsV1ApiXmlRpc;
$rpc = new OpenAdsV1ApiXmlRpc('ads.me.com', '/www/api/v1/xmlrpc/', 'admin', '~test~', 0, true, 15);
$list = $rpc->getAgencyList();

Ad Display Retrieval xml

        $rpc = new OpenAdsDisplayXmlRpc('ads.me.com', '/www/delivery/axmlrpc.php', 443, true, 15);
        $rpc->setRemoteInfo('remote_addr', 'chuck-dev');
        $list = $rpc->view(
        	/* string    zone */ 'zone:1', 
        	/* int campaignid */ 0, 
        	/* string  target */ '', 
        	/* string  source */ '', 
        	/* 0|1   withText */ 0, 
        	/* array  contect */ [], 
        	/* strubg charset */ ''
		);
        var_dump(json_decode(json_encode($list),true));

Documentation Updates

PHP-Markdown-Documentation-Generator

./vendor/bin/phpdoc-md generate --ignore=test,examples src > api.md