Requirements:
- php and apache2
- php composer
- zend framework 2
-
Update Ubuntu
$ apt-get update && apt-get upgrade
-
Install required packages:
$ sudo apt-get install apache2 php
$ sudo apt-get install php-cli
$ sudo apt-get install php7.2-mbstring
$ sudo apt-get install php7.2-dom
$ sudo apt-get install php7.2-ldap
$ sudo apt-get install zip unzip
- Use the command "php --ini" to identify which config file your php uses. Then edit it (with sudo!) Please make sure to adjust the following:
max_execution_time
max_input_time
default_socket_timeout
to a higher number (eg. 240) so that PHP won't kill the script during it's execution (in case of large reports).
- Install PHP Composer
$ curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo chmod +x /usr/local/bin/composer
-
Clone php client repository into your workspace
$ git clone https://github.com/openx/ODS-PHP-API-Client
-
Install required dependencies with composer
$ composer install
-
Configure set_path.php file
- the value of '$path1' variable should point to 'vendor' directory in your workspace
- Add your credentials in pull_fields.php, date_range.php, pull_report.php and ox_post.php files
- Adjust the settings of your report in the following variable: $myJson
- Adjust the settings of your account/site/adunit in the following variable: $adunit_query
DONE
-
Run pull_fields.php to see available fields
$ php pull_fields.php
-
Run date_range.php to see available timeframe for selected attributes and metrics
$ php pull_fields.php
-
Run pull_report.php to see pull your report
$ php pull_report.php
-
Run ox_post.php to create an account/adunit etc
$ php ox_post.php