Class: Late::AnalyticsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/late-sdk/api/analytics_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AnalyticsApi

Returns a new instance of AnalyticsApi.



19
20
21
# File 'lib/late-sdk/api/analytics_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/late-sdk/api/analytics_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_analytics(opts = {}) ⇒ GetAnalytics200Response

Get post analytics Returns analytics for posts. With postId, returns a single post. Without it, returns a paginated list with overview stats. Accepts both Zernio Post IDs and External Post IDs (auto-resolved). fromDate defaults to 90 days ago if omitted, max range 366 days. Single post lookups may return 202 (sync pending) or 424 (all platforms failed). For follower stats, use /v1/accounts/follower-stats.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :post_id (String)

    Returns analytics for a single post. Accepts both Zernio Post IDs and External Post IDs. Zernio IDs are auto-resolved to External Post analytics.

  • :platform (String)

    Filter by platform (default "all")

  • :profile_id (String)

    Filter by profile ID (default "all")

  • :source (String)

    Filter by post source: late (posted via Zernio API), external (synced from platform), all (default) (default to ‘all’)

  • :from_date (Date)

    Inclusive lower bound (YYYY-MM-DD). Defaults to 90 days ago if omitted. Max range is 366 days.

  • :to_date (Date)

    Inclusive upper bound (YYYY-MM-DD). Defaults to today if omitted.

  • :limit (Integer)

    Page size (default 50) (default to 50)

  • :page (Integer)

    Page number (default 1) (default to 1)

  • :sort_by (String)

    Sort by date, engagement, or a specific metric (default to ‘date’)

  • :order (String)

    Sort order (default to ‘desc’)

Returns:



36
37
38
39
# File 'lib/late-sdk/api/analytics_api.rb', line 36

def get_analytics(opts = {})
  data, _status_code, _headers = get_analytics_with_http_info(opts)
  data
end

#get_analytics_with_http_info(opts = {}) ⇒ Array<(GetAnalytics200Response, Integer, Hash)>

Get post analytics Returns analytics for posts. With postId, returns a single post. Without it, returns a paginated list with overview stats. Accepts both Zernio Post IDs and External Post IDs (auto-resolved). fromDate defaults to 90 days ago if omitted, max range 366 days. Single post lookups may return 202 (sync pending) or 424 (all platforms failed). For follower stats, use /v1/accounts/follower-stats.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :post_id (String)

    Returns analytics for a single post. Accepts both Zernio Post IDs and External Post IDs. Zernio IDs are auto-resolved to External Post analytics.

  • :platform (String)

    Filter by platform (default &quot;all&quot;)

  • :profile_id (String)

    Filter by profile ID (default &quot;all&quot;)

  • :source (String)

    Filter by post source: late (posted via Zernio API), external (synced from platform), all (default) (default to ‘all’)

  • :from_date (Date)

    Inclusive lower bound (YYYY-MM-DD). Defaults to 90 days ago if omitted. Max range is 366 days.

  • :to_date (Date)

    Inclusive upper bound (YYYY-MM-DD). Defaults to today if omitted.

  • :limit (Integer)

    Page size (default 50) (default to 50)

  • :page (Integer)

    Page number (default 1) (default to 1)

  • :sort_by (String)

    Sort by date, engagement, or a specific metric (default to ‘date’)

  • :order (String)

    Sort order (default to ‘desc’)

Returns:

  • (Array<(GetAnalytics200Response, Integer, Hash)>)

    GetAnalytics200Response data, response status code and response headers



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
# File 'lib/late-sdk/api/analytics_api.rb', line 55

def get_analytics_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_analytics ...'
  end
  allowable_values = ["all", "late", "external"]
  if @api_client.config.client_side_validation && opts[:'source'] && !allowable_values.include?(opts[:'source'])
    fail ArgumentError, "invalid value for \"source\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AnalyticsApi.get_analytics, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AnalyticsApi.get_analytics, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AnalyticsApi.get_analytics, must be greater than or equal to 1.'
  end

  allowable_values = ["date", "engagement", "impressions", "reach", "likes", "comments", "shares", "saves", "clicks", "views"]
  if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
    fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/analytics'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'postId'] = opts[:'post_id'] if !opts[:'post_id'].nil?
  query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
  query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetAnalytics200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AnalyticsApi.get_analytics",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AnalyticsApi#get_analytics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_best_time_to_post(opts = {}) ⇒ GetBestTimeToPost200Response

