For OpenX API access using the Ruby API Client you will need:
- consumer_key,
- consumer_secret,
- email address and password for your user of your OpenX instance.
- install ruby
$ sudo apt-get install ruby
$ sudo gem install oauth
$ sudo gem install json
$ sudo gem install awesome_print
$ git clone https://github.com/openx/ODS-Ruby-API-Client.git
-
Place your credentials into the 'cfg' variables, and your request body in 'my_settings' variable. You'll find some requests at http://openxcorporate-ui3.openxenterprise.com/data/1.0/ods.html
-
If you want to know, what is the available date range for selected report, please adjust the 'date_range' variable to reflect 'my_settings".
-
Adjust 'my_post_settings' variable to create a valid site/adunit etc.
(you can use this online tool https://www.freeformatter.com/json-escape.html to escape your strings)
- 'pull_fields.rb' to receive all available fields
$ruby pull_fields.rb
- 'date_range.rb' to check what is the available date range for selected report (earliest possible StartDate, closest possible EndDate)
$ruby date_range.rb
- 'pull_report.rb' to receive your report
$ruby pull_report.rb
- 'ox_post.rb' to create your adunit/site etc.
$ruby ox_post.rb