Class: Zernio::CommentsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zernio-sdk/api/comments_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CommentsApi

Returns a new instance of CommentsApi.



19
20
21
# File 'lib/zernio-sdk/api/comments_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/zernio-sdk/api/comments_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_inbox_comment(post_id, account_id, comment_id, opts = {}) ⇒ DeleteInboxComment200Response

Delete comment Delete a comment on a post. Supported by Facebook, Instagram, Bluesky, Reddit, YouTube, and LinkedIn. Requires accountId and commentId query parameters.

Parameters:

  • post_id (String)

    Zernio post ID or platform-specific post ID. LinkedIn third-party posts accept full activity URN or numeric ID.

  • account_id (String)
  • comment_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



29
30
31
32
# File 'lib/zernio-sdk/api/comments_api.rb', line 29

def delete_inbox_comment(post_id, , comment_id, opts = {})
  data, _status_code, _headers = delete_inbox_comment_with_http_info(post_id, , comment_id, opts)
  data
end

#delete_inbox_comment_with_http_info(post_id, account_id, comment_id, opts = {}) ⇒ Array<(DeleteInboxComment200Response, Integer, Hash)>

Delete comment Delete a comment on a post. Supported by Facebook, Instagram, Bluesky, Reddit, YouTube, and LinkedIn. Requires accountId and commentId query parameters.

Parameters:

  • post_id (String)

    Zernio post ID or platform-specific post ID. LinkedIn third-party posts accept full activity URN or numeric ID.

  • account_id (String)
  • comment_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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
# File 'lib/zernio-sdk/api/comments_api.rb', line 41