Get best times to post Returns the best times to post based on historical engagement data. Groups all published posts by day of week and hour (UTC), calculating average engagement per slot. Use this to auto-schedule posts at optimal times. Requires the Analytics add-on.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :platform (String)

    Filter by platform (e.g. &quot;instagram&quot;, &quot;tiktok&quot;). Omit for all platforms.

  • :profile_id (String)

    Filter by profile ID. Omit for all profiles.

  • :source (String)

    Filter by post origin. &quot;late&quot; for posts published via Zernio, &quot;external&quot; for posts imported from platforms. (default to ‘all’)

Returns:



140
141
142
143
# File 'lib/late-sdk/api/analytics_api.rb', line 140

def get_best_time_to_post(opts = {})
  data, _status_code, _headers = get_best_time_to_post_with_http_info(opts)
  data
end

#get_best_time_to_post_with_http_info(opts = {}) ⇒ Array<(GetBestTimeToPost200Response, Integer, Hash)>

Get best times to post Returns the best times to post based on historical engagement data. Groups all published posts by day of week and hour (UTC), calculating average engagement per slot. Use this to auto-schedule posts at optimal times. Requires the Analytics add-on.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :platform (String)

    Filter by platform (e.g. &quot;instagram&quot;, &quot;tiktok&quot;). Omit for all platforms.

  • :profile_id (String)

    Filter by profile ID. Omit for all profiles.

  • :source (String)

    Filter by post origin. &quot;late&quot; for posts published via Zernio, &quot;external&quot; for posts imported from platforms. (default to ‘all’)

Returns:



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
# File 'lib/late-sdk/api/analytics_api.rb', line 152

def get_best_time_to_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_best_time_to_post ...'
  end
  allowable_values = ["all", "late", "external"]
  if @api_client.config.client_side_validation && opts[:'source'] && !allowable_values.include?(opts[:'source'])
    fail ArgumentError, "invalid value for \"source\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/analytics/best-time'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetBestTimeToPost200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AnalyticsApi.get_best_time_to_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AnalyticsApi#get_best_time_to_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_content_decay(opts = {}) ⇒ GetContentDecay200Response

Get content performance decay Returns how engagement accumulates over time after a post is published. Each bucket shows what percentage of the post’s total engagement had been reached by that time window. Useful for understanding content lifespan (e.g. "posts reach 78% of total engagement within 24 hours"). Requires the Analytics add-on.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :platform (String)

    Filter by platform (e.g. &quot;instagram&quot;, &quot;tiktok&quot;). Omit for all platforms.

  • :profile_id (String)

    Filter by profile ID. Omit for all profiles.

  • :source (String)

    Filter by post origin. &quot;late&quot; for posts published via Zernio, &quot;external&quot; for posts imported from platforms. (default to ‘all’)

Returns:



210
211
212
213
# File 'lib/late-sdk/api/analytics_api.rb', line 210

def get_content_decay(opts = {})
  data, _status_code, _headers = get_content_decay_with_http_info(opts)
  data
end

#get_content_decay_with_http_info(opts = {}) ⇒ Array<(GetContentDecay200Response, Integer, Hash)>

Get content performance decay Returns how engagement accumulates over time after a post is published. Each bucket shows what percentage of the post&#39;s total engagement had been reached by that time window. Useful for understanding content lifespan (e.g. &quot;posts reach 78% of total engagement within 24 hours&quot;). Requires the Analytics add-on.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :platform (String)

    Filter by platform (e.g. &quot;instagram&quot;, &quot;tiktok&quot;). Omit for all platforms.

  • :profile_id (String)

    Filter by profile ID. Omit for all profiles.

  • :source (String)

    Filter by post origin. &quot;late&quot; for posts published via Zernio, &quot;external&quot; for posts imported from platforms. (default to ‘all’)

