Skip to content

Commit

Permalink
Merge pull request #6 from forward3d/upgrade-v12
Browse files Browse the repository at this point in the history
Upgrading enpoints to V12
  • Loading branch information
babakgh authored Oct 17, 2018
2 parents d9e9970 + 8ac7830 commit a5954a6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
* 3.0.0
Using API V12
API12 is no longer support authentication via Username/password.

* 2.0.0
BingAdsReporting::Service class renamed to BingAdsReporting::AdInsightService
BingAdsReporting::BulkService added

* 1.3.0
Using API v11 instead of v9
report_body can return nil as API doesn't return empty files anymore
Expand Down
2 changes: 1 addition & 1 deletion lib/bing-ads-reporting/ad_insight_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module BingAdsReporting
class AdInsightService < ServiceCore
WDSL = 'https://reporting.api.bingads.microsoft.com/Api/Advertiser/Reporting/V11/ReportingService.svc?singleWsdl'.freeze
WDSL = 'https://reporting.api.bingads.microsoft.com/Api/Advertiser/Reporting/V12/ReportingService.svc?singleWsdl'.freeze
FAILED_STATUS = 'Error'.freeze
SUCCESS_STATUS = 'Success'.freeze

Expand Down
4 changes: 2 additions & 2 deletions lib/bing-ads-reporting/bulk_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module BingAdsReporting
class BulkService < ServiceCore
WDSL = 'https://bulk.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/V11/BulkService.svc?wsdl'.freeze
WDSL = 'https://bulk.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/V12/BulkService.svc?wsdl'.freeze
FAILED_STATUS = 'Failed'.freeze
SUCCESS_STATUS = 'Completed'.freeze

Expand Down Expand Up @@ -42,7 +42,7 @@ def generate_report_message(options)
ns('DownloadEntity') => options[:download_entities]
},
ns('DownloadFileType') => options[:report_format],
ns('FormatVersion') => '5.0',
ns('FormatVersion') => '6.0',
ns('LastSyncTimeInUtc') => true,
}

Expand Down
10 changes: 3 additions & 7 deletions lib/bing-ads-reporting/service_core.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module BingAdsReporting
class AuthenticationTokenExpired < Exception; end
class AuthenticationTokenExpired < StandardError; end
class AuthenticationViaOAuthIsRequired < StandardError; end

class ServiceCore

Expand Down Expand Up @@ -126,12 +127,7 @@ def download(url)

def client
if @settings[:username] && @settings[:password]
header = {ns('ApplicationToken') => @settings[:applicationToken],
ns('CustomerAccountId') => @settings[:accountId],
ns('CustomerId') => @settings[:customerId],
ns('DeveloperToken') => @settings[:developerToken],
ns('UserName') => @settings[:username],
ns('Password') => @settings[:password] }
raise AuthenticationViaOAuthIsRequired, 'Microsoft Account Authentication via OAuth is Required'
else
header = {ns('ApplicationToken') => @settings[:applicationToken],
ns('CustomerAccountId') => @settings[:accountId],
Expand Down
2 changes: 1 addition & 1 deletion lib/bing-ads-reporting/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module BingAdsReporting
VERSION = "2.0.0"
VERSION = "3.0.0"
end

0 comments on commit a5954a6

Please sign in to comment.