bing-ads 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +29 -6
- data/lib/bing/ads/api/v11/constants/wsdl.yml +2 -0
- data/lib/bing/ads/api/v11/services.rb +1 -0
- data/lib/bing/ads/api/v11/services/base.rb +1 -0
- data/lib/bing/ads/api/v11/services/customer_management.rb +34 -0
- data/lib/bing/ads/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07de1d1b77a390e2dbcf751a26ebd3d19ef24967
|
4
|
+
data.tar.gz: 209b2b9ad7bf5ff642140d5e95751ee98e63c873
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df9e01c278b7ef1c8ae34bd81370651f33179f33f779cb8db04322654b248cf527cddf6db8c13eb91f979a0dba265a2022fdd11def50937fa11ca79a21f583f9
|
7
|
+
data.tar.gz: 75a678422263eb8e8b8a5065e1eade82c9e4cbaad6f2b92e1374fcd4967cb56fe8f1d2d538190228f4d434283200d6865a1b9571f1f8f2c0454b8c229b782d45
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
[![Gem Version](https://img.shields.io/gem/v/bing-ads.svg)](https://rubygems.org/gems/bing-ads)
|
2
|
+
[![Build Status](https://travis-ci.org/FindHotel/bing-ads.svg?branch=master)](https://travis-ci.org/FindHotel/bing-ads)
|
2
3
|
|
3
4
|
# Bing::Ads
|
4
5
|
|
@@ -22,6 +23,28 @@ Or install it yourself as:
|
|
22
23
|
|
23
24
|
## Usage
|
24
25
|
|
26
|
+
### Customer Management Service
|
27
|
+
#### Initialization
|
28
|
+
```ruby
|
29
|
+
# Authentication token is not supported in sandbox, use `username` and `password` instead
|
30
|
+
# https://msdn.microsoft.com/en-us/library/dn277356.aspx
|
31
|
+
|
32
|
+
options = {
|
33
|
+
environment: :sandbox,
|
34
|
+
authentication_token: '39b290146bea6ce975c37cfc23',
|
35
|
+
developer_token: 'BBD37VB98',
|
36
|
+
customer_id: '21027149',
|
37
|
+
# client_settings: { logger: LOGGER::STDOUT }
|
38
|
+
}
|
39
|
+
|
40
|
+
service = Bing::Ads::API::V11::Services::CustomerManagement.new(options)
|
41
|
+
```
|
42
|
+
|
43
|
+
#### Getting accounts info
|
44
|
+
```ruby
|
45
|
+
response = service.get_accounts_info
|
46
|
+
```
|
47
|
+
|
25
48
|
### Campaign Management Service
|
26
49
|
#### Initialization
|
27
50
|
```ruby
|
@@ -52,7 +75,6 @@ account_id = 5278183
|
|
52
75
|
campaigns = [
|
53
76
|
{
|
54
77
|
budget_type: Bing::Ads::API::V11.constants.campaign_management.budget_limit_type.daily_budget_standard,
|
55
|
-
conversion_tracking_enabled: "false",
|
56
78
|
daily_budget: 2000,
|
57
79
|
description: 'Amsterdam-based global campaign',
|
58
80
|
name: '51 - Global - Chain - Mixed - N -en- Amsterdam - 100 - 26479',
|
@@ -72,12 +94,10 @@ campaigns = [
|
|
72
94
|
{
|
73
95
|
id: 813721838,
|
74
96
|
budget_type: Bing::Ads::API::V11.constants.campaign_management.budget_limit_type.daily_budget_standard,
|
75
|
-
conversion_tracking_enabled: "false",
|
76
97
|
},
|
77
98
|
{
|
78
99
|
id: 813721849,
|
79
100
|
budget_type: Bing::Ads::API::V11.constants.campaign_management.budget_limit_type.daily_budget_standard,
|
80
|
-
conversion_tracking_enabled: "false",
|
81
101
|
},
|
82
102
|
# ...
|
83
103
|
]
|
@@ -287,12 +307,15 @@ response = service.delete_keywords(ad_group_id, keyword_ids_to_delete)
|
|
287
307
|
### Bulk Service
|
288
308
|
Not yet supported
|
289
309
|
|
290
|
-
### Customer Management Service
|
291
|
-
Not yet supported
|
292
|
-
|
293
310
|
### Reporting Service
|
294
311
|
Not yet supported. Use: https://github.com/FindHotel/bing-ads-reporting
|
295
312
|
|
313
|
+
### Errors raised
|
314
|
+
* `Bing::Ads::API::Errors::AuthenticationParamsMissing`
|
315
|
+
No username/password or authentication_token.
|
316
|
+
* `Bing::Ads::API::Errors::AuthenticationTokenExpired` Authentication token needs to be refreshed.
|
317
|
+
* `Bing::Ads::API::Errors::LimitError` An API limit has been exceeded on a specific request. Check message for details.
|
318
|
+
|
296
319
|
## Development
|
297
320
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
298
321
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
@@ -1,6 +1,8 @@
|
|
1
1
|
sandbox:
|
2
|
+
customer_management: https://clientcenter.api.sandbox.bingads.microsoft.com/Api/CustomerManagement/v11/CustomerManagementService.svc?singleWsdl
|
2
3
|
campaign_management: "https://campaign.api.sandbox.bingads.microsoft.com/Api/Advertiser/CampaignManagement/V11/CampaignManagementService.svc?singleWsdl"
|
3
4
|
reporting: "https://api.sandbox.bingads.microsoft.com/Api/Advertiser/Reporting/V11/ReportingService.svc?singleWsdl"
|
4
5
|
production:
|
6
|
+
customer_management: https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v11/CustomerManagementService.svc?singleWsdl
|
5
7
|
campaign_management: "https://campaign.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/V11/CampaignManagementService.svc?singleWsdl"
|
6
8
|
reporting: "https://api.bingads.microsoft.com/Api/Advertiser/Reporting/V11/ReportingService.svc?singleWsdl"
|
@@ -23,6 +23,7 @@ module Bing
|
|
23
23
|
@environment = options.delete(:environment)
|
24
24
|
@retry_attempts = options.delete(:retry_attempts) || 0
|
25
25
|
@account_id = options[:account_id]
|
26
|
+
@customer_id = options[:customer_id]
|
26
27
|
raise 'You must set the service environment' unless @environment
|
27
28
|
options[:wsdl_url] = service_wsdl_url
|
28
29
|
options[:namespace_identifier] = Bing::Ads::API::V11::NAMESPACE_IDENTIFIER
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Bing
|
2
|
+
module Ads
|
3
|
+
module API
|
4
|
+
module V11
|
5
|
+
module Services
|
6
|
+
# Bing::Ads::API::V11::Services::CustomerManagement
|
7
|
+
class CustomerManagement < Base
|
8
|
+
def initialize(options = {})
|
9
|
+
super(options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def get_accounts_info(customer_id = @customer_id, only_parent_accounts = false)
|
13
|
+
payload = {
|
14
|
+
customer_id: customer_id,
|
15
|
+
only_parent_accounts: only_parent_accounts
|
16
|
+
}
|
17
|
+
response = call(:get_accounts_info, payload.compact)
|
18
|
+
response_body = response_body(response, __method__)
|
19
|
+
response_body[:accounts_info][:account_info]
|
20
|
+
end
|
21
|
+
|
22
|
+
# TODO operations: https://msdn.microsoft.com/en-us/library/bing-ads-customer-management-service-operations.aspx
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def service_name
|
27
|
+
'customer_management'
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/bing/ads/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bing-ads
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- oss92
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- lib/bing/ads/api/v11/services.rb
|
129
129
|
- lib/bing/ads/api/v11/services/base.rb
|
130
130
|
- lib/bing/ads/api/v11/services/campaign_management.rb
|
131
|
+
- lib/bing/ads/api/v11/services/customer_management.rb
|
131
132
|
- lib/bing/ads/utils.rb
|
132
133
|
- lib/bing/ads/version.rb
|
133
134
|
homepage: https://github.com/FindHotel/bing-ads
|