late-sdk 0.0.550 → 0.0.552
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +73 -75
- data/docs/AdAccountsApi.md +915 -0
- data/docs/AdCampaignsApi.md +615 -15
- data/docs/AdCreativesApi.md +815 -0
- data/docs/AdInsightsApi.md +415 -0
- data/docs/AdTargetingApi.md +371 -0
- data/docs/AnalyticsApi.md +7 -7
- data/docs/BoostPostRequestTracking.md +1 -1
- data/docs/{CreateLeadFormRequestQuestionsInnerOptionsInner.md → BoostPostRequestTrackingUrlTagsInner.md} +2 -2
- data/docs/ConversionsApi.md +890 -0
- data/docs/CreateLeadFormRequestQuestionsInner.md +1 -1
- data/docs/LeadGenApi.md +527 -0
- data/docs/MessagingAdsApi.md +215 -0
- data/docs/ReachAndFrequencyApi.md +294 -0
- data/docs/TrackingTagsApi.md +141 -0
- data/docs/YouTubeDailyViewsResponse.md +2 -0
- data/docs/YouTubeDemographicsResponse.md +2 -0
- data/docs/YouTubeVideoRetentionResponse.md +2 -0
- data/lib/zernio-sdk/api/ad_accounts_api.rb +958 -0
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +618 -12
- data/lib/zernio-sdk/api/ad_creatives_api.rb +826 -0
- data/lib/zernio-sdk/api/ad_insights_api.rb +446 -0
- data/lib/zernio-sdk/api/ad_targeting_api.rb +404 -0
- data/lib/zernio-sdk/api/analytics_api.rb +8 -8
- data/lib/zernio-sdk/api/conversions_api.rb +936 -0
- data/lib/zernio-sdk/api/lead_gen_api.rb +547 -0
- data/lib/zernio-sdk/api/messaging_ads_api.rb +226 -0
- data/lib/zernio-sdk/api/reach_and_frequency_api.rb +316 -0
- data/lib/zernio-sdk/api/tracking_tags_api.rb +137 -0
- data/lib/zernio-sdk/models/boost_post_request_tracking.rb +5 -2
- data/lib/zernio-sdk/models/{create_lead_form_request_questions_inner_options_inner.rb → boost_post_request_tracking_url_tags_inner.rb} +3 -3
- data/lib/zernio-sdk/models/create_lead_form_request_questions_inner.rb +1 -1
- data/lib/zernio-sdk/models/you_tube_daily_views_response.rb +11 -1
- data/lib/zernio-sdk/models/you_tube_demographics_response.rb +11 -1
- data/lib/zernio-sdk/models/you_tube_video_retention_response.rb +11 -1
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +9 -2
- data/openapi.yaml +329 -163
- data/spec/api/ad_accounts_api_spec.rb +206 -0
- data/spec/api/ad_campaigns_api_spec.rb +119 -6
- data/spec/api/ad_creatives_api_spec.rb +182 -0
- data/spec/api/ad_insights_api_spec.rb +120 -0
- data/spec/api/ad_targeting_api_spec.rb +101 -0
- data/spec/api/analytics_api_spec.rb +4 -4
- data/spec/api/conversions_api_spec.rb +199 -0
- data/spec/api/lead_gen_api_spec.rb +131 -0
- data/spec/api/messaging_ads_api_spec.rb +71 -0
- data/spec/api/reach_and_frequency_api_spec.rb +87 -0
- data/spec/api/tracking_tags_api_spec.rb +25 -0
- data/spec/models/{create_lead_form_request_questions_inner_options_inner_spec.rb → boost_post_request_tracking_url_tags_inner_spec.rb} +6 -6
- data/spec/models/you_tube_daily_views_response_spec.rb +6 -0
- data/spec/models/you_tube_demographics_response_spec.rb +6 -0
- data/spec/models/you_tube_video_retention_response_spec.rb +6 -0
- data/zernio-sdk-0.0.552.gem +0 -0
- metadata +39 -11
- data/docs/AdsApi.md +0 -5278
- data/lib/zernio-sdk/api/ads_api.rb +0 -5391
- data/spec/api/ads_api_spec.rb +0 -1015
- data/zernio-sdk-0.0.550.gem +0 -0
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Zernio
|
|
16
|
+
class AdTargetingApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Estimate audience reach
|
|
23
|
+
# Returns a normalized pre-flight audience-size estimate for a targeting spec, before any campaign is created. Backed by each platform's native reach API (Meta `delivery_estimate`, LinkedIn `audienceCounts`, X `audience_summary`, Pinterest `audience_sizing`). Platforms without a usable pre-flight reach API (Google Search/Display, TikTok) return `available: false` with no bounds, so clients can hide or grey out the estimate rather than treat the absence as an error.
|
|
24
|
+
# @param estimate_ad_reach_request [EstimateAdReachRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [EstimateAdReach200Response]
|
|
27
|
+
def estimate_ad_reach(estimate_ad_reach_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = estimate_ad_reach_with_http_info(estimate_ad_reach_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Estimate audience reach
|
|
33
|
+
# Returns a normalized pre-flight audience-size estimate for a targeting spec, before any campaign is created. Backed by each platform's native reach API (Meta `delivery_estimate`, LinkedIn `audienceCounts`, X `audience_summary`, Pinterest `audience_sizing`). Platforms without a usable pre-flight reach API (Google Search/Display, TikTok) return `available: false` with no bounds, so clients can hide or grey out the estimate rather than treat the absence as an error.
|
|
34
|
+
# @param estimate_ad_reach_request [EstimateAdReachRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(EstimateAdReach200Response, Integer, Hash)>] EstimateAdReach200Response data, response status code and response headers
|
|
37
|
+
def estimate_ad_reach_with_http_info(estimate_ad_reach_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: AdTargetingApi.estimate_ad_reach ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'estimate_ad_reach_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && estimate_ad_reach_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'estimate_ad_reach_request' when calling AdTargetingApi.estimate_ad_reach"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v1/ads/targeting/reach-estimate'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(estimate_ad_reach_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'EstimateAdReach200Response'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"AdTargetingApi.estimate_ad_reach",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: AdTargetingApi#estimate_ad_reach\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Suggested bid and budget bounds
|
|
91
|
+
# LinkedIn-only. Returns the suggested bid and bid limits for a targeting spec, plus the daily-budget bounds LinkedIn will accept. Use it before creating a campaign to pick a bid inside the allowed range and warn the user if their daily budget is below the minimum. Wraps LinkedIn's `adBudgetPricing` finder. Non-LinkedIn accounts return `available: false` so clients can hide the pricing UI without treating it as a failure.
|
|
92
|
+
# @param get_linked_in_bid_pricing_request [GetLinkedInBidPricingRequest]
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [GetLinkedInBidPricing200Response]
|
|
95
|
+
def get_linked_in_bid_pricing(get_linked_in_bid_pricing_request, opts = {})
|
|
96
|
+
data, _status_code, _headers = get_linked_in_bid_pricing_with_http_info(get_linked_in_bid_pricing_request, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Suggested bid and budget bounds
|
|
101
|
+
# LinkedIn-only. Returns the suggested bid and bid limits for a targeting spec, plus the daily-budget bounds LinkedIn will accept. Use it before creating a campaign to pick a bid inside the allowed range and warn the user if their daily budget is below the minimum. Wraps LinkedIn's `adBudgetPricing` finder. Non-LinkedIn accounts return `available: false` so clients can hide the pricing UI without treating it as a failure.
|
|
102
|
+
# @param get_linked_in_bid_pricing_request [GetLinkedInBidPricingRequest]
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(GetLinkedInBidPricing200Response, Integer, Hash)>] GetLinkedInBidPricing200Response data, response status code and response headers
|
|
105
|
+
def get_linked_in_bid_pricing_with_http_info(get_linked_in_bid_pricing_request, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: AdTargetingApi.get_linked_in_bid_pricing ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'get_linked_in_bid_pricing_request' is set
|
|
110
|
+
if @api_client.config.client_side_validation && get_linked_in_bid_pricing_request.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'get_linked_in_bid_pricing_request' when calling AdTargetingApi.get_linked_in_bid_pricing"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/v1/ads/targeting/bid-pricing'
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
123
|
+
# HTTP header 'Content-Type'
|
|
124
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
125
|
+
if !content_type.nil?
|
|
126
|
+
header_params['Content-Type'] = content_type
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# form parameters
|
|
130
|
+
form_params = opts[:form_params] || {}
|
|
131
|
+
|
|
132
|
+
# http body (model)
|
|
133
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(get_linked_in_bid_pricing_request)
|
|
134
|
+
|
|
135
|
+
# return_type
|
|
136
|
+
return_type = opts[:debug_return_type] || 'GetLinkedInBidPricing200Response'
|
|
137
|
+
|
|
138
|
+
# auth_names
|
|
139
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
140
|
+
|
|
141
|
+
new_options = opts.merge(
|
|
142
|
+
:operation => :"AdTargetingApi.get_linked_in_bid_pricing",
|
|
143
|
+
:header_params => header_params,
|
|
144
|
+
:query_params => query_params,
|
|
145
|
+
:form_params => form_params,
|
|
146
|
+
:body => post_body,
|
|
147
|
+
:auth_names => auth_names,
|
|
148
|
+
:return_type => return_type
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
152
|
+
if @api_client.config.debugging
|
|
153
|
+
@api_client.config.logger.debug "API called: AdTargetingApi#get_linked_in_bid_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
154
|
+
end
|
|
155
|
+
return data, status_code, headers
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Impressions, clicks and spend forecast
|
|
159
|
+
# LinkedIn-only. Forecasted impressions, clicks, spend and ~20 other metrics for a targeting spec over a time range. Wraps LinkedIn's `adSupplyForecasts` finder. Each returned series carries a `metricType` (IMPRESSION, CLICK, SPENDING, MAX_POTENTIAL_BUDGET, COST_PER_MILLION_IMPRESSIONS, ...) and a `granularity` (DAILY, SEVEN_DAY, THIRTY_DAY, CUSTOM). LinkedIn caps the daily spending forecast at 1.2x the daily budget and returns 0 once the total budget is exhausted. Non-LinkedIn accounts return `available: false`.
|
|
160
|
+
# @param get_linked_in_supply_forecast_request [GetLinkedInSupplyForecastRequest]
|
|
161
|
+
# @param [Hash] opts the optional parameters
|
|
162
|
+
# @return [GetLinkedInSupplyForecast200Response]
|
|
163
|
+
def get_linked_in_supply_forecast(get_linked_in_supply_forecast_request, opts = {})
|
|
164
|
+
data, _status_code, _headers = get_linked_in_supply_forecast_with_http_info(get_linked_in_supply_forecast_request, opts)
|
|
165
|
+
data
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Impressions, clicks and spend forecast
|
|
169
|
+
# LinkedIn-only. Forecasted impressions, clicks, spend and ~20 other metrics for a targeting spec over a time range. Wraps LinkedIn's `adSupplyForecasts` finder. Each returned series carries a `metricType` (IMPRESSION, CLICK, SPENDING, MAX_POTENTIAL_BUDGET, COST_PER_MILLION_IMPRESSIONS, ...) and a `granularity` (DAILY, SEVEN_DAY, THIRTY_DAY, CUSTOM). LinkedIn caps the daily spending forecast at 1.2x the daily budget and returns 0 once the total budget is exhausted. Non-LinkedIn accounts return `available: false`.
|
|
170
|
+
# @param get_linked_in_supply_forecast_request [GetLinkedInSupplyForecastRequest]
|
|
171
|
+
# @param [Hash] opts the optional parameters
|
|
172
|
+
# @return [Array<(GetLinkedInSupplyForecast200Response, Integer, Hash)>] GetLinkedInSupplyForecast200Response data, response status code and response headers
|
|
173
|
+
def get_linked_in_supply_forecast_with_http_info(get_linked_in_supply_forecast_request, opts = {})
|
|
174
|
+
if @api_client.config.debugging
|
|
175
|
+
@api_client.config.logger.debug 'Calling API: AdTargetingApi.get_linked_in_supply_forecast ...'
|
|
176
|
+
end
|
|
177
|
+
# verify the required parameter 'get_linked_in_supply_forecast_request' is set
|
|
178
|
+
if @api_client.config.client_side_validation && get_linked_in_supply_forecast_request.nil?
|
|
179
|
+
fail ArgumentError, "Missing the required parameter 'get_linked_in_supply_forecast_request' when calling AdTargetingApi.get_linked_in_supply_forecast"
|
|
180
|
+
end
|
|
181
|
+
# resource path
|
|
182
|
+
local_var_path = '/v1/ads/targeting/supply-forecast'
|
|
183
|
+
|
|
184
|
+
# query parameters
|
|
185
|
+
query_params = opts[:query_params] || {}
|
|
186
|
+
|
|
187
|
+
# header parameters
|
|
188
|
+
header_params = opts[:header_params] || {}
|
|
189
|
+
# HTTP header 'Accept' (if needed)
|
|
190
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
191
|
+
# HTTP header 'Content-Type'
|
|
192
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
193
|
+
if !content_type.nil?
|
|
194
|
+
header_params['Content-Type'] = content_type
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# form parameters
|
|
198
|
+
form_params = opts[:form_params] || {}
|
|
199
|
+
|
|
200
|
+
# http body (model)
|
|
201
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(get_linked_in_supply_forecast_request)
|
|
202
|
+
|
|
203
|
+
# return_type
|
|
204
|
+
return_type = opts[:debug_return_type] || 'GetLinkedInSupplyForecast200Response'
|
|
205
|
+
|
|
206
|
+
# auth_names
|
|
207
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
208
|
+
|
|
209
|
+
new_options = opts.merge(
|
|
210
|
+
:operation => :"AdTargetingApi.get_linked_in_supply_forecast",
|
|
211
|
+
:header_params => header_params,
|
|
212
|
+
:query_params => query_params,
|
|
213
|
+
:form_params => form_params,
|
|
214
|
+
:body => post_body,
|
|
215
|
+
:auth_names => auth_names,
|
|
216
|
+
:return_type => return_type
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
220
|
+
if @api_client.config.debugging
|
|
221
|
+
@api_client.config.logger.debug "API called: AdTargetingApi#get_linked_in_supply_forecast\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
222
|
+
end
|
|
223
|
+
return data, status_code, headers
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Search targeting interests
|
|
227
|
+
# Deprecated alias for `GET /v1/ads/targeting/search?dimension=interest`. Kept for backward compatibility, it returns the legacy `{ interests: [...] }` shape rather than the normalized `{ results: [...] }`. New integrations should use `GET /v1/ads/targeting/search` with `dimension=interest`.
|
|
228
|
+
# @param q [String] Search query
|
|
229
|
+
# @param account_id [String] Social account ID
|
|
230
|
+
# @param [Hash] opts the optional parameters
|
|
231
|
+
# @return [SearchAdInterests200Response]
|
|
232
|
+
def search_ad_interests(q, account_id, opts = {})
|
|
233
|
+
data, _status_code, _headers = search_ad_interests_with_http_info(q, account_id, opts)
|
|
234
|
+
data
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Search targeting interests
|
|
238
|
+
# Deprecated alias for `GET /v1/ads/targeting/search?dimension=interest`. Kept for backward compatibility, it returns the legacy `{ interests: [...] }` shape rather than the normalized `{ results: [...] }`. New integrations should use `GET /v1/ads/targeting/search` with `dimension=interest`.
|
|
239
|
+
# @param q [String] Search query
|
|
240
|
+
# @param account_id [String] Social account ID
|
|
241
|
+
# @param [Hash] opts the optional parameters
|
|
242
|
+
# @return [Array<(SearchAdInterests200Response, Integer, Hash)>] SearchAdInterests200Response data, response status code and response headers
|
|
243
|
+
def search_ad_interests_with_http_info(q, account_id, opts = {})
|
|
244
|
+
if @api_client.config.debugging
|
|
245
|
+
@api_client.config.logger.debug 'Calling API: AdTargetingApi.search_ad_interests ...'
|
|
246
|
+
end
|
|
247
|
+
# verify the required parameter 'q' is set
|
|
248
|
+
if @api_client.config.client_side_validation && q.nil?
|
|
249
|
+
fail ArgumentError, "Missing the required parameter 'q' when calling AdTargetingApi.search_ad_interests"
|
|
250
|
+
end
|
|
251
|
+
# verify the required parameter 'account_id' is set
|
|
252
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
253
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AdTargetingApi.search_ad_interests"
|
|
254
|
+
end
|
|
255
|
+
# resource path
|
|
256
|
+
local_var_path = '/v1/ads/interests'
|
|
257
|
+
|
|
258
|
+
# query parameters
|
|
259
|
+
query_params = opts[:query_params] || {}
|
|
260
|
+
query_params[:'q'] = q
|
|
261
|
+
query_params[:'accountId'] = account_id
|
|
262
|
+
|
|
263
|
+
# header parameters
|
|
264
|
+
header_params = opts[:header_params] || {}
|
|
265
|
+
# HTTP header 'Accept' (if needed)
|
|
266
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
267
|
+
|
|
268
|
+
# form parameters
|
|
269
|
+
form_params = opts[:form_params] || {}
|
|
270
|
+
|
|
271
|
+
# http body (model)
|
|
272
|
+
post_body = opts[:debug_body]
|
|
273
|
+
|
|
274
|
+
# return_type
|
|
275
|
+
return_type = opts[:debug_return_type] || 'SearchAdInterests200Response'
|
|
276
|
+
|
|
277
|
+
# auth_names
|
|
278
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
279
|
+
|
|
280
|
+
new_options = opts.merge(
|
|
281
|
+
:operation => :"AdTargetingApi.search_ad_interests",
|
|
282
|
+
:header_params => header_params,
|
|
283
|
+
:query_params => query_params,
|
|
284
|
+
:form_params => form_params,
|
|
285
|
+
:body => post_body,
|
|
286
|
+
:auth_names => auth_names,
|
|
287
|
+
:return_type => return_type
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
291
|
+
if @api_client.config.debugging
|
|
292
|
+
@api_client.config.logger.debug "API called: AdTargetingApi#search_ad_interests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
293
|
+
end
|
|
294
|
+
return data, status_code, headers
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# Search targeting options
|
|
298
|
+
# Resolve a human-readable query into the platform's opaque targeting ids used in the `TargetingSpec` (`countries`/`regions`/`cities`/`zips`/`metros` geo keys, and `interests`/`behaviors` entity ids) on `POST /v1/ads/create`, `POST /v1/ads/targeting/reach-estimate`, and `saved_targeting` audiences. The `dimension` param selects what is searched, `geo` (locations, further scoped by `geoType`), `interest`, `behavior`, or `income`. Availability of each dimension varies by platform (e.g. behaviours are Meta/TikTok only). Results are normalized across platforms into a single shape, so the same client code consumes Meta, TikTok, LinkedIn, X, Pinterest, and Google results. TikTok geo searches return every matching level in one list (`type` is `country`, `region`, `city`, `district`, or `metro` for DMA areas) — `geoType` is not applied. Results are scoped to the advertiser's targetable markets, and every id is usable in `regions`/`cities`/`metros` keys on `POST /v1/ads/create`. For geo queries, `q` should contain only the locality name (e.g. `\"Amsterdam\"`, not `\"Amsterdam, NL\"`). Use `countryCode` to disambiguate.
|
|
299
|
+
# @param account_id [String] Social account ID (a connected account on the target ad platform).
|
|
300
|
+
# @param q [String] Search query. For geo, the locality name only (no region/country suffix).
|
|
301
|
+
# @param [Hash] opts the optional parameters
|
|
302
|
+
# @option opts [String] :dimension What to search. `geo` resolves locations (scope further with `geoType`), `interest`/`behavior` resolve audience entities, `income` resolves income-tier options. Defaults to `interest` for backward compatibility with the deprecated /v1/ads/interests alias. (default to 'interest')
|
|
303
|
+
# @option opts [String] :geo_type Only used when `dimension=geo`. The kind of location to resolve. Defaults to `city`. (default to 'city')
|
|
304
|
+
# @option opts [String] :country_code ISO 3166-1 alpha-2 country code (e.g. NL) to scope a geo search.
|
|
305
|
+
# @option opts [Integer] :limit Maximum results to return. (default to 25)
|
|
306
|
+
# @return [SearchAdTargeting200Response]
|
|
307
|
+
def search_ad_targeting(account_id, q, opts = {})
|
|
308
|
+
data, _status_code, _headers = search_ad_targeting_with_http_info(account_id, q, opts)
|
|
309
|
+
data
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# Search targeting options
|
|
313
|
+
# Resolve a human-readable query into the platform's opaque targeting ids used in the `TargetingSpec` (`countries`/`regions`/`cities`/`zips`/`metros` geo keys, and `interests`/`behaviors` entity ids) on `POST /v1/ads/create`, `POST /v1/ads/targeting/reach-estimate`, and `saved_targeting` audiences. The `dimension` param selects what is searched, `geo` (locations, further scoped by `geoType`), `interest`, `behavior`, or `income`. Availability of each dimension varies by platform (e.g. behaviours are Meta/TikTok only). Results are normalized across platforms into a single shape, so the same client code consumes Meta, TikTok, LinkedIn, X, Pinterest, and Google results. TikTok geo searches return every matching level in one list (`type` is `country`, `region`, `city`, `district`, or `metro` for DMA areas) — `geoType` is not applied. Results are scoped to the advertiser's targetable markets, and every id is usable in `regions`/`cities`/`metros` keys on `POST /v1/ads/create`. For geo queries, `q` should contain only the locality name (e.g. `\"Amsterdam\"`, not `\"Amsterdam, NL\"`). Use `countryCode` to disambiguate.
|
|
314
|
+
# @param account_id [String] Social account ID (a connected account on the target ad platform).
|
|
315
|
+
# @param q [String] Search query. For geo, the locality name only (no region/country suffix).
|
|
316
|
+
# @param [Hash] opts the optional parameters
|
|
317
|
+
# @option opts [String] :dimension What to search. `geo` resolves locations (scope further with `geoType`), `interest`/`behavior` resolve audience entities, `income` resolves income-tier options. Defaults to `interest` for backward compatibility with the deprecated /v1/ads/interests alias. (default to 'interest')
|
|
318
|
+
# @option opts [String] :geo_type Only used when `dimension=geo`. The kind of location to resolve. Defaults to `city`. (default to 'city')
|
|
319
|
+
# @option opts [String] :country_code ISO 3166-1 alpha-2 country code (e.g. NL) to scope a geo search.
|
|
320
|
+
# @option opts [Integer] :limit Maximum results to return. (default to 25)
|
|
321
|
+
# @return [Array<(SearchAdTargeting200Response, Integer, Hash)>] SearchAdTargeting200Response data, response status code and response headers
|
|
322
|
+
def search_ad_targeting_with_http_info(account_id, q, opts = {})
|
|
323
|
+
if @api_client.config.debugging
|
|
324
|
+
@api_client.config.logger.debug 'Calling API: AdTargetingApi.search_ad_targeting ...'
|
|
325
|
+
end
|
|
326
|
+
# verify the required parameter 'account_id' is set
|
|
327
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
328
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AdTargetingApi.search_ad_targeting"
|
|
329
|
+
end
|
|
330
|
+
# verify the required parameter 'q' is set
|
|
331
|
+
if @api_client.config.client_side_validation && q.nil?
|
|
332
|
+
fail ArgumentError, "Missing the required parameter 'q' when calling AdTargetingApi.search_ad_targeting"
|
|
333
|
+
end
|
|
334
|
+
allowable_values = ["geo", "interest", "behavior", "income"]
|
|
335
|
+
if @api_client.config.client_side_validation && opts[:'dimension'] && !allowable_values.include?(opts[:'dimension'])
|
|
336
|
+
fail ArgumentError, "invalid value for \"dimension\", must be one of #{allowable_values}"
|
|
337
|
+
end
|
|
338
|
+
allowable_values = ["country", "region", "city", "zip", "metro"]
|
|
339
|
+
if @api_client.config.client_side_validation && opts[:'geo_type'] && !allowable_values.include?(opts[:'geo_type'])
|
|
340
|
+
fail ArgumentError, "invalid value for \"geo_type\", must be one of #{allowable_values}"
|
|
341
|
+
end
|
|
342
|
+
if @api_client.config.client_side_validation && !opts[:'country_code'].nil? && opts[:'country_code'].to_s.length > 2
|
|
343
|
+
fail ArgumentError, 'invalid value for "opts[:"country_code"]" when calling AdTargetingApi.search_ad_targeting, the character length must be smaller than or equal to 2.'
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
if @api_client.config.client_side_validation && !opts[:'country_code'].nil? && opts[:'country_code'].to_s.length < 2
|
|
347
|
+
fail ArgumentError, 'invalid value for "opts[:"country_code"]" when calling AdTargetingApi.search_ad_targeting, the character length must be greater than or equal to 2.'
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
351
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdTargetingApi.search_ad_targeting, must be smaller than or equal to 100.'
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
355
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdTargetingApi.search_ad_targeting, must be greater than or equal to 1.'
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
# resource path
|
|
359
|
+
local_var_path = '/v1/ads/targeting/search'
|
|
360
|
+
|
|
361
|
+
# query parameters
|
|
362
|
+
query_params = opts[:query_params] || {}
|
|
363
|
+
query_params[:'accountId'] = account_id
|
|
364
|
+
query_params[:'q'] = q
|
|
365
|
+
query_params[:'dimension'] = opts[:'dimension'] if !opts[:'dimension'].nil?
|
|
366
|
+
query_params[:'geoType'] = opts[:'geo_type'] if !opts[:'geo_type'].nil?
|
|
367
|
+
query_params[:'countryCode'] = opts[:'country_code'] if !opts[:'country_code'].nil?
|
|
368
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
369
|
+
|
|
370
|
+
# header parameters
|
|
371
|
+
header_params = opts[:header_params] || {}
|
|
372
|
+
# HTTP header 'Accept' (if needed)
|
|
373
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
374
|
+
|
|
375
|
+
# form parameters
|
|
376
|
+
form_params = opts[:form_params] || {}
|
|
377
|
+
|
|
378
|
+
# http body (model)
|
|
379
|
+
post_body = opts[:debug_body]
|
|
380
|
+
|
|
381
|
+
# return_type
|
|
382
|
+
return_type = opts[:debug_return_type] || 'SearchAdTargeting200Response'
|
|
383
|
+
|
|
384
|
+
# auth_names
|
|
385
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
386
|
+
|
|
387
|
+
new_options = opts.merge(
|
|
388
|
+
:operation => :"AdTargetingApi.search_ad_targeting",
|
|
389
|
+
:header_params => header_params,
|
|
390
|
+
:query_params => query_params,
|
|
391
|
+
:form_params => form_params,
|
|
392
|
+
:body => post_body,
|
|
393
|
+
:auth_names => auth_names,
|
|
394
|
+
:return_type => return_type
|
|
395
|
+
)
|
|
396
|
+
|
|
397
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
398
|
+
if @api_client.config.debugging
|
|
399
|
+
@api_client.config.logger.debug "API called: AdTargetingApi#search_ad_targeting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
400
|
+
end
|
|
401
|
+
return data, status_code, headers
|
|
402
|
+
end
|
|
403
|
+
end
|
|
404
|
+
end
|
|
@@ -1614,12 +1614,12 @@ module Zernio
|
|
|
1614
1614
|
end
|
|
1615
1615
|
|
|
1616
1616
|
# Get YouTube daily views
|
|
1617
|
-
# Returns daily view counts for a YouTube video including views, watch time, and subscriber changes. Requires yt-analytics.readonly scope (re-authorization may be needed).
|
|
1617
|
+
# Returns daily view counts for a YouTube video including views, watch time, and subscriber changes. Requires yt-analytics.readonly scope (re-authorization may be needed). YouTube finalizes analytics with a ~3-day delay; by default only finalized days are returned, and an explicit endDate can reach into the delay window (see the endDate parameter). Max 90 days, defaults to last 30 days.
|
|
1618
1618
|
# @param video_id [String] The YouTube video ID (e.g., \"dQw4w9WgXcQ\")
|
|
1619
1619
|
# @param account_id [String] The Zernio account ID for the YouTube account
|
|
1620
1620
|
# @param [Hash] opts the optional parameters
|
|
1621
1621
|
# @option opts [Date] :start_date Start date (YYYY-MM-DD). Defaults to 30 days ago.
|
|
1622
|
-
# @option opts [Date] :end_date End date (YYYY-MM-DD). Defaults to 3 days ago (YouTube
|
|
1622
|
+
# @option opts [Date] :end_date End date (YYYY-MM-DD). Defaults to 3 days ago, the newest fully finalized day (YouTube finalizes analytics with a ~3-day delay). An explicit endDate is honored up to today: days inside the delay window are provisional and may still be revised by YouTube (see provisionalSince in the response), and days YouTube has not processed yet are omitted from dailyViews.
|
|
1623
1623
|
# @return [YouTubeDailyViewsResponse]
|
|
1624
1624
|
def get_you_tube_daily_views(video_id, account_id, opts = {})
|
|
1625
1625
|
data, _status_code, _headers = get_you_tube_daily_views_with_http_info(video_id, account_id, opts)
|
|
@@ -1627,12 +1627,12 @@ module Zernio
|
|
|
1627
1627
|
end
|
|
1628
1628
|
|
|
1629
1629
|
# Get YouTube daily views
|
|
1630
|
-
# Returns daily view counts for a YouTube video including views, watch time, and subscriber changes. Requires yt-analytics.readonly scope (re-authorization may be needed).
|
|
1630
|
+
# Returns daily view counts for a YouTube video including views, watch time, and subscriber changes. Requires yt-analytics.readonly scope (re-authorization may be needed). YouTube finalizes analytics with a ~3-day delay; by default only finalized days are returned, and an explicit endDate can reach into the delay window (see the endDate parameter). Max 90 days, defaults to last 30 days.
|
|
1631
1631
|
# @param video_id [String] The YouTube video ID (e.g., \"dQw4w9WgXcQ\")
|
|
1632
1632
|
# @param account_id [String] The Zernio account ID for the YouTube account
|
|
1633
1633
|
# @param [Hash] opts the optional parameters
|
|
1634
1634
|
# @option opts [Date] :start_date Start date (YYYY-MM-DD). Defaults to 30 days ago.
|
|
1635
|
-
# @option opts [Date] :end_date End date (YYYY-MM-DD). Defaults to 3 days ago (YouTube
|
|
1635
|
+
# @option opts [Date] :end_date End date (YYYY-MM-DD). Defaults to 3 days ago, the newest fully finalized day (YouTube finalizes analytics with a ~3-day delay). An explicit endDate is honored up to today: days inside the delay window are provisional and may still be revised by YouTube (see provisionalSince in the response), and days YouTube has not processed yet are omitted from dailyViews.
|
|
1636
1636
|
# @return [Array<(YouTubeDailyViewsResponse, Integer, Hash)>] YouTubeDailyViewsResponse data, response status code and response headers
|
|
1637
1637
|
def get_you_tube_daily_views_with_http_info(video_id, account_id, opts = {})
|
|
1638
1638
|
if @api_client.config.debugging
|
|
@@ -1697,7 +1697,7 @@ module Zernio
|
|
|
1697
1697
|
# @option opts [String] :video_id YouTube video ID. When provided, demographics are scoped to this single video (must belong to the connected channel; otherwise 404 video_not_found).
|
|
1698
1698
|
# @option opts [String] :breakdown Comma-separated list of demographic dimensions: age, gender, country. Defaults to all three if omitted.
|
|
1699
1699
|
# @option opts [Date] :start_date Start date in YYYY-MM-DD format. Defaults to 90 days ago, or to the video's publish date (lifetime) when videoId is provided.
|
|
1700
|
-
# @option opts [Date] :end_date End date
|
|
1700
|
+
# @option opts [Date] :end_date End date (YYYY-MM-DD). Defaults to 3 days ago, the newest fully finalized day (YouTube finalizes analytics with a ~3-day delay). An explicit endDate is honored up to today: days inside the delay window are provisional and may still be revised by YouTube (see provisionalSince in the response).
|
|
1701
1701
|
# @return [YouTubeDemographicsResponse]
|
|
1702
1702
|
def get_you_tube_demographics(account_id, opts = {})
|
|
1703
1703
|
data, _status_code, _headers = get_you_tube_demographics_with_http_info(account_id, opts)
|
|
@@ -1711,7 +1711,7 @@ module Zernio
|
|
|
1711
1711
|
# @option opts [String] :video_id YouTube video ID. When provided, demographics are scoped to this single video (must belong to the connected channel; otherwise 404 video_not_found).
|
|
1712
1712
|
# @option opts [String] :breakdown Comma-separated list of demographic dimensions: age, gender, country. Defaults to all three if omitted.
|
|
1713
1713
|
# @option opts [Date] :start_date Start date in YYYY-MM-DD format. Defaults to 90 days ago, or to the video's publish date (lifetime) when videoId is provided.
|
|
1714
|
-
# @option opts [Date] :end_date End date
|
|
1714
|
+
# @option opts [Date] :end_date End date (YYYY-MM-DD). Defaults to 3 days ago, the newest fully finalized day (YouTube finalizes analytics with a ~3-day delay). An explicit endDate is honored up to today: days inside the delay window are provisional and may still be revised by YouTube (see provisionalSince in the response).
|
|
1715
1715
|
# @return [Array<(YouTubeDemographicsResponse, Integer, Hash)>] YouTubeDemographicsResponse data, response status code and response headers
|
|
1716
1716
|
def get_you_tube_demographics_with_http_info(account_id, opts = {})
|
|
1717
1717
|
if @api_client.config.debugging
|
|
@@ -1772,7 +1772,7 @@ module Zernio
|
|
|
1772
1772
|
# @param account_id [String] The Zernio account ID for the YouTube account
|
|
1773
1773
|
# @param [Hash] opts the optional parameters
|
|
1774
1774
|
# @option opts [Date] :start_date Start date (YYYY-MM-DD). Defaults to the video's publish date (lifetime curve).
|
|
1775
|
-
# @option opts [Date] :end_date End date (YYYY-MM-DD). Defaults to 3 days ago (YouTube
|
|
1775
|
+
# @option opts [Date] :end_date End date (YYYY-MM-DD). Defaults to 3 days ago, the newest fully finalized day (YouTube finalizes analytics with a ~3-day delay). An explicit endDate is honored up to today: days inside the delay window are provisional and may still be revised by YouTube (see provisionalSince in the response).
|
|
1776
1776
|
# @return [YouTubeVideoRetentionResponse]
|
|
1777
1777
|
def get_you_tube_video_retention(video_id, account_id, opts = {})
|
|
1778
1778
|
data, _status_code, _headers = get_you_tube_video_retention_with_http_info(video_id, account_id, opts)
|
|
@@ -1785,7 +1785,7 @@ module Zernio
|
|
|
1785
1785
|
# @param account_id [String] The Zernio account ID for the YouTube account
|
|
1786
1786
|
# @param [Hash] opts the optional parameters
|
|
1787
1787
|
# @option opts [Date] :start_date Start date (YYYY-MM-DD). Defaults to the video's publish date (lifetime curve).
|
|
1788
|
-
# @option opts [Date] :end_date End date (YYYY-MM-DD). Defaults to 3 days ago (YouTube
|
|
1788
|
+
# @option opts [Date] :end_date End date (YYYY-MM-DD). Defaults to 3 days ago, the newest fully finalized day (YouTube finalizes analytics with a ~3-day delay). An explicit endDate is honored up to today: days inside the delay window are provisional and may still be revised by YouTube (see provisionalSince in the response).
|
|
1789
1789
|
# @return [Array<(YouTubeVideoRetentionResponse, Integer, Hash)>] YouTubeVideoRetentionResponse data, response status code and response headers
|
|
1790
1790
|
def get_you_tube_video_retention_with_http_info(video_id, account_id, opts = {})
|
|
1791
1791
|
if @api_client.config.debugging
|