Returns:

  • (Array<(GetContentDecay200Response, Integer, Hash)>)

    GetContentDecay200Response data, response status code and response headers



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
# File 'lib/late-sdk/api/analytics_api.rb', line 222

def get_content_decay_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_content_decay ...'
  end
  allowable_values = ["all", "late", "external"]
  if @api_client.config.client_side_validation && opts[:'source'] && !allowable_values.include?(opts[:'source'])
    fail ArgumentError, "invalid value for \"source\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/analytics/content-decay'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetContentDecay200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AnalyticsApi.get_content_decay",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AnalyticsApi#get_content_decay\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_daily_metrics(opts = {}) ⇒ GetDailyMetrics200Response

Get daily aggregated metrics Returns daily aggregated analytics metrics and a per-platform breakdown. Each day includes post count, platform distribution, and summed metrics (impressions, reach, likes, comments, shares, saves, clicks, views). Defaults to the last 180 days. Requires the Analytics add-on.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :platform (String)

    Filter by platform (e.g. &quot;instagram&quot;, &quot;tiktok&quot;). Omit for all platforms.

  • :profile_id (String)

    Filter by profile ID. Omit for all profiles.

  • :from_date (Time)

    Inclusive start date (ISO 8601). Defaults to 180 days ago.

  • :to_date (Time)

    Inclusive end date (ISO 8601). Defaults to now.

  • :source (String)

    Filter by post origin. &quot;late&quot; for posts published via Zernio, &quot;external&quot; for posts imported from platforms. (default to ‘all’)

Returns:



282
283
284
285
# File 'lib/late-sdk/api/analytics_api.rb', line 282

def get_daily_metrics(opts = {})
  data, _status_code, _headers = get_daily_metrics_with_http_info(opts)
  data
end

#get_daily_metrics_with_http_info(opts = {}) ⇒ Array<(GetDailyMetrics200Response, Integer, Hash)>

Get daily aggregated metrics Returns daily aggregated analytics metrics and a per-platform breakdown. Each day includes post count, platform distribution, and summed metrics (impressions, reach, likes, comments, shares, saves, clicks, views). Defaults to the last 180 days. Requires the Analytics add-on.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :platform (String)

    Filter by platform (e.g. &quot;instagram&quot;, &quot;tiktok&quot;). Omit for all platforms.

  • :profile_id (String)

    Filter by profile ID. Omit for all profiles.

  • :from_date (Time)

    Inclusive start date (ISO 8601). Defaults to 180 days ago.

  • :to_date (Time)

    Inclusive end date (ISO 8601). Defaults to now.

  • :source (String)

    Filter by post origin. &quot;late&quot; for posts published via Zernio, &quot;external&quot; for posts imported from platforms. (default to ‘all’)

Returns:

  • (Array<(GetDailyMetrics200Response, Integer, Hash)>)

    GetDailyMetrics200Response data, response status code and response headers



296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/late-sdk/api/analytics_api.rb', line 296

def get_daily_metrics_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_daily_metrics ...'
  end
  allowable_values = ["all", "late", "external"]
  if @api_client.config.client_side_validation && opts[:'source'] && !allowable_values.include?(opts[:'source'])
    fail ArgumentError, "invalid value for \"source\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/analytics/daily-metrics'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
  query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil?
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetDailyMetrics200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AnalyticsApi.get_daily_metrics",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AnalyticsApi#get_daily_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_follower_stats(opts = {}) ⇒ GetFollowerStats200Response

