oas_basic_inventory: Retrieve Basic Inventory Reports

Description Usage Arguments Value Examples

Description

This function returns a data.frame of inventory statistics for 18 different report types

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
oas_basic_inventory(credentials, 
                               report_type=c('Configuration', 'Overview',
                                   'Campaign', 'Campaign.Detail',
                                   'Page', 'Page.Detail', 
                                   'Position', 'Position.Detail',
                                   'Section', 'Section.Detail',
                                   'Site', 'Site.Detail',
                                   'PageAtPosition', 'PageAtPosition.Detail',
                                   'SectionAtPosition', 'SectionAtPosition.Detail',
                                   'SiteAtPosition', 'SiteAtPosition.Detail'), 
                               report_name,
                               keywords=NULL,
                               position=NULL,
                               id=NULL,
                               start_date=NULL,
                               end_date=NULL)

Arguments

credentials

a character string as returned by oas_build_credentials

report_type

a character string in one of eighteen supported inventory report types

report_name

a character string of the report name. Please see the dataset inventory_reports and filter to inventory_type=="basic" for a complete list of available report_type and report_name combinations for this function.

keywords

a character string containing comma separated keywords value for filtering inventory report.

position

a character vector containing position names. Multiple "position" elements be specified at once, hence a vector is accepted instead of a string

id

a character string This element is used for defining id (Campaign, Site, Page, Section) for inquiring the inventory detail report. Only necessary for detail report types (e.g. Position.Detail)

start_date

a character string for inquiring inventory detail report. This field is optional and must be in the yyyy-mm-dd format.

end_date

a character string for inquiring the inventory detail report by given schedule. This field is optional and must be in the yyyy-mm-dd format.

Value

A data.frame of inventory data in the format of the specified report_type and report_name

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
my_credentials <- build_credentials('myaccount', 
                                    'myusername', 
                                    'mypassword')
config <- oas_basic_inventory(credentials=my_credentials, 
                                  report_type='Configuration', 
                                  report_name='Configuration')
# note that forecast start and end dates must be greater than or equal to 
Sys.Date() otherwise it will return a 0 row data.frame
overview <- oas_basic_inventory(credentials=my_credentials, 
                                    report_type='Overview', 
                                    report_name='All Sites Forecast',
                                    start_date='2015-12-01', 
                                    end_date='2015-12-31')
# leaving position argument NULL means all positions are returned
# specifying the position argument NULL means only those will be returned
page_pos_forecast <- oas_basic_inventory(credentials=my_credentials, 
                                         report_type='PageAtPosition.Detail',
                                         report_name='Detail Forecast',
                                         id='www.site.com/page@x01', 
                                         start_date='2015-12-01', 
                                         end_date='2015-12-31')                                  

## End(Not run)

ReportMort/roas documentation built on May 9, 2019, 9:45 a.m.