Skip to content

openx/ODS-Python-API-Client

Repository files navigation

For OpenX Reporting access using the Python API Client you will need: (examples come from an Ubuntu machine)

1. Your credentials:

  • consumer_key,
  • consumer_secret,
  • email address and password for your user of your OpenX instance.

2. install Python

Update the package list $ sudo apt update

Install python3 and pip $ sudo apt install python3 python3-pip python3-dev

3. Clone the library into your working directory:

$ git clone https://github.com/openx/ODS-Python-API-Client

4. Go to the downloaded repository and install the library:

$ python3 setup.py install

Now, set up your Python API Client.

5. Edit 'my_creds.py' file - add your credentials.

6. Edit 'report_config.py' file - place your request body into the 'settings' variable.

The "settings" variable is responsible for the request body; in there you can place any specific dates / hours / attributes and metrics that will define your report. That particular example uses "Inv_perf_pub" report template for the 15th of June 2019. For more information visit http://openxcorporate-ui3.openxenterprise.com/data/1.0/ods.html .

If you want to find out what is the date range available for the selected report - please make sure you have the same metrics and attributes in the "data_range" variable as you have in the "settings" variable.

6a. Edit 'post_config.py' file - place your request body into the 'settings' variable.

The "settings" variable is responsible for the request body; in there you can place specific attributes to create any UI item, e.g. an ad unit. For more information visit https://docs.openx.com/Content/developers/platform_api/api_ref.html

7. Run the python script

  • 'pull_fields.py' to see all the available fields

$ python3 pull_fields.py

  • 'date_range.py' to check what is the available date range for selected report (earliest possible StartData, closest possible EndDate)

$ python3 pull_report.py

  • 'pull_reports.py' to pull your report

$ python3 pull_report.py

  • 'ox_post.py' to send a request to our legacy endpoint, can be used to create UI items, e.g. an ad unit.

$ python3 ox_post.py

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages