-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathREADME_rdoc.html
293 lines (194 loc) · 16.5 KB
/
README_rdoc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>README - BingAdsApi</title>
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
<script type="text/javascript">
var rdoc_rel_prefix = "./";
</script>
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
<body class="file">
<nav id="metadata">
<nav id="home-section" class="section">
<h3 class="section-header">
<a href="./index.html">Home</a>
<a href="./table_of_contents.html#classes">Classes</a>
<a href="./table_of_contents.html#methods">Methods</a>
</h3>
</nav>
<nav id="search-section" class="section project-section" class="initially-hidden">
<form action="#" method="get" accept-charset="utf-8">
<h3 class="section-header">
<input type="text" name="search" placeholder="Search" id="search-field"
title="Type to search, Up and Down to navigate, Enter to load">
</h3>
</form>
<ul id="search-results" class="initially-hidden"></ul>
</nav>
<div id="project-metadata">
<nav id="fileindex-section" class="section project-section">
<h3 class="section-header">Pages</h3>
<ul>
<li class="file"><a href="./README_rdoc.html">README</a>
</ul>
</nav>
<nav id="classindex-section" class="section project-section">
<h3 class="section-header">Class and Module Index</h3>
<ul class="link-list">
<li><a href="./BingAdsApi.html">BingAdsApi</a>
<li><a href="./BingAdsApi/AccountInfo.html">BingAdsApi::AccountInfo</a>
<li><a href="./BingAdsApi/AccountPerformanceReportRequest.html">BingAdsApi::AccountPerformanceReportRequest</a>
<li><a href="./BingAdsApi/Ad.html">BingAdsApi::Ad</a>
<li><a href="./BingAdsApi/AdApiError.html">BingAdsApi::AdApiError</a>
<li><a href="./BingAdsApi/AdApiFaultDetail.html">BingAdsApi::AdApiFaultDetail</a>
<li><a href="./BingAdsApi/AdGroup.html">BingAdsApi::AdGroup</a>
<li><a href="./BingAdsApi/AdLanguage.html">BingAdsApi::AdLanguage</a>
<li><a href="./BingAdsApi/ApiException.html">BingAdsApi::ApiException</a>
<li><a href="./BingAdsApi/ApiFaultDetail.html">BingAdsApi::ApiFaultDetail</a>
<li><a href="./BingAdsApi/ApplicationFault.html">BingAdsApi::ApplicationFault</a>
<li><a href="./BingAdsApi/BatchError.html">BingAdsApi::BatchError</a>
<li><a href="./BingAdsApi/Campaign.html">BingAdsApi::Campaign</a>
<li><a href="./BingAdsApi/CampaignManagement.html">BingAdsApi::CampaignManagement</a>
<li><a href="./BingAdsApi/CampaignPerformanceReportRequest.html">BingAdsApi::CampaignPerformanceReportRequest</a>
<li><a href="./BingAdsApi/ClientProxy.html">BingAdsApi::ClientProxy</a>
<li><a href="./BingAdsApi/Config.html">BingAdsApi::Config</a>
<li><a href="./BingAdsApi/CustomerManagement.html">BingAdsApi::CustomerManagement</a>
<li><a href="./BingAdsApi/DataObject.html">BingAdsApi::DataObject</a>
<li><a href="./BingAdsApi/EditorialError.html">BingAdsApi::EditorialError</a>
<li><a href="./BingAdsApi/Helpers.html">BingAdsApi::Helpers</a>
<li><a href="./BingAdsApi/Helpers/ColumnHelper.html">BingAdsApi::Helpers::ColumnHelper</a>
<li><a href="./BingAdsApi/Helpers/FilterHelper.html">BingAdsApi::Helpers::FilterHelper</a>
<li><a href="./BingAdsApi/Helpers/ScopeHelper.html">BingAdsApi::Helpers::ScopeHelper</a>
<li><a href="./BingAdsApi/Helpers/TimeHelper.html">BingAdsApi::Helpers::TimeHelper</a>
<li><a href="./BingAdsApi/MobileAd.html">BingAdsApi::MobileAd</a>
<li><a href="./BingAdsApi/OperationError.html">BingAdsApi::OperationError</a>
<li><a href="./BingAdsApi/PartialErrors.html">BingAdsApi::PartialErrors</a>
<li><a href="./BingAdsApi/PerformanceReportRequest.html">BingAdsApi::PerformanceReportRequest</a>
<li><a href="./BingAdsApi/ProductAd.html">BingAdsApi::ProductAd</a>
<li><a href="./BingAdsApi/ReportAggregation.html">BingAdsApi::ReportAggregation</a>
<li><a href="./BingAdsApi/ReportFormat.html">BingAdsApi::ReportFormat</a>
<li><a href="./BingAdsApi/ReportLanguage.html">BingAdsApi::ReportLanguage</a>
<li><a href="./BingAdsApi/ReportRequest.html">BingAdsApi::ReportRequest</a>
<li><a href="./BingAdsApi/ReportRequestStatus.html">BingAdsApi::ReportRequestStatus</a>
<li><a href="./BingAdsApi/ReportTimePeriods.html">BingAdsApi::ReportTimePeriods</a>
<li><a href="./BingAdsApi/Reporting.html">BingAdsApi::Reporting</a>
<li><a href="./BingAdsApi/SOAPHasheable.html">BingAdsApi::SOAPHasheable</a>
<li><a href="./BingAdsApi/Service.html">BingAdsApi::Service</a>
<li><a href="./BingAdsApi/TextAd.html">BingAdsApi::TextAd</a>
<li><a href="./BingAdsApi/TimeZone.html">BingAdsApi::TimeZone</a>
</ul>
</nav>
</div>
</nav>
<div id="documentation" class="description">
<h1 id="label-BingAdsApi"><a href="BingAdsApi.html">BingAdsApi</a></h1>
<p>This project rocks and uses MIT-LICENSE.</p>
<h2 id="label-Presentation">Presentation</h2>
<p>This is a very simple, straight use gem for integrating any Rails app with
the Bing Ads SOAP Webservices.</p>
<h2 id="label-Installation">Installation</h2>
<p>Add to your Gemfile</p>
<pre>gem 'bing-ads-api'</pre>
<h2 id="label-Examples">Examples</h2>
<p>So far, I’ve just integrated some methods from
<code>CampaignManagement</code>, <code>CustomerManagement</code> and
<code>Reporting</code> services</p>
<h3 id="label-Authentication">Authentication</h3>
<p>In all cases, you must initialize some service object with the
authentication options Here’s an example with the CampaignMangement service
object</p>
<pre class="ruby"><span class="ruby-identifier">options</span> = {
:<span class="ruby-identifier">environment</span> =<span class="ruby-operator">></span> :<span class="ruby-identifier">sandbox</span>,
:<span class="ruby-identifier">username</span> =<span class="ruby-operator">></span> <span class="ruby-string">"desarrollo_neonline"</span>,
:<span class="ruby-identifier">password</span> =<span class="ruby-operator">></span> <span class="ruby-string">"neonline2013"</span>,
:<span class="ruby-identifier">developer_token</span> =<span class="ruby-operator">></span> <span class="ruby-string">"BBD37VB98"</span>,
:<span class="ruby-identifier">customer_id</span> =<span class="ruby-operator">></span> <span class="ruby-string">"21021746"</span>,
:<span class="ruby-identifier">account_id</span> =<span class="ruby-operator">></span> <span class="ruby-string">"5978083"</span>
}
<span class="ruby-identifier">service</span> = <span class="ruby-constant">BingAdsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">CampaignManagement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>)
</pre>
<ul><li>
<p><code>environment</code> can be one of two values: <code>:sandbox</code> or
<code>:production</code></p>
</li></ul>
<h3 id="label-Campaign+Management">Campaign Management</h3>
<p>Example of service object initialization:</p>
<pre class="ruby"><span class="ruby-identifier">options</span> = {
:<span class="ruby-identifier">environment</span> =<span class="ruby-operator">></span> :<span class="ruby-identifier">sandbox</span>,
:<span class="ruby-identifier">username</span> =<span class="ruby-operator">></span> <span class="ruby-string">"desarrollo_neonline"</span>,
:<span class="ruby-identifier">password</span> =<span class="ruby-operator">></span> <span class="ruby-string">"neonline2013"</span>,
:<span class="ruby-identifier">developer_token</span> =<span class="ruby-operator">></span> <span class="ruby-string">"BBD37VB98"</span>,
:<span class="ruby-identifier">customer_id</span> =<span class="ruby-operator">></span> <span class="ruby-string">"21021746"</span>,
:<span class="ruby-identifier">account_id</span> =<span class="ruby-operator">></span> <span class="ruby-string">"5978083"</span>
}
<span class="ruby-identifier">service</span> = <span class="ruby-constant">BingAdsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">CampaignManagement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>)
</pre>
<h4 id="label-Adding+Campaigns">Adding Campaigns</h4>
<pre class="ruby"><span class="ruby-identifier">account_id</span> = <span class="ruby-value">123456789</span>
<span class="ruby-identifier">campaigns</span> = [
<span class="ruby-constant">BingAdsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">Campaign</span>.<span class="ruby-identifier">new</span>(
:<span class="ruby-identifier">budget_type</span> =<span class="ruby-operator">></span> <span class="ruby-constant">BingAdsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">Campaign</span><span class="ruby-operator">::</span><span class="ruby-constant">DAILY_BUDGET_STANDARD</span>,
:<span class="ruby-identifier">conversion_tracking_enabled</span> =<span class="ruby-operator">></span> <span class="ruby-string">"false"</span>,
:<span class="ruby-identifier">daily_budget</span> =<span class="ruby-operator">></span> <span class="ruby-value">2000</span>,
:<span class="ruby-identifier">daylight_saving</span> =<span class="ruby-operator">></span> <span class="ruby-string">"false"</span>,
:<span class="ruby-identifier">description</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">name</span> <span class="ruby-operator">+</span> <span class="ruby-string">" first description"</span>,
:<span class="ruby-identifier">monthly_budget</span> =<span class="ruby-operator">></span> <span class="ruby-value">5400</span>,
:<span class="ruby-identifier">name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">name</span> <span class="ruby-operator">+</span> <span class="ruby-string">" first name"</span>,
:<span class="ruby-identifier">status</span> =<span class="ruby-operator">></span> <span class="ruby-constant">BingAdsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">Campaign</span><span class="ruby-operator">::</span><span class="ruby-constant">PAUSED</span>,
:<span class="ruby-identifier">time_zone</span> =<span class="ruby-operator">></span> <span class="ruby-constant">BingAdsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">Campaign</span><span class="ruby-operator">::</span><span class="ruby-constant">SANTIAGO</span>),
<span class="ruby-constant">BingAdsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">Campaign</span>.<span class="ruby-identifier">new</span>(
:<span class="ruby-identifier">budget_type</span> =<span class="ruby-operator">></span> <span class="ruby-constant">BingAdsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">Campaign</span><span class="ruby-operator">::</span><span class="ruby-constant">DAILY_BUDGET_STANDARD</span>,
:<span class="ruby-identifier">conversion_tracking_enabled</span> =<span class="ruby-operator">></span> <span class="ruby-string">"false"</span>,
:<span class="ruby-identifier">daily_budget</span> =<span class="ruby-operator">></span> <span class="ruby-value">2500</span>,
:<span class="ruby-identifier">daylight_saving</span> =<span class="ruby-operator">></span> <span class="ruby-string">"false"</span>,
:<span class="ruby-identifier">description</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">name</span> <span class="ruby-operator">+</span> <span class="ruby-string">" second description"</span>,
:<span class="ruby-identifier">monthly_budget</span> =<span class="ruby-operator">></span> <span class="ruby-value">7800</span>,
:<span class="ruby-identifier">name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">name</span> <span class="ruby-operator">+</span> <span class="ruby-string">" second name"</span>,
:<span class="ruby-identifier">status</span> =<span class="ruby-operator">></span> <span class="ruby-constant">BingAdsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">Campaign</span><span class="ruby-operator">::</span><span class="ruby-constant">PAUSED</span>,
:<span class="ruby-identifier">time_zone</span> =<span class="ruby-operator">></span> <span class="ruby-constant">BingAdsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">Campaign</span><span class="ruby-operator">::</span><span class="ruby-constant">SANTIAGO</span>) ]
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">service</span>.<span class="ruby-identifier">add_campaigns</span>(<span class="ruby-identifier">account_id</span>, <span class="ruby-identifier">campaigns</span>)
</pre>
<p>In some cases the methods will return a Hash with the ‘response’ tag
according to the method invoked. Like the example above.</p>
<h4 id="label-Find+Campaigns">Find Campaigns</h4>
<p>In other cases, like this next example, the method will return an object,
like an array or a object representation of the hash</p>
<pre class="ruby"><span class="ruby-identifier">campaigns</span> = <span class="ruby-identifier">service</span>.<span class="ruby-identifier">get_campaigns_by_account_id</span>(<span class="ruby-value">123456789</span>)
<span class="ruby-comment"># => campaigns is an array of BingAdsApi::Campaign</span>
</pre>
<h3 id="label-Customer+Management">Customer Management</h3>
<p>Example of service object initialization:</p>
<pre class="ruby"><span class="ruby-identifier">options</span> = {
:<span class="ruby-identifier">environment</span> =<span class="ruby-operator">></span> :<span class="ruby-identifier">sandbox</span>,
:<span class="ruby-identifier">username</span> =<span class="ruby-operator">></span> <span class="ruby-string">"desarrollo_neonline"</span>,
:<span class="ruby-identifier">password</span> =<span class="ruby-operator">></span> <span class="ruby-string">"neonline2013"</span>,
:<span class="ruby-identifier">developer_token</span> =<span class="ruby-operator">></span> <span class="ruby-string">"BBD37VB98"</span>,
:<span class="ruby-identifier">customer_id</span> =<span class="ruby-operator">></span> <span class="ruby-string">"21021746"</span>,
:<span class="ruby-identifier">account_id</span> =<span class="ruby-operator">></span> <span class="ruby-string">"5978083"</span>
}
<span class="ruby-identifier">service</span> = <span class="ruby-constant">BingAdsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">CustomerManagement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>)
</pre>
<h4 id="label-Get+accounts+info">Get accounts info</h4>
<pre class="ruby"><span class="ruby-identifier">accounts</span> = <span class="ruby-identifier">service</span>.<span class="ruby-identifier">get_accounts_info</span>
<span class="ruby-comment"># => accounts is an array of BingAdsApi::AccountsInfo</span>
</pre>
<p>For this method you can also specify a diferent customer id</p>
<pre class="ruby"><span class="ruby-identifier">accounts</span> = <span class="ruby-identifier">service</span>.<span class="ruby-identifier">get_accounts_info</span>(<span class="ruby-value">12345</span>)
<span class="ruby-comment"># => accounts is an array of BingAdsApi::AccountsInfo</span>
</pre>
<p>That would give you the customer’s 12345 accounts</p>
<h3 id="label-Reporting">Reporting</h3>
<h4 id="label-Submit+generate+report">Submit generate report</h4>
<h4 id="label-Poll+generate+report">Poll generate report</h4>
</div>
<footer id="validator-badges">
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.2.
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>