Get follower stats Returns follower count history and growth metrics for connected social accounts. Requires analytics add-on subscription. Follower counts are refreshed once per day.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_ids (String)

    Comma-separated list of account IDs (optional, defaults to all user&#39;s accounts)

  • :profile_id (String)

    Filter by profile ID

  • :from_date (Date)

    Start date in YYYY-MM-DD format (defaults to 30 days ago)

  • :to_date (Date)

    End date in YYYY-MM-DD format (defaults to today)

  • :granularity (String)

    Data aggregation level (default to ‘daily’)

Returns:



358
359
360
361
# File 'lib/late-sdk/api/analytics_api.rb', line 358

def get_follower_stats(opts = {})
  data, _status_code, _headers = get_follower_stats_with_http_info(opts)
  data
end

#get_follower_stats_with_http_info(opts = {}) ⇒ Array<(GetFollowerStats200Response, Integer, Hash)>

Get follower stats Returns follower count history and growth metrics for connected social accounts. Requires analytics add-on subscription. Follower counts are refreshed once per day.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_ids (String)

    Comma-separated list of account IDs (optional, defaults to all user&#39;s accounts)

  • :profile_id (String)

    Filter by profile ID

  • :from_date (Date)

    Start date in YYYY-MM-DD format (defaults to 30 days ago)

  • :to_date (Date)

    End date in YYYY-MM-DD format (defaults to today)

  • :granularity (String)

    Data aggregation level (default to ‘daily’)

Returns:

  • (Array<(GetFollowerStats200Response, Integer, Hash)>)

    GetFollowerStats200Response data, response status code and response headers



372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/late-sdk/api/analytics_api.rb', line 372

def get_follower_stats_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_follower_stats ...'
  end
  allowable_values = ["daily", "weekly", "monthly"]
  if @api_client.config.client_side_validation && opts[:'granularity'] && !allowable_values.include?(opts[:'granularity'])
    fail ArgumentError, "invalid value for \"granularity\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/accounts/follower-stats'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountIds'] = opts[:'account_ids'] if !opts[:'account_ids'].nil?
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
  query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil?
  query_params[:'granularity'] = opts[:'granularity'] if !opts[:'granularity'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetFollowerStats200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AnalyticsApi.get_follower_stats",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AnalyticsApi#get_follower_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_linked_in_aggregate_analytics(account_id, opts = {}) ⇒ GetLinkedInAggregateAnalytics200Response

Get LinkedIn aggregate stats Returns aggregate analytics across all posts for a LinkedIn personal account. Org accounts should use /v1/analytics instead. Requires r_member_postAnalytics scope.

Parameters:

  • account_id (String)

    The ID of the LinkedIn personal account

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :aggregation (String)

    TOTAL (default, lifetime totals) or DAILY (time series). MEMBERS_REACHED not available with DAILY. (default to ‘TOTAL’)

  • :start_date (Date)

    Start date (YYYY-MM-DD). If omitted, returns lifetime analytics.

  • :end_date (Date)

    End date (YYYY-MM-DD, exclusive). Defaults to today if omitted.

  • :metrics (String)

    Comma-separated metrics: IMPRESSION, MEMBERS_REACHED, REACTION, COMMENT, RESHARE. Omit for all.

Returns:



434
435
436
437
# File 'lib/late-sdk/api/analytics_api.rb', line 434

def get_linked_in_aggregate_analytics(, opts = {})
  data, _status_code, _headers = get_linked_in_aggregate_analytics_with_http_info(, opts)
  data
end

#get_linked_in_aggregate_analytics_with_http_info(account_id, opts = {}) ⇒ Array<(GetLinkedInAggregateAnalytics200Response, Integer, Hash)>

Get LinkedIn aggregate stats Returns aggregate analytics across all posts for a LinkedIn personal account. Org accounts should use /v1/analytics instead. Requires r_member_postAnalytics scope.

Parameters:

  • account_id (String)

    The ID of the LinkedIn personal account

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :aggregation (String)

    TOTAL (default, lifetime totals) or DAILY (time series). MEMBERS_REACHED not available with DAILY. (default to ‘TOTAL’)

  • :start_date (Date)

    Start date (YYYY-MM-DD). If omitted, returns lifetime analytics.

  • :end_date (Date)

    End date (YYYY-MM-DD, exclusive). Defaults to today if omitted.

  • :metrics (String)

    Comma-separated metrics: IMPRESSION, MEMBERS_REACHED, REACTION, COMMENT, RESHARE. Omit for all.

Returns:



448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/late-sdk/api/analytics_api.rb', line 448

def get_linked_in_aggregate_analytics_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_linked_in_aggregate_analytics ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AnalyticsApi.get_linked_in_aggregate_analytics"
  end
  allowable_values = ["TOTAL", "DAILY"]
  if @api_client.config.client_side_validation && opts[:'aggregation'] && !allowable_values.include?(opts[:'aggregation'])
    fail ArgumentError, "invalid value for \"aggregation\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/linkedin-aggregate-analytics'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'aggregation'] = opts[:'aggregation'] if !opts[:'aggregation'].nil?
  query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'metrics'] = opts[:'metrics'] if !opts[:'metrics'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLinkedInAggregateAnalytics200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AnalyticsApi.get_linked_in_aggregate_analytics",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AnalyticsApi#get_linked_in_aggregate_analytics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_linked_in_post_analytics(account_id, urn, opts = {}) ⇒ GetLinkedInPostAnalytics200Response

Get LinkedIn post stats Returns analytics for a specific LinkedIn post by URN. Works for both personal and organization accounts.

Parameters:

  • account_id (String)

    The ID of the LinkedIn account

  • urn (String)

    The LinkedIn post URN

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



510
511
512
513
# File 'lib/late-sdk/api/analytics_api.rb', line 510

def get_linked_in_post_analytics(, urn, opts = {})
  data, _status_code, _headers = get_linked_in_post_analytics_with_http_info(, urn, opts)
  data
end

#get_linked_in_post_analytics_with_http_info(account_id, urn, opts = {}) ⇒ Array<(GetLinkedInPostAnalytics200Response, Integer, Hash)>

Get LinkedIn post stats Returns analytics for a specific LinkedIn post by URN. Works for both personal and organization accounts.

Parameters:

  • account_id (String)

    The ID of the LinkedIn account

  • urn (String)

    The LinkedIn post URN

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
# File 'lib/late-sdk/api/analytics_api.rb', line 521

def get_linked_in_post_analytics_with_http_info(, urn, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_linked_in_post_analytics ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AnalyticsApi.get_linked_in_post_analytics"
  end
  # verify the required parameter 'urn' is set
  if @api_client.config.client_side_validation && urn.nil?
    fail ArgumentError, "Missing the required parameter 'urn' when calling AnalyticsApi.get_linked_in_post_analytics"
  end
  # resource path
  local_var_path = '/v1/accounts/{accountId}/linkedin-post-analytics'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'urn'] = urn

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLinkedInPostAnalytics200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AnalyticsApi.get_linked_in_post_analytics",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AnalyticsApi#get_linked_in_post_analytics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_linked_in_post_reactions(account_id, urn, opts = {}) ⇒ GetLinkedInPostReactions200Response

Get LinkedIn post reactions Returns individual reactions for a specific LinkedIn post, including reactor profiles (name, headline/job title, profile picture, profile URL, reaction type). Only works for **organization/company page** accounts. LinkedIn restricts reaction data for personal profiles (r_member_social_feed is a closed permission).

Parameters:

  • account_id (String)

    The ID of the LinkedIn organization account

  • urn (String)

    The LinkedIn post URN

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Maximum number of reactions to return per page (default to 25)

  • :cursor (String)

    Offset-based pagination start index

Returns:



582
583
584
585
# File 'lib/late-sdk/api/analytics_api.rb', line 582

def get_linked_in_post_reactions(, urn, opts = {})
  data, _status_code, _headers = get_linked_in_post_reactions_with_http_info(, urn, opts)
  data
end

#get_linked_in_post_reactions_with_http_info(account_id, urn, opts = {}) ⇒ Array<(GetLinkedInPostReactions200Response, Integer, Hash)>

Get LinkedIn post reactions Returns individual reactions for a specific LinkedIn post, including reactor profiles (name, headline/job title, profile picture, profile URL, reaction type). Only works for **organization/company page** accounts. LinkedIn restricts reaction data for personal profiles (r_member_social_feed is a closed permission).

Parameters:

  • account_id (String)

    The ID of the LinkedIn organization account

  • urn (String)

    The LinkedIn post URN

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Maximum number of reactions to return per page (default to 25)

  • :cursor (String)

    Offset-based pagination start index

Returns:



595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/late-sdk/api/analytics_api.rb', line 595

def get_linked_in_post_reactions_with_http_info(, urn, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_linked_in_post_reactions ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AnalyticsApi.get_linked_in_post_reactions"
  end
  # verify the required parameter 'urn' is set
  if @api_client.config.client_side_validation && urn.nil?
    fail ArgumentError, "Missing the required parameter 'urn' when calling AnalyticsApi.get_linked_in_post_reactions"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AnalyticsApi.get_linked_in_post_reactions, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AnalyticsApi.get_linked_in_post_reactions, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/accounts/{accountId}/linkedin-post-reactions'.sub('{' + 'accountId' + '}', CGI.escape(.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'urn'] = urn
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLinkedInPostReactions200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AnalyticsApi.get_linked_in_post_reactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AnalyticsApi#get_linked_in_post_reactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_post_timeline(post_id, opts = {}) ⇒ GetPostTimeline200Response

Get post analytics timeline Returns a daily timeline of analytics metrics for a specific post, showing how impressions, likes, and other metrics evolved day-by-day since publishing. Each row represents one day of data per platform. For multi-platform Zernio posts, returns separate rows for each platform. Requires the Analytics add-on.

Parameters:

  • post_id (String)

    The post to fetch timeline for. Accepts an ExternalPost ID, a platformPostId, or a Zernio Post ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :from_date (Time)

    Start of date range (ISO 8601). Defaults to 90 days ago.

  • :to_date (Time)

    End of date range (ISO 8601). Defaults to now.

Returns:



665
666
667
668
# File 'lib/late-sdk/api/analytics_api.rb', line 665

def get_post_timeline(post_id, opts = {})
  data, _status_code, _headers = get_post_timeline_with_http_info(post_id, opts)
  data
end

#get_post_timeline_with_http_info(post_id, opts = {}) ⇒ Array<(GetPostTimeline200Response, Integer, Hash)>

Get post analytics timeline Returns a daily timeline of analytics metrics for a specific post, showing how impressions, likes, and other metrics evolved day-by-day since publishing. Each row represents one day of data per platform. For multi-platform Zernio posts, returns separate rows for each platform. Requires the Analytics add-on.

Parameters:

  • post_id (String)

    The post to fetch timeline for. Accepts an ExternalPost ID, a platformPostId, or a Zernio Post ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :from_date (Time)

    Start of date range (ISO 8601). Defaults to 90 days ago.

  • :to_date (Time)

    End of date range (ISO 8601). Defaults to now.

Returns:

  • (Array<(GetPostTimeline200Response, Integer, Hash)>)

    GetPostTimeline200Response data, response status code and response headers



677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
# File 'lib/late-sdk/api/analytics_api.rb', line 677

def get_post_timeline_with_http_info(post_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_post_timeline ...'
  end
  # verify the required parameter 'post_id' is set
  if @api_client.config.client_side_validation && post_id.nil?
    fail ArgumentError, "Missing the required parameter 'post_id' when calling AnalyticsApi.get_post_timeline"
  end
  # resource path
  local_var_path = '/v1/analytics/post-timeline'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'postId'] = post_id
  query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
  query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetPostTimeline200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AnalyticsApi.get_post_timeline",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AnalyticsApi#get_post_timeline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_posting_frequency(opts = {}) ⇒ GetPostingFrequency200Response

Get posting frequency vs engagement Returns the correlation between posting frequency (posts per week) and engagement rate, broken down by platform. Helps find the optimal posting cadence for each platform. Each row represents a specific (platform, posts_per_week) combination with the average engagement rate observed across all weeks matching that frequency. Requires the Analytics add-on.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :platform (String)

    Filter by platform (e.g. &quot;instagram&quot;, &quot;tiktok&quot;). Omit for all platforms.

  • :profile_id (String)

    Filter by profile ID. Omit for all profiles.

  • :source (String)

    Filter by post origin. &quot;late&quot; for posts published via Zernio, &quot;external&quot; for posts imported from platforms. (default to ‘all’)

Returns:



735
736
737
738
# File 'lib/late-sdk/api/analytics_api.rb', line 735

def get_posting_frequency(opts = {})
  data, _status_code, _headers = get_posting_frequency_with_http_info(opts)
  data
end

#get_posting_frequency_with_http_info(opts = {}) ⇒ Array<(GetPostingFrequency200Response, Integer, Hash)>

Get posting frequency vs engagement Returns the correlation between posting frequency (posts per week) and engagement rate, broken down by platform. Helps find the optimal posting cadence for each platform. Each row represents a specific (platform, posts_per_week) combination with the average engagement rate observed across all weeks matching that frequency. Requires the Analytics add-on.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :platform (String)

    Filter by platform (e.g. &quot;instagram&quot;, &quot;tiktok&quot;). Omit for all platforms.

  • :profile_id (String)

    Filter by profile ID. Omit for all profiles.

  • :source (String)

    Filter by post origin. &quot;late&quot; for posts published via Zernio, &quot;external&quot; for posts imported from platforms. (default to ‘all’)

Returns:



747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
# File 'lib/late-sdk/api/analytics_api.rb', line 747

def get_posting_frequency_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_posting_frequency ...'
  end
  allowable_values = ["all", "late", "external"]
  if @api_client.config.client_side_validation && opts[:'source'] && !allowable_values.include?(opts[:'source'])
    fail ArgumentError, "invalid value for \"source\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/analytics/posting-frequency'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetPostingFrequency200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AnalyticsApi.get_posting_frequency",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AnalyticsApi#get_posting_frequency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_you_tube_daily_views(video_id, account_id, opts = {}) ⇒ YouTubeDailyViewsResponse

Get YouTube daily views 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). Data has a 2-3 day delay. Max 90 days, defaults to last 30 days.

Parameters:

  • video_id (String)

    The YouTube video ID (e.g., &quot;dQw4w9WgXcQ&quot;)

  • account_id (String)

    The Zernio account ID for the YouTube account

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :start_date (Date)

    Start date (YYYY-MM-DD). Defaults to 30 days ago.

  • :end_date (Date)

    End date (YYYY-MM-DD). Defaults to 3 days ago (YouTube data latency).

Returns:



806
807
808
809
# File 'lib/late-sdk/api/analytics_api.rb', line 806

def get_you_tube_daily_views(video_id, , opts = {})
  data, _status_code, _headers = get_you_tube_daily_views_with_http_info(video_id, , opts)
  data
end

#get_you_tube_daily_views_with_http_info(video_id, account_id, opts = {}) ⇒ Array<(YouTubeDailyViewsResponse, Integer, Hash)>

Get YouTube daily views 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). Data has a 2-3 day delay. Max 90 days, defaults to last 30 days.

Parameters:

  • video_id (String)

    The YouTube video ID (e.g., &quot;dQw4w9WgXcQ&quot;)

  • account_id (String)

    The Zernio account ID for the YouTube account

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :start_date (Date)

    Start date (YYYY-MM-DD). Defaults to 30 days ago.

  • :end_date (Date)

    End date (YYYY-MM-DD). Defaults to 3 days ago (YouTube data latency).

Returns:

  • (Array<(YouTubeDailyViewsResponse, Integer, Hash)>)

    YouTubeDailyViewsResponse data, response status code and response headers



819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'lib/late-sdk/api/analytics_api.rb', line 819

def get_you_tube_daily_views_with_http_info(video_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_you_tube_daily_views ...'
  end
  # verify the required parameter 'video_id' is set
  if @api_client.config.client_side_validation && video_id.nil?
    fail ArgumentError, "Missing the required parameter 'video_id' when calling AnalyticsApi.get_you_tube_daily_views"
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AnalyticsApi.get_you_tube_daily_views"
  end
  # resource path
  local_var_path = '/v1/analytics/youtube/daily-views'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'videoId'] = video_id
  query_params[:'accountId'] = 
  query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'YouTubeDailyViewsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"AnalyticsApi.get_you_tube_daily_views",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AnalyticsApi#get_you_tube_daily_views\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end