{"id":17153877,"url":"https://github.com/stevenmmortimer/roas","last_synced_at":"2025-07-16T09:36:48.482Z","repository":{"id":95730508,"uuid":"44409233","full_name":"StevenMMortimer/roas","owner":"StevenMMortimer","description":"This R package connects the Open Ad Stream (OAS) API from R","archived":false,"fork":false,"pushed_at":"2017-04-28T20:29:20.000Z","size":125,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T13:25:15.441Z","etag":null,"topics":["ad-server","api-wrapper","open-ad-stream","r"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StevenMMortimer.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-16T20:35:46.000Z","updated_at":"2023-01-21T19:46:41.000Z","dependencies_parsed_at":"2023-05-21T19:30:13.085Z","dependency_job_id":null,"html_url":"https://github.com/StevenMMortimer/roas","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/StevenMMortimer/roas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StevenMMortimer%2Froas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StevenMMortimer%2Froas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StevenMMortimer%2Froas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StevenMMortimer%2Froas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StevenMMortimer","download_url":"https://codeload.github.com/StevenMMortimer/roas/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StevenMMortimer%2Froas/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265500344,"owners_count":23777464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ad-server","api-wrapper","open-ad-stream","r"],"created_at":"2024-10-14T21:47:34.376Z","updated_at":"2025-07-16T09:36:48.457Z","avatar_url":"https://github.com/StevenMMortimer.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput:\n  md_document:\n    variant: markdown_github\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n\u003ca href=\"https://travis-ci.org/ReportMort/roas\" target=\"_blank\"\u003e\u003cimg src=\"https://travis-ci.org/ReportMort/roas.svg?branch=master\" alt=\"Build Status\" style=\"margin-left: 5px;\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://codecov.io/github/ReportMort/roas?branch=master\" target=\"_blank\"\u003e\u003cimg src=\"https://codecov.io/github/ReportMort/roas/coverage.svg?branch=master\" alt=\"codecov.io\" style=\"margin-left: 5px;\"/\u003e\u003c/a\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\nOpen Ad Stream API from R\n-------------------\n\nInteract with the Open Ad Stream (OAS) API from R\n\nFeatures:\n\n-   oas_build_credentials(): One-time create authentication credentials and re-use\n-   oas_list(): List OAS Objects into data.frame\n-   oas_read(): Read all fields on an OAS Object\n-   oas_add(): Add new OAS Objects\n-   oas_update(): Update fields on an OAS Object\n-   oas_copy(): Copy an OAS Object (Campaigns and Creative Targets Only)\n-   oas_run_live(): Perform 3 Run Live Campaign Operations\n-   oas_report(): Run over 800 different template reports\n      -  Campaign Delivery\n      -  Account Revenue\n      -  More...\n-   oas_basic_inventory(): Run inventory reports over 18 different types \n      -  Site\n      -  Section\n      -  Campaign\n      -  More...\n-   oas_search_inventory(): Run inventory reports based on keyword search terms\n-   oas_geo_inventory(): Run Site or Secton inventory across geography types \n      - Country\n      - State\n      - Postal Code\n      - DMA\n      - More...\n-   oas_zone_inventory(): Run zone inventory reports for a site\n\n## Install from Github using devtools\n\n``` r\ndevtools::install_github('ReportMort/roas')\n```\n\n``` r\nlibrary('roas')\n```\n\n## Settings\n\nThere is a set of 8 package options. These may need to be configured\nbased on your API instance. Set them using the `options()` function.\n\n``` r\n\n# defaults\nroas.account = NULL\nroas.username = NULL\nroas.password = NULL\nroas.url_endpoint = \"https://openadstream18.247realmedia.com/oasapi/OaxApi\"\nroas.namespace = \"https://api.oas.tfsm.com/\"\nroas.service_name = \"OaxApiService\"\nroas.port_name = \"OaxApiPort\"\nroas.method_name = \"OasXmlRequest\"\n\n# setting authentication parameters\noptions(roas.account = \"myaccountname\")\noptions(roas.username = \"myusername\")\noptions(roas.password = \"mypassword\")\n\n# setting a new endpoint to use for requests\noptions(roas.url_endpoint = \"https://openadstream11.247realmedia.com/oasapi/OaxApi\")\n\n```\n\n## Functions\n\nThe functions are named to mimic each OAS request action ('Add', 'List', 'Update', \n'Delete', 'Read', 'Copy', 'Upload', 'Run Live', 'Reports', 'Inventory'), but \nmany of these actions are reserved words, so the functions are named {oas_action}(). \nFor example, running the 'List' action is done with the function oas_list().\n\n## Examples\n\n### oas_build_credentials()\n\nBuild credentials for authorization and pass them into subsequent request function calls. The credentials \ncan be reused as many times as needed.\n\n``` r\nmy_credentials \u003c- oas_build_credentials('myaccount', 'myusername', 'mypassword')\n```\n\n### oas_list()\n\nList all sites in your account.\n\n``` r\nlist_of_sites \u003c- oas_list(credentials=my_credentials, request_type='Site')\n```\n\nList all pages with a particular search criteria.\n\n``` r\nlist_w_criteria \u003c- oas_list(credentials=my_credentials, request_type='Page', \n                                search_criteria_attributes = c(pageSize=100), \n                                search_criteria=list(newXMLNode(\"Domain\", \"mySite\"), \n                                                     newXMLNode(\"Url\", \"001\"), \n                                                     newXMLNode(\"SectionId\", \"Ar%ves\"), \n                                                     newXMLNode(\"SiteId\", \"ApiSite\"), \n                                                     newXMLNode(\"Description\", \"My Page\"), \n                                                     newXMLNode(\"LocationKey\", \"7\"), \n                                                     newXMLNode(\"WhenCreated\", \n                                                                attrs = c(condition = \"GT\"), \n                                                                '2014-12-31'), \n                                                     newXMLNode(\"WhenModified\", \n                                                                attrs = c(condition = \"GT\"), \n                                                                '2013-12-31')))\n```\n\n\n### oas_list_code()\n\nList DMA Codes\n\n```r\ndma_codes \u003c- oas_list_code(credentials=my_credentials, code_type='DMA')\n```\n\nList City Codes for the US\n\n```r\nsearch_criteria_node \u003c- NULL\ncountry_criteria_node \u003c- newXMLNode(\"Country\", parent = search_criteria_node)\ncountry_code_node \u003c- newXMLNode(\"Code\", \"US\", parent = country_criteria_node)\nus_city_codes \u003c- oas_list_code(credentials=my_credentials, code_type='City', \n                                   search_criteria_attributes = c(pageSize=\"20000\"), \n                                   search_criteria=list(country_code_node))\n```\n\n### oas_read()\n\nRetrieve all available fields on a site and a particular campaign\n\n``` r\nsite_details \u003c- oas_read(credentials=my_credentials, \n                             request_type='Site', \n                             id='www.mysite.com')\ncampaign_details \u003c- oas_read(credentials=my_credentials, \n                                 request_type='Campaign', \n                                 id='one_campaign_id')\n```\n\n### oas_add()\n\nAdd a new Advertiser\n\n``` r\nadver_add \u003c- oas_add(credentials=my_credentials, \n                           request_type='Advertiser', \n                           update_data=list(addChildren(\n                                            newXMLNode('Advertiser'), \n                                               list(newXMLNode('Id', 'MyAdvertiserId'), \n                                                    newXMLNode('ContactTitle', 'new Title')))))\n```\n\n### oas_update()\n\nUpdate an Advertiser or Update a Campaign\n\n``` r\nadver_update \u003c- oas_update(credentials=my_credentials, \n                           request_type='Advertiser', \n                           update_data=list(addChildren(\n                                            newXMLNode('Advertiser'), \n                                               list(newXMLNode('Id', 'thisadvertiserid'), \n                                                    newXMLNode('ContactTitle', 'new Title')))))\n                                            \ncampaign_update \u003c- oas_update(credentials=my_credentials, \n                              request_type='Campaign', \n                              update_data=list(addChildren(\n                                               newXMLNode('Overview'), \n                                               list(newXMLNode('Id', 'myExistingCampaignId'), \n                                                    newXMLNode('Status', 'L'),\n                                                    addChildren(\n                                                     newXMLNode('CompetitiveCategories'),\n                                                     list(newXMLNode('CompetitiveCategoryId','Airlines'), \n                                                          newXMLNode('CompetitiveCategoryId','Travel')))))))\n```\n\n### oas_copy()\n\nCopy an existing campaign\n\n``` r\ncampgn_copy \u003c- oas_copy(credentials=credentials, \n                        request_type='Campaign', \n                        copy_data=list(newXMLNode('Id', 'oldCampaignId'), \n                                         newXMLNode('NewId', 'newCampaignId'), \n                                         newXMLNode('CopyCreatives', 'Y'), \n                                         newXMLNode('CopyNotifications', 'Y'), \n                                         newXMLNode('CopyScheduling', 'Y'), \n                                         newXMLNode('CopyTargeting', 'Y'),\n                                         newXMLNode('CopyBilling', 'Y'), \n                                         newXMLNode('CopyPages', 'Y'), \n                                         newXMLNode('CopySiteTiers', 'Y'), \n                                         newXMLNode('CopyConversionProcesses', 'Y')))\n```\n\n### oas_run_live()\n\nUse the Test Live Campaigns Operation\n\n``` r\ntlc_details \u003c- oas_run_live(credentials=my_credentials, \n                            action='TestLiveCampaigns')\n```\n\n### oas_report()\n\nRetrieve a template executive summary report on campaign delivery\n\n``` r\ncampaign_delivery \u003c- oas_report(credentials=my_credentials, \n                                    report_type='Campaign Delivery',\n                                    report_name='Executive Summary',\n                                    start_date='2015-09-01', \n                                    end_date='2015-09-30')\n```\n\n### oas_basic_inventory()\n\nRetrieve an inventory forecast for all sites\n\n``` r\n\n# Note that start and end dates must be greater than or equal to \n# Sys.Date() otherwise forecast reprots will return a 0 row data.frame\noverview \u003c- oas_basic_inventory(credentials=my_credentials, \n                                    report_type='Overview', \n                                    report_name='All Sites Forecast',\n                                    start_date='2015-12-01', \n                                    end_date='2015-12-31')\n```\n\n\n### oas_search_inventory()\n\nRetrieve booked inventory based on two keywords (Kw1, Kw2) \nfor a particular campaign on a site\n\n``` r\n\nbooked \u003c- oas_search_inventory(credentials=my_credentials, \n                                   report_type='KeywordBooked', \n                                   report_name='Campaign Targets',\n                                   keywords='Kw1,Kw2',\n                                   campaign_id=c('Test_Campaign'),\n                                   site_domain=c('www.mysite.com'),\n                                   start_date='2015-12-01', \n                                   end_date='2015-12-31')\n```\n\n### oas_geo_inventory()\n\nRetrieve an inventory forecast for two positions on the \n\"Books\" section broken down by DMA\n\n``` r\n\nsection_geo \u003c- oas_geo_inventory(credentials=my_credentials, \n                                     report_type='Section', \n                                     report_geo='DMA',\n                                     report_outlook='Forecast',\n                                     id='Books',\n                                     max_row=\"20000\",\n                                     position=c('Bottom', 'Bottom1'),\n                                     start_date='2015-12-01', \n                                     end_date='2015-12-31')\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenmmortimer%2Froas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevenmmortimer%2Froas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenmmortimer%2Froas/lists"}