def delete_inbox_comment_with_http_info(post_id, , comment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.delete_inbox_comment ...'
  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 CommentsApi.delete_inbox_comment"
  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 CommentsApi.delete_inbox_comment"
  end
  # verify the required parameter 'comment_id' is set
  if @api_client.config.client_side_validation && comment_id.nil?
    fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentsApi.delete_inbox_comment"
  end
  # resource path
  local_var_path = '/v1/inbox/comments/{postId}'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'commentId'] = comment_id

  # 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] || 'DeleteInboxComment200Response'

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

  new_options = opts.merge(
    :operation => :"CommentsApi.delete_inbox_comment",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CommentsApi#delete_inbox_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_inbox_comment(post_id, comment_id, edit_inbox_comment_request, opts = {}) ⇒ EditInboxComment200Response

Edit comment Edit the body of a comment the connected account posted. Supported on Reddit only. Reddit keeps the same comment id after an edit. Reddit exposes no API to edit a post title, and a link post has no editable body. To edit a published post's body, use POST /v1/posts/{postId}/edit.

Parameters:

  • post_id (String)
  • comment_id (String)
  • edit_inbox_comment_request (EditInboxCommentRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



106
107
108
109
# File 'lib/zernio-sdk/api/comments_api.rb', line 106

def edit_inbox_comment(post_id, comment_id, edit_inbox_comment_request, opts = {})
  data, _status_code, _headers = edit_inbox_comment_with_http_info(post_id, comment_id, edit_inbox_comment_request, opts)
  data
end

#edit_inbox_comment_with_http_info(post_id, comment_id, edit_inbox_comment_request, opts = {}) ⇒ Array<(EditInboxComment200Response, Integer, Hash)>

Edit comment Edit the body of a comment the connected account posted. Supported on Reddit only. Reddit keeps the same comment id after an edit. Reddit exposes no API to edit a post title, and a link post has no editable body. To edit a published post's body, use `POST /v1/posts/postId/edit`.

Parameters:

  • post_id (String)
  • comment_id (String)
  • edit_inbox_comment_request (EditInboxCommentRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    EditInboxComment200Response data, response status code and response headers



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
# File 'lib/zernio-sdk/api/comments_api.rb', line 118

def edit_inbox_comment_with_http_info(post_id, comment_id, edit_inbox_comment_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.edit_inbox_comment ...'
  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 CommentsApi.edit_inbox_comment"
  end
  # verify the required parameter 'comment_id' is set
  if @api_client.config.client_side_validation && comment_id.nil?
    fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentsApi.edit_inbox_comment"
  end
  # verify the required parameter 'edit_inbox_comment_request' is set
  if @api_client.config.client_side_validation && edit_inbox_comment_request.nil?
    fail ArgumentError, "Missing the required parameter 'edit_inbox_comment_request' when calling CommentsApi.edit_inbox_comment"
  end
  # resource path
  local_var_path = '/v1/inbox/comments/{postId}/{commentId}'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s)).sub('{' + 'commentId' + '}', CGI.escape(comment_id.to_s))

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

  # 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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(edit_inbox_comment_request)

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

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

  new_options = opts.merge(
    :operation => :"CommentsApi.edit_inbox_comment",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CommentsApi#edit_inbox_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_inbox_post_comments(post_id, account_id, opts = {}) ⇒ GetInboxPostComments200Response

Get post comments Fetch comments for a specific post. Requires accountId query parameter.

Parameters:

  • post_id (String)

    Zernio post ID or platform-specific post ID. Zernio IDs are auto-resolved. LinkedIn third-party posts accept full activity URN or numeric ID.

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

    the optional parameters

Options Hash (opts):

  • :subreddit (String) — default: Reddit only

    Subreddit name

  • :limit (Integer)

    Maximum number of comments to return (default to 25)

  • :cursor (String)

    Pagination cursor

  • :comment_id (String) — default: Reddit only

    Get replies to a specific comment

Returns:



189
190
191
192
# File 'lib/zernio-sdk/api/comments_api.rb', line 189

def get_inbox_post_comments(post_id, , opts = {})
  data, _status_code, _headers = get_inbox_post_comments_with_http_info(post_id, , opts)
  data
end

#get_inbox_post_comments_with_http_info(post_id, account_id, opts = {}) ⇒ Array<(GetInboxPostComments200Response, Integer, Hash)>

Get post comments Fetch comments for a specific post. Requires accountId query parameter.

Parameters:

  • post_id (String)

    Zernio post ID or platform-specific post ID. Zernio IDs are auto-resolved. LinkedIn third-party posts accept full activity URN or numeric ID.

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

    the optional parameters

Options Hash (opts):

  • :subreddit (String) — default: Reddit only

    Subreddit name

  • :limit (Integer)

    Maximum number of comments to return (default to 25)

  • :cursor (String)

    Pagination cursor

  • :comment_id (String) — default: Reddit only

    Get replies to a specific comment

Returns:



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
# File 'lib/zernio-sdk/api/comments_api.rb', line 204

def get_inbox_post_comments_with_http_info(post_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.get_inbox_post_comments ...'
  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 CommentsApi.get_inbox_post_comments"
  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 CommentsApi.get_inbox_post_comments"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CommentsApi.get_inbox_post_comments, 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 CommentsApi.get_inbox_post_comments, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/inbox/comments/{postId}'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'subreddit'] = opts[:'subreddit'] if !opts[:'subreddit'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'commentId'] = opts[:'comment_id'] if !opts[:'comment_id'].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] || 'GetInboxPostComments200Response'

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

  new_options = opts.merge(
    :operation => :"CommentsApi.get_inbox_post_comments",
    :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: CommentsApi#get_inbox_post_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#hide_inbox_comment(post_id, comment_id, hide_inbox_comment_request, opts = {}) ⇒ HideInboxComment200Response

Hide comment Hide a comment on a post. Supported by Facebook, Instagram, Threads, and X/Twitter. Hidden comments are only visible to the commenter and page admin. For X/Twitter, the reply must belong to a conversation started by the authenticated user.

Parameters:

  • post_id (String)
  • comment_id (String)
  • hide_inbox_comment_request (HideInboxCommentRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



276
277
278
279
# File 'lib/zernio-sdk/api/comments_api.rb', line 276

def hide_inbox_comment(post_id, comment_id, hide_inbox_comment_request, opts = {})
  data, _status_code, _headers = hide_inbox_comment_with_http_info(post_id, comment_id, hide_inbox_comment_request, opts)
  data
end

#hide_inbox_comment_with_http_info(post_id, comment_id, hide_inbox_comment_request, opts = {}) ⇒ Array<(HideInboxComment200Response, Integer, Hash)>

Hide comment Hide a comment on a post. Supported by Facebook, Instagram, Threads, and X/Twitter. Hidden comments are only visible to the commenter and page admin. For X/Twitter, the reply must belong to a conversation started by the authenticated user.

Parameters:

  • post_id (String)
  • comment_id (String)
  • hide_inbox_comment_request (HideInboxCommentRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    HideInboxComment200Response data, response status code and response headers



288
289
290
291
292
293
294
295
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/zernio-sdk/api/comments_api.rb', line 288

def hide_inbox_comment_with_http_info(post_id, comment_id, hide_inbox_comment_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.hide_inbox_comment ...'
  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 CommentsApi.hide_inbox_comment"
  end
  # verify the required parameter 'comment_id' is set
  if @api_client.config.client_side_validation && comment_id.nil?
    fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentsApi.hide_inbox_comment"
  end
  # verify the required parameter 'hide_inbox_comment_request' is set
  if @api_client.config.client_side_validation && hide_inbox_comment_request.nil?
    fail ArgumentError, "Missing the required parameter 'hide_inbox_comment_request' when calling CommentsApi.hide_inbox_comment"
  end
  # resource path
  local_var_path = '/v1/inbox/comments/{postId}/{commentId}/hide'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s)).sub('{' + 'commentId' + '}', CGI.escape(comment_id.to_s))

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

  # 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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(hide_inbox_comment_request)

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

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

  new_options = opts.merge(
    :operation => :"CommentsApi.hide_inbox_comment",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CommentsApi#hide_inbox_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#like_inbox_comment(post_id, comment_id, like_inbox_comment_request, opts = {}) ⇒ LikeInboxComment200Response

Like comment Like or upvote a comment on a post. Supported platforms: Facebook, Twitter/X, Bluesky, Reddit, LinkedIn. For Bluesky, the cid (content identifier) is required in the request body. For LinkedIn, pass the composite comment URN returned by the comments endpoints as commentId; an optional reactionType picks the reaction (defaults to LIKE), and accounts connected before the social-feed scopes were requested get a 403 with code linkedin_reconnect_required.

Parameters:

  • post_id (String)
  • comment_id (String)
  • like_inbox_comment_request (LikeInboxCommentRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



356
357
358
359
# File 'lib/zernio-sdk/api/comments_api.rb', line 356

def like_inbox_comment(post_id, comment_id, like_inbox_comment_request, opts = {})
  data, _status_code, _headers = like_inbox_comment_with_http_info(post_id, comment_id, like_inbox_comment_request, opts)
  data
end

#like_inbox_comment_with_http_info(post_id, comment_id, like_inbox_comment_request, opts = {}) ⇒ Array<(LikeInboxComment200Response, Integer, Hash)>

Like comment Like or upvote a comment on a post. Supported platforms: Facebook, Twitter/X, Bluesky, Reddit, LinkedIn. For Bluesky, the cid (content identifier) is required in the request body. For LinkedIn, pass the composite comment URN returned by the comments endpoints as commentId; an optional reactionType picks the reaction (defaults to LIKE), and accounts connected before the social-feed scopes were requested get a 403 with code `linkedin_reconnect_required`.

Parameters:

  • post_id (String)
  • comment_id (String)
  • like_inbox_comment_request (LikeInboxCommentRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    LikeInboxComment200Response data, response status code and response headers



368
369
370
371
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
424
425
426
427
# File 'lib/zernio-sdk/api/comments_api.rb', line 368

def like_inbox_comment_with_http_info(post_id, comment_id, like_inbox_comment_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.like_inbox_comment ...'
  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 CommentsApi.like_inbox_comment"
  end
  # verify the required parameter 'comment_id' is set
  if @api_client.config.client_side_validation && comment_id.nil?
    fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentsApi.like_inbox_comment"
  end
  # verify the required parameter 'like_inbox_comment_request' is set
  if @api_client.config.client_side_validation && like_inbox_comment_request.nil?
    fail ArgumentError, "Missing the required parameter 'like_inbox_comment_request' when calling CommentsApi.like_inbox_comment"
  end
  # resource path
  local_var_path = '/v1/inbox/comments/{postId}/{commentId}/like'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s)).sub('{' + 'commentId' + '}', CGI.escape(comment_id.to_s))

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

  # 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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(like_inbox_comment_request)

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

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

  new_options = opts.merge(
    :operation => :"CommentsApi.like_inbox_comment",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CommentsApi#like_inbox_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#like_post(post_id, like_post_request, opts = {}) ⇒ LikePost200Response

Like post Like (or react to) a post as a connected account. Supported platforms: LinkedIn, Twitter/X, Facebook, YouTube, Bluesky. Instagram, Threads, TikTok and Pinterest expose no like endpoint in their APIs and return 400. Reddit returns 400 too, pointing at POST /v1/accounts/{accountId}/reddit-vote, which covers upvote, downvote and clear on both posts and comments. The account does not have to be the one that published the post, which is what makes executive engagement possible: pass an exec's accountId and the brand post's ID. postId accepts either a Zernio post ID or the platform's native post ID. A Zernio post ID resolves to the entry for accountId, falling back to the post's single entry on the same platform (two entries on that platform is a 400, so pass the native ID). LinkedIn requires the w_member_social_feed / w_organization_social_feed scopes, which are not retroactive: accounts connected before those were requested get a 403 with code linkedin_reconnect_required until the user reconnects the account. YouTube spends 50 quota units per call.

Parameters:

  • post_id (String)

    Zernio post ID or the platform's native post ID

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

    the optional parameters

Returns:



435
436
437
438
# File 'lib/zernio-sdk/api/comments_api.rb', line 435

def like_post(post_id, like_post_request, opts = {})
  data, _status_code, _headers = like_post_with_http_info(post_id, like_post_request, opts)
  data
end

#like_post_with_http_info(post_id, like_post_request, opts = {}) ⇒ Array<(LikePost200Response, Integer, Hash)>

Like post Like (or react to) a post as a connected account. Supported platforms: LinkedIn, Twitter/X, Facebook, YouTube, Bluesky. Instagram, Threads, TikTok and Pinterest expose no like endpoint in their APIs and return 400. Reddit returns 400 too, pointing at `POST /v1/accounts/accountId/reddit-vote`, which covers upvote, downvote and clear on both posts and comments. The account does not have to be the one that published the post, which is what makes executive engagement possible: pass an exec's `accountId` and the brand post's ID. `postId` accepts either a Zernio post ID or the platform's native post ID. A Zernio post ID resolves to the entry for `accountId`, falling back to the post's single entry on the same platform (two entries on that platform is a 400, so pass the native ID). LinkedIn requires the `w_member_social_feed` / `w_organization_social_feed` scopes, which are not retroactive: accounts connected before those were requested get a 403 with code `linkedin_reconnect_required` until the user reconnects the account. YouTube spends 50 quota units per call.

Parameters:

  • post_id (String)

    Zernio post ID or the platform's native post ID

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

    the optional parameters

Returns:

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

    LikePost200Response data, response status code and response headers



446
447
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
# File 'lib/zernio-sdk/api/comments_api.rb', line 446

def like_post_with_http_info(post_id, like_post_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.like_post ...'
  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 CommentsApi.like_post"
  end
  # verify the required parameter 'like_post_request' is set
  if @api_client.config.client_side_validation && like_post_request.nil?
    fail ArgumentError, "Missing the required parameter 'like_post_request' when calling CommentsApi.like_post"
  end
  # resource path
  local_var_path = '/v1/inbox/posts/{postId}/like'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s))

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

  # 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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(like_post_request)

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

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

  new_options = opts.merge(
    :operation => :"CommentsApi.like_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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CommentsApi#like_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_inbox_comments(opts = {}) ⇒ ListInboxComments200Response

List commented posts Returns posts with comment counts from all connected accounts. Aggregates data across multiple accounts. For users with the Ads add-on (Metronome plans always qualify), the user's Meta ads (boosted/dark posts) are included too. There's one row per (ad, placement-with-comments): an ad that runs on both Facebook feed and Instagram feed produces up to two rows (the Page dark post and the IG media have separate comment threads), each flagged isAd: true with adId and placement (id is {adId}:{placement}). Use ?platform=metaads to return only ad rows; passing facebook/instagram returns organic posts only (no ads); omitting platform returns both. Fetch a row's thread from GET /v1/ads/adId/comments?placement=placement. Ad comment counts are read with the Marketing API token (Facebook side) or the connected Instagram account's token (Instagram side); a row whose count can't be read is omitted. Pagination walks each account's platform listing. Following nextCursor reaches past the first page on Facebook and Instagram only, since they are the platforms that support a server-side date window; on the others the listing stops at its first page.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Filter by profile ID

  • :platform (String)

    Filter by platform. `metaads` is a synthetic value meaning the user's ads (boosted/dark posts) only; `facebook`/`instagram` return organic posts only.

  • :min_comments (Integer)

    Minimum comment count

  • :since (Time)

    Posts created after this date

  • :sort_by (String)

    Sort field (default to 'date')

  • :sort_order (String)

    Sort order (default to 'desc')

  • :limit (Integer) — default: default to 50
  • :cursor (String)
  • :account_id (String)

    Filter by specific social account ID

Returns:



516
517
518
519
# File 'lib/zernio-sdk/api/comments_api.rb', line 516

def list_inbox_comments(opts = {})
  data, _status_code, _headers = list_inbox_comments_with_http_info(opts)
  data
end

#list_inbox_comments_with_http_info(opts = {}) ⇒ Array<(ListInboxComments200Response, Integer, Hash)>

List commented posts Returns posts with comment counts from all connected accounts. Aggregates data across multiple accounts. For users with the Ads add-on (Metronome plans always qualify), the user's Meta ads (boosted/dark posts) are included too. There's one row per (ad, placement-with-comments): an ad that runs on both Facebook feed and Instagram feed produces up to two rows (the Page dark post and the IG media have separate comment threads), each flagged `isAd: true` with `adId` and `placement` (`id` is `adId:placement`). Use `?platform=metaads` to return only ad rows; passing `facebook`/`instagram` returns organic posts only (no ads); omitting `platform` returns both. Fetch a row's thread from GET /v1/ads/adId/comments?placement=placement. Ad comment counts are read with the Marketing API token (Facebook side) or the connected Instagram account's token (Instagram side); a row whose count can't be read is omitted. Pagination walks each account's platform listing. Following `nextCursor` reaches past the first page on Facebook and Instagram only, since they are the platforms that support a server-side date window; on the others the listing stops at its first page.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    Filter by profile ID

  • :platform (String)

    Filter by platform. `metaads` is a synthetic value meaning the user's ads (boosted/dark posts) only; `facebook`/`instagram` return organic posts only.

  • :min_comments (Integer)

    Minimum comment count

  • :since (Time)

    Posts created after this date

  • :sort_by (String)

    Sort field (default to 'date')

  • :sort_order (String)

    Sort order (default to 'desc')

  • :limit (Integer) — default: default to 50
  • :cursor (String)
  • :account_id (String)

    Filter by specific social account ID

Returns:



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
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
# File 'lib/zernio-sdk/api/comments_api.rb', line 534

def list_inbox_comments_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.list_inbox_comments ...'
  end
  allowable_values = ["facebook", "instagram", "twitter", "bluesky", "threads", "youtube", "linkedin", "reddit", "metaads"]
  if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform'])
    fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'min_comments'].nil? && opts[:'min_comments'] < 0
    fail ArgumentError, 'invalid value for "opts[:"min_comments"]" when calling CommentsApi.list_inbox_comments, must be greater than or equal to 0.'
  end

  allowable_values = ["date", "comments"]
  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[:'sort_order'] && !allowable_values.include?(opts[:'sort_order'])
    fail ArgumentError, "invalid value for \"sort_order\", 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 CommentsApi.list_inbox_comments, 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 CommentsApi.list_inbox_comments, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/inbox/comments'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
  query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
  query_params[:'minComments'] = opts[:'min_comments'] if !opts[:'min_comments'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
  query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].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] || 'ListInboxComments200Response'

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

  new_options = opts.merge(
    :operation => :"CommentsApi.list_inbox_comments",
    :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: CommentsApi#list_inbox_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reply_to_inbox_post(post_id, reply_to_inbox_post_request, opts = {}) ⇒ ReplyToInboxPost200Response

Reply to comment Post a reply to a post or specific comment. Requires accountId in request body.

Parameters:

  • post_id (String)

    Zernio post ID or platform-specific post ID. LinkedIn third-party posts accept full activity URN or numeric ID.

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

    the optional parameters

Returns:



617
618
619
620
# File 'lib/zernio-sdk/api/comments_api.rb', line 617

def reply_to_inbox_post(post_id, reply_to_inbox_post_request, opts = {})
  data, _status_code, _headers = reply_to_inbox_post_with_http_info(post_id, reply_to_inbox_post_request, opts)
  data
end

#reply_to_inbox_post_with_http_info(post_id, reply_to_inbox_post_request, opts = {}) ⇒ Array<(ReplyToInboxPost200Response, Integer, Hash)>

Reply to comment Post a reply to a post or specific comment. Requires accountId in request body.

Parameters:

  • post_id (String)

    Zernio post ID or platform-specific post ID. LinkedIn third-party posts accept full activity URN or numeric ID.

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

    the optional parameters

Returns:

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

    ReplyToInboxPost200Response data, response status code and response headers



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
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
# File 'lib/zernio-sdk/api/comments_api.rb', line 628

def reply_to_inbox_post_with_http_info(post_id, reply_to_inbox_post_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.reply_to_inbox_post ...'
  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 CommentsApi.reply_to_inbox_post"
  end
  # verify the required parameter 'reply_to_inbox_post_request' is set
  if @api_client.config.client_side_validation && reply_to_inbox_post_request.nil?
    fail ArgumentError, "Missing the required parameter 'reply_to_inbox_post_request' when calling CommentsApi.reply_to_inbox_post"
  end
  # resource path
  local_var_path = '/v1/inbox/comments/{postId}'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s))

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

  # 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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(reply_to_inbox_post_request)

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

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

  new_options = opts.merge(
    :operation => :"CommentsApi.reply_to_inbox_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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CommentsApi#reply_to_inbox_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_private_reply_to_comment(post_id, comment_id, send_private_reply_to_comment_request, opts = {}) ⇒ SendPrivateReplyToComment200Response

Send private reply Send a private message to the author of a comment. Supported on Instagram and Facebook only. One reply per comment, must be sent within 7 days. Optionally attach interactive elements: quickReplies (chips above the keyboard, max 13) or buttons (1-3 inline postback/url buttons rendered in the same bubble via Meta's button_template). Buttons are recommended for cold reach since chips do not render in the Instagram Message Requests folder. quickReplies and buttons are mutually exclusive.

Parameters:

  • post_id (String)

    The media/post ID (Instagram media ID or Facebook post ID)

  • comment_id (String)

    The comment ID to send a private reply to

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

    the optional parameters

Returns:



692
693
694
695
# File 'lib/zernio-sdk/api/comments_api.rb', line 692

def send_private_reply_to_comment(post_id, comment_id, send_private_reply_to_comment_request, opts = {})
  data, _status_code, _headers = send_private_reply_to_comment_with_http_info(post_id, comment_id, send_private_reply_to_comment_request, opts)
  data
end

#send_private_reply_to_comment_with_http_info(post_id, comment_id, send_private_reply_to_comment_request, opts = {}) ⇒ Array<(SendPrivateReplyToComment200Response, Integer, Hash)>

Send private reply Send a private message to the author of a comment. Supported on Instagram and Facebook only. One reply per comment, must be sent within 7 days. Optionally attach interactive elements: `quickReplies` (chips above the keyboard, max 13) or `buttons` (1-3 inline postback/url buttons rendered in the same bubble via Meta's button_template). Buttons are recommended for cold reach since chips do not render in the Instagram Message Requests folder. `quickReplies` and `buttons` are mutually exclusive.

Parameters:

  • post_id (String)

    The media/post ID (Instagram media ID or Facebook post ID)

  • comment_id (String)

    The comment ID to send a private reply to

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

    the optional parameters

Returns:



704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
# File 'lib/zernio-sdk/api/comments_api.rb', line 704

def send_private_reply_to_comment_with_http_info(post_id, comment_id, send_private_reply_to_comment_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.send_private_reply_to_comment ...'
  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 CommentsApi.send_private_reply_to_comment"
  end
  # verify the required parameter 'comment_id' is set
  if @api_client.config.client_side_validation && comment_id.nil?
    fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentsApi.send_private_reply_to_comment"
  end
  # verify the required parameter 'send_private_reply_to_comment_request' is set
  if @api_client.config.client_side_validation && send_private_reply_to_comment_request.nil?
    fail ArgumentError, "Missing the required parameter 'send_private_reply_to_comment_request' when calling CommentsApi.send_private_reply_to_comment"
  end
  # resource path
  local_var_path = '/v1/inbox/comments/{postId}/{commentId}/private-reply'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s)).sub('{' + 'commentId' + '}', CGI.escape(comment_id.to_s))

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

  # 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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(send_private_reply_to_comment_request)

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

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

  new_options = opts.merge(
    :operation => :"CommentsApi.send_private_reply_to_comment",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CommentsApi#send_private_reply_to_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_comment_moderation(post_id, comment_id, set_comment_moderation_request, opts = {}) ⇒ UpdateYoutubeDefaultPlaylist200Response

Set comment moderation status Set a comment's moderation status. Supported on YouTube only. Use this to work a moderation queue: approve a held comment (published), reject it (rejected), or send it back for review (heldForReview). The request must be authorized by the owner of the channel or video the comment belongs to. You cannot moderate comments on videos you do not own. This is distinct from POST /v1/inbox/comments/{postId}/{commentId}/hide, which covers Facebook, Instagram, Threads, and X/Twitter and does not apply to YouTube.

Parameters:

  • post_id (String)
  • comment_id (String)
  • set_comment_moderation_request (SetCommentModerationRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



772
773
774
775
# File 'lib/zernio-sdk/api/comments_api.rb', line 772

def set_comment_moderation(post_id, comment_id, set_comment_moderation_request, opts = {})
  data, _status_code, _headers = set_comment_moderation_with_http_info(post_id, comment_id, set_comment_moderation_request, opts)
  data
end

#set_comment_moderation_with_http_info(post_id, comment_id, set_comment_moderation_request, opts = {}) ⇒ Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>

Set comment moderation status Set a comment's moderation status. Supported on YouTube only. Use this to work a moderation queue: approve a held comment (`published`), reject it (`rejected`), or send it back for review (`heldForReview`). The request must be authorized by the owner of the channel or video the comment belongs to. You cannot moderate comments on videos you do not own. This is distinct from `POST /v1/inbox/comments/postId/commentId/hide`, which covers Facebook, Instagram, Threads, and X/Twitter and does not apply to YouTube.

Parameters:

  • post_id (String)
  • comment_id (String)
  • set_comment_moderation_request (SetCommentModerationRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
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
# File 'lib/zernio-sdk/api/comments_api.rb', line 784

def set_comment_moderation_with_http_info(post_id, comment_id, set_comment_moderation_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.set_comment_moderation ...'
  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 CommentsApi.set_comment_moderation"
  end
  # verify the required parameter 'comment_id' is set
  if @api_client.config.client_side_validation && comment_id.nil?
    fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentsApi.set_comment_moderation"
  end
  # verify the required parameter 'set_comment_moderation_request' is set
  if @api_client.config.client_side_validation && set_comment_moderation_request.nil?
    fail ArgumentError, "Missing the required parameter 'set_comment_moderation_request' when calling CommentsApi.set_comment_moderation"
  end
  # resource path
  local_var_path = '/v1/inbox/comments/{postId}/{commentId}/moderation'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s)).sub('{' + 'commentId' + '}', CGI.escape(comment_id.to_s))

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

  # 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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(set_comment_moderation_request)

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

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

  new_options = opts.merge(
    :operation => :"CommentsApi.set_comment_moderation",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CommentsApi#set_comment_moderation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unhide_inbox_comment(post_id, comment_id, account_id, opts = {}) ⇒ HideInboxComment200Response

Unhide comment Unhide a previously hidden comment. Supported by Facebook, Instagram, Threads, and X/Twitter.

Parameters:

  • post_id (String)
  • comment_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



852
853
854
855
# File 'lib/zernio-sdk/api/comments_api.rb', line 852

def unhide_inbox_comment(post_id, comment_id, , opts = {})
  data, _status_code, _headers = unhide_inbox_comment_with_http_info(post_id, comment_id, , opts)
  data
end

#unhide_inbox_comment_with_http_info(post_id, comment_id, account_id, opts = {}) ⇒ Array<(HideInboxComment200Response, Integer, Hash)>

Unhide comment Unhide a previously hidden comment. Supported by Facebook, Instagram, Threads, and X/Twitter.

Parameters:

  • post_id (String)
  • comment_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    HideInboxComment200Response data, response status code and response headers



864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
# File 'lib/zernio-sdk/api/comments_api.rb', line 864

def unhide_inbox_comment_with_http_info(post_id, comment_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.unhide_inbox_comment ...'
  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 CommentsApi.unhide_inbox_comment"
  end
  # verify the required parameter 'comment_id' is set
  if @api_client.config.client_side_validation && comment_id.nil?
    fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentsApi.unhide_inbox_comment"
  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 CommentsApi.unhide_inbox_comment"
  end
  # resource path
  local_var_path = '/v1/inbox/comments/{postId}/{commentId}/hide'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s)).sub('{' + 'commentId' + '}', CGI.escape(comment_id.to_s))

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

  # 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] || 'HideInboxComment200Response'

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

  new_options = opts.merge(
    :operation => :"CommentsApi.unhide_inbox_comment",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CommentsApi#unhide_inbox_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unlike_inbox_comment(post_id, comment_id, account_id, opts = {}) ⇒ UnlikeInboxComment200Response

Unlike comment Remove a like from a comment. Supported platforms: Facebook, Twitter/X, Bluesky, Reddit, LinkedIn. For Bluesky, the likeUri query parameter is required.

Parameters:

  • post_id (String)
  • comment_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :like_uri (String) — default: Bluesky only

    The like URI returned when liking

Returns:



929
930
931
932
# File 'lib/zernio-sdk/api/comments_api.rb', line 929

def unlike_inbox_comment(post_id, comment_id, , opts = {})
  data, _status_code, _headers = unlike_inbox_comment_with_http_info(post_id, comment_id, , opts)
  data
end

#unlike_inbox_comment_with_http_info(post_id, comment_id, account_id, opts = {}) ⇒ Array<(UnlikeInboxComment200Response, Integer, Hash)>

Unlike comment Remove a like from a comment. Supported platforms: Facebook, Twitter/X, Bluesky, Reddit, LinkedIn. For Bluesky, the likeUri query parameter is required.

Parameters:

  • post_id (String)
  • comment_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :like_uri (String) — default: Bluesky only

    The like URI returned when liking

Returns:



942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
# File 'lib/zernio-sdk/api/comments_api.rb', line 942

def unlike_inbox_comment_with_http_info(post_id, comment_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.unlike_inbox_comment ...'
  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 CommentsApi.unlike_inbox_comment"
  end
  # verify the required parameter 'comment_id' is set
  if @api_client.config.client_side_validation && comment_id.nil?
    fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentsApi.unlike_inbox_comment"
  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 CommentsApi.unlike_inbox_comment"
  end
  # resource path
  local_var_path = '/v1/inbox/comments/{postId}/{commentId}/like'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s)).sub('{' + 'commentId' + '}', CGI.escape(comment_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'likeUri'] = opts[:'like_uri'] if !opts[:'like_uri'].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] || 'UnlikeInboxComment200Response'

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

  new_options = opts.merge(
    :operation => :"CommentsApi.unlike_inbox_comment",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CommentsApi#unlike_inbox_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unlike_post(post_id, account_id, opts = {}) ⇒ UnlikePost200Response

Unlike post Remove this account's like from a post. Supported platforms: LinkedIn, Twitter/X, Facebook, YouTube, Bluesky. On YouTube this clears the rating. For Bluesky, likeUri (returned when the post was liked) is required. Reddit uses POST /v1/accounts/{accountId}/reddit-vote with direction: 0.

Parameters:

  • post_id (String)

    Zernio post ID or the platform's native post ID

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

    the optional parameters

Options Hash (opts):

  • :like_uri (String) — default: Bluesky only

    The like URI returned when liking

Returns:



1007
1008
1009
1010
# File 'lib/zernio-sdk/api/comments_api.rb', line 1007

def unlike_post(post_id, , opts = {})
  data, _status_code, _headers = unlike_post_with_http_info(post_id, , opts)
  data
end

#unlike_post_with_http_info(post_id, account_id, opts = {}) ⇒ Array<(UnlikePost200Response, Integer, Hash)>

Unlike post Remove this account's like from a post. Supported platforms: LinkedIn, Twitter/X, Facebook, YouTube, Bluesky. On YouTube this clears the rating. For Bluesky, `likeUri` (returned when the post was liked) is required. Reddit uses `POST /v1/accounts/accountId/reddit-vote` with `direction: 0`.

Parameters:

  • post_id (String)

    Zernio post ID or the platform's native post ID

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

    the optional parameters

Options Hash (opts):

  • :like_uri (String) — default: Bluesky only

    The like URI returned when liking

Returns:

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

    UnlikePost200Response data, response status code and response headers



1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
# File 'lib/zernio-sdk/api/comments_api.rb', line 1019

def unlike_post_with_http_info(post_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CommentsApi.unlike_post ...'
  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 CommentsApi.unlike_post"
  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 CommentsApi.unlike_post"
  end
  # resource path
  local_var_path = '/v1/inbox/posts/{postId}/like'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'likeUri'] = opts[:'like_uri'] if !opts[:'like_uri'].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] || 'UnlikePost200Response'

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

  new_options = opts.merge(
    :operation => :"CommentsApi.unlike_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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CommentsApi#unlike_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end