Class: Zernio::WhatsAppApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WhatsAppApi

Returns a new instance of WhatsAppApi.



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

def api_client
  @api_client
end

Instance Method Details

#add_whats_app_group_participants(group_id, account_id, add_whats_app_group_participants_request, opts = {}) ⇒ UnpublishPost200Response

Add participants Add participants to a WhatsApp group. Maximum 8 participants per request. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



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

def add_whats_app_group_participants(group_id, , add_whats_app_group_participants_request, opts = {})
  data, _status_code, _headers = add_whats_app_group_participants_with_http_info(group_id, , add_whats_app_group_participants_request, opts)
  data
end

#add_whats_app_group_participants_with_http_info(group_id, account_id, add_whats_app_group_participants_request, opts = {}) ⇒ Array<(UnpublishPost200Response, Integer, Hash)>

Add participants Add participants to a WhatsApp group. Maximum 8 participants per request. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:

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

    UnpublishPost200Response data, response status code and response headers



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 41

def add_whats_app_group_participants_with_http_info(group_id, , add_whats_app_group_participants_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.add_whats_app_group_participants ...'
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling WhatsAppApi.add_whats_app_group_participants"
  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 WhatsAppApi.add_whats_app_group_participants"
  end
  # verify the required parameter 'add_whats_app_group_participants_request' is set
  if @api_client.config.client_side_validation && add_whats_app_group_participants_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_whats_app_group_participants_request' when calling WhatsAppApi.add_whats_app_group_participants"
  end
  # resource path
  local_var_path = '/v1/whatsapp/wa-groups/{groupId}/participants'.sub('{' + 'groupId' + '}', CGI.escape(group_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']
  # 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(add_whats_app_group_participants_request)

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

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

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

#approve_whats_app_group_join_requests(group_id, account_id, approve_whats_app_group_join_requests_request, opts = {}) ⇒ UnpublishPost200Response

Approve join requests Approve pending join requests for a WhatsApp group. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



110
111
112
113
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 110

def approve_whats_app_group_join_requests(group_id, , approve_whats_app_group_join_requests_request, opts = {})
  data, _status_code, _headers = approve_whats_app_group_join_requests_with_http_info(group_id, , approve_whats_app_group_join_requests_request, opts)
  data
end

#approve_whats_app_group_join_requests_with_http_info(group_id, account_id, approve_whats_app_group_join_requests_request, opts = {}) ⇒ Array<(UnpublishPost200Response, Integer, Hash)>

Approve join requests Approve pending join requests for a WhatsApp group. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:

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

    UnpublishPost200Response data, response status code and response headers



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 122

def approve_whats_app_group_join_requests_with_http_info(group_id, , approve_whats_app_group_join_requests_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.approve_whats_app_group_join_requests ...'
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling WhatsAppApi.approve_whats_app_group_join_requests"
  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 WhatsAppApi.approve_whats_app_group_join_requests"
  end
  # verify the required parameter 'approve_whats_app_group_join_requests_request' is set
  if @api_client.config.client_side_validation && approve_whats_app_group_join_requests_request.nil?
    fail ArgumentError, "Missing the required parameter 'approve_whats_app_group_join_requests_request' when calling WhatsAppApi.approve_whats_app_group_join_requests"
  end
  # resource path
  local_var_path = '/v1/whatsapp/wa-groups/{groupId}/join-requests'.sub('{' + 'groupId' + '}', CGI.escape(group_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']
  # 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(approve_whats_app_group_join_requests_request)

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

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

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

#block_whats_app_users(block_whats_app_users_request, opts = {}) ⇒ BlockWhatsAppUsers200Response

Block users Block one or more WhatsApp users on this number. Blocked users cannot message your number or see that you are online, and your sends to them return an error. Meta constraints, surfaced per-user in failed (the request itself still succeeds for the rest of the batch): - Only users who messaged your business within the last 24 hours can be blocked (failures outside the window report "Re-engagement required"). - Up to 1,000 users per request; the blocklist caps at 64,000. - Other WhatsApp Business accounts cannot be blocked.

Parameters:

Returns:



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

def block_whats_app_users(block_whats_app_users_request, opts = {})
  data, _status_code, _headers = block_whats_app_users_with_http_info(block_whats_app_users_request, opts)
  data
end

#block_whats_app_users_with_http_info(block_whats_app_users_request, opts = {}) ⇒ Array<(BlockWhatsAppUsers200Response, Integer, Hash)>

Block users Block one or more WhatsApp users on this number. Blocked users cannot message your number or see that you are online, and your sends to them return an error. Meta constraints, surfaced per-user in `failed` (the request itself still succeeds for the rest of the batch): - Only users who messaged your business within the last 24 hours can be blocked (failures outside the window report &quot;Re-engagement required&quot;). - Up to 1,000 users per request; the blocklist caps at 64,000. - Other WhatsApp Business accounts cannot be blocked.

Parameters:

Returns:



199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 199

def block_whats_app_users_with_http_info(block_whats_app_users_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.block_whats_app_users ...'
  end
  # verify the required parameter 'block_whats_app_users_request' is set
  if @api_client.config.client_side_validation && block_whats_app_users_request.nil?
    fail ArgumentError, "Missing the required parameter 'block_whats_app_users_request' when calling WhatsAppApi.block_whats_app_users"
  end
  # resource path
  local_var_path = '/v1/whatsapp/block-users'

  # 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(block_whats_app_users_request)

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

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

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

#create_whats_app_dataset(delete_whatsapp_business_username_request, opts = {}) ⇒ CreateWhatsAppDataset200Response

Provision CTWA dataset Creates (or fetches, if one already exists) the Meta dataset that Click-to-WhatsApp ad events are reported against via the Conversions API, and persists its ID on the account as metadata.metaCapiDatasetId. The call is GET-first idempotent — a WABA can only own one CTWA dataset, so a second call after a successful provision is a safe no-op that returns the same ID with created: false. Requires the connected WhatsApp account's token to carry the whatsapp_business_manage_events permission. If the permission is missing the endpoint returns 422 with a message asking the user to reconnect the account.

Parameters:

Returns:



257
258
259
260
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 257

def create_whats_app_dataset(delete_whatsapp_business_username_request, opts = {})
  data, _status_code, _headers = create_whats_app_dataset_with_http_info(delete_whatsapp_business_username_request, opts)
  data
end

#create_whats_app_dataset_with_http_info(delete_whatsapp_business_username_request, opts = {}) ⇒ Array<(CreateWhatsAppDataset200Response, Integer, Hash)>

Provision CTWA dataset Creates (or fetches, if one already exists) the Meta dataset that Click-to-WhatsApp ad events are reported against via the Conversions API, and persists its ID on the account as `metadata.metaCapiDatasetId`. The call is GET-first idempotent — a WABA can only own one CTWA dataset, so a second call after a successful provision is a safe no-op that returns the same ID with `created: false`. Requires the connected WhatsApp account's token to carry the `whatsapp_business_manage_events` permission. If the permission is missing the endpoint returns 422 with a message asking the user to reconnect the account.

Parameters:

Returns:



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
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
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 267

def create_whats_app_dataset_with_http_info(delete_whatsapp_business_username_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.create_whats_app_dataset ...'
  end
  # verify the required parameter 'delete_whatsapp_business_username_request' is set
  if @api_client.config.client_side_validation && delete_whatsapp_business_username_request.nil?
    fail ArgumentError, "Missing the required parameter 'delete_whatsapp_business_username_request' when calling WhatsAppApi.create_whats_app_dataset"
  end
  # resource path
  local_var_path = '/v1/whatsapp/dataset'

  # 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(delete_whatsapp_business_username_request)

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

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

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

#create_whats_app_group_chat(create_whats_app_group_chat_request, opts = {}) ⇒ CreateWhatsAppGroupChat201Response

Create group Create a new WhatsApp group chat. Returns the group ID and optionally an invite link. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

Returns:



325
326
327
328
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 325

def create_whats_app_group_chat(create_whats_app_group_chat_request, opts = {})
  data, _status_code, _headers = create_whats_app_group_chat_with_http_info(create_whats_app_group_chat_request, opts)
  data
end

#create_whats_app_group_chat_with_http_info(create_whats_app_group_chat_request, opts = {}) ⇒ Array<(CreateWhatsAppGroupChat201Response, Integer, Hash)>

Create group Create a new WhatsApp group chat. Returns the group ID and optionally an invite link. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

Returns:



335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 335

def create_whats_app_group_chat_with_http_info(create_whats_app_group_chat_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.create_whats_app_group_chat ...'
  end
  # verify the required parameter 'create_whats_app_group_chat_request' is set
  if @api_client.config.client_side_validation && create_whats_app_group_chat_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_whats_app_group_chat_request' when calling WhatsAppApi.create_whats_app_group_chat"
  end
  # resource path
  local_var_path = '/v1/whatsapp/wa-groups'

  # 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(create_whats_app_group_chat_request)

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

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

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

Create invite link Create a new invite link for a WhatsApp group. The previous link is revoked. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



394
395
396
397
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 394

def create_whats_app_group_invite_link(group_id, , opts = {})
  data, _status_code, _headers = create_whats_app_group_invite_link_with_http_info(group_id, , opts)
  data
end

Create invite link Create a new invite link for a WhatsApp group. The previous link is revoked. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 405

def create_whats_app_group_invite_link_with_http_info(group_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.create_whats_app_group_invite_link ...'
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling WhatsAppApi.create_whats_app_group_invite_link"
  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 WhatsAppApi.create_whats_app_group_invite_link"
  end
  # resource path
  local_var_path = '/v1/whatsapp/wa-groups/{groupId}/invite-link'.sub('{' + 'groupId' + '}', CGI.escape(group_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] || 'CreateWhatsAppGroupInviteLink200Response'

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

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

#create_whats_app_template(create_whats_app_template_request, opts = {}) ⇒ CreateWhatsAppTemplate200Response

Create template Create a new message template. Supports two modes: Custom template: Provide components with your own content. Submitted to Meta for review (can take up to 24h). Library template: Provide library_template_name instead of components to use a pre-built template from Meta's template library. Library templates are pre-approved (no review wait). You can optionally customize parameters and buttons via library_template_body_inputs and library_template_button_inputs. Browse available library templates at: https://business.facebook.com/wa/manage/message-templates/

Parameters:

Returns:



463
464
465
466
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 463

def create_whats_app_template(create_whats_app_template_request, opts = {})
  data, _status_code, _headers = create_whats_app_template_with_http_info(create_whats_app_template_request, opts)
  data
end

#create_whats_app_template_with_http_info(create_whats_app_template_request, opts = {}) ⇒ Array<(CreateWhatsAppTemplate200Response, Integer, Hash)>

Create template Create a new message template. Supports two modes: Custom template: Provide components with your own content. Submitted to Meta for review (can take up to 24h). Library template: Provide library_template_name instead of components to use a pre-built template from Meta's template library. Library templates are pre-approved (no review wait). You can optionally customize parameters and buttons via library_template_body_inputs and library_template_button_inputs. Browse available library templates at: https://business.facebook.com/wa/manage/message-templates/

Parameters:

Returns:



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
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 473

def create_whats_app_template_with_http_info(create_whats_app_template_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.create_whats_app_template ...'
  end
  # verify the required parameter 'create_whats_app_template_request' is set
  if @api_client.config.client_side_validation && create_whats_app_template_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_whats_app_template_request' when calling WhatsAppApi.create_whats_app_template"
  end
  # resource path
  local_var_path = '/v1/whatsapp/templates'

  # 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(create_whats_app_template_request)

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

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

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

#delete_whats_app_group_chat(group_id, account_id, opts = {}) ⇒ UnpublishPost200Response

Delete group Delete a WhatsApp group and remove all participants. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



532
533
534
535
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 532

def delete_whats_app_group_chat(group_id, , opts = {})
  data, _status_code, _headers = delete_whats_app_group_chat_with_http_info(group_id, , opts)
  data
end

#delete_whats_app_group_chat_with_http_info(group_id, account_id, opts = {}) ⇒ Array<(UnpublishPost200Response, Integer, Hash)>

Delete group Delete a WhatsApp group and remove all participants. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:

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

    UnpublishPost200Response data, response status code and response headers



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

def delete_whats_app_group_chat_with_http_info(group_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.delete_whats_app_group_chat ...'
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling WhatsAppApi.delete_whats_app_group_chat"
  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 WhatsAppApi.delete_whats_app_group_chat"
  end
  # resource path
  local_var_path = '/v1/whatsapp/wa-groups/{groupId}'.sub('{' + 'groupId' + '}', CGI.escape(group_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] || 'UnpublishPost200Response'

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

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

#delete_whats_app_template(template_name, account_id, opts = {}) ⇒ UnpublishPost200Response

Delete template Permanently delete a message template by name.

Parameters:

  • template_name (String)

    Template name

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



602
603
604
605
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 602

def delete_whats_app_template(template_name, , opts = {})
  data, _status_code, _headers = delete_whats_app_template_with_http_info(template_name, , opts)
  data
end

#delete_whats_app_template_with_http_info(template_name, account_id, opts = {}) ⇒ Array<(UnpublishPost200Response, Integer, Hash)>

Delete template Permanently delete a message template by name.

Parameters:

  • template_name (String)

    Template name

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:

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

    UnpublishPost200Response data, response status code and response headers



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
657
658
659
660
661
662
663
664
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 613

def delete_whats_app_template_with_http_info(template_name, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.delete_whats_app_template ...'
  end
  # verify the required parameter 'template_name' is set
  if @api_client.config.client_side_validation && template_name.nil?
    fail ArgumentError, "Missing the required parameter 'template_name' when calling WhatsAppApi.delete_whats_app_template"
  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 WhatsAppApi.delete_whats_app_template"
  end
  # resource path
  local_var_path = '/v1/whatsapp/templates/{templateName}'.sub('{' + 'templateName' + '}', CGI.escape(template_name.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] || 'UnpublishPost200Response'

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

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

#delete_whatsapp_business_username(delete_whatsapp_business_username_request, opts = {}) ⇒ UpdateYoutubeDefaultPlaylist200Response

Delete business username Release the currently claimed WhatsApp Business username from the account. After deletion the username becomes available for other accounts to claim.

Parameters:

Returns:



671
672
673
674
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 671

def delete_whatsapp_business_username(delete_whatsapp_business_username_request, opts = {})
  data, _status_code, _headers = delete_whatsapp_business_username_with_http_info(delete_whatsapp_business_username_request, opts)
  data
end

#delete_whatsapp_business_username_with_http_info(delete_whatsapp_business_username_request, opts = {}) ⇒ Array<(UpdateYoutubeDefaultPlaylist200Response, Integer, Hash)>

Delete business username Release the currently claimed WhatsApp Business username from the account. After deletion the username becomes available for other accounts to claim.

Parameters:

Returns:



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
727
728
729
730
731
732
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 681

def delete_whatsapp_business_username_with_http_info(delete_whatsapp_business_username_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.delete_whatsapp_business_username ...'
  end
  # verify the required parameter 'delete_whatsapp_business_username_request' is set
  if @api_client.config.client_side_validation && delete_whatsapp_business_username_request.nil?
    fail ArgumentError, "Missing the required parameter 'delete_whatsapp_business_username_request' when calling WhatsAppApi.delete_whatsapp_business_username"
  end
  # resource path
  local_var_path = '/v1/whatsapp/business-profile/username'

  # 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(delete_whatsapp_business_username_request)

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

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

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

#get_whats_app_block_status(account_id, user, opts = {}) ⇒ GetWhatsAppBlockStatus200Response

Check if a user is blocked Definitive blocked-state lookup for a single contact. Meta exposes no membership endpoint, so this reads Zernio's blocklist mirror (kept in sync by the block/unblock endpoints; the first call per account backfills the mirror from Meta's full list). Constant-time regardless of blocklist size.

Parameters:

  • account_id (String)
  • user (String)

    Consumer wa_id or E.164 phone (leading + optional)

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

    the optional parameters

Returns:



740
741
742
743
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 740

def get_whats_app_block_status(, user, opts = {})
  data, _status_code, _headers = get_whats_app_block_status_with_http_info(, user, opts)
  data
end

#get_whats_app_block_status_with_http_info(account_id, user, opts = {}) ⇒ Array<(GetWhatsAppBlockStatus200Response, Integer, Hash)>

Check if a user is blocked Definitive blocked-state lookup for a single contact. Meta exposes no membership endpoint, so this reads Zernio's blocklist mirror (kept in sync by the block/unblock endpoints; the first call per account backfills the mirror from Meta's full list). Constant-time regardless of blocklist size.

Parameters:

  • account_id (String)
  • user (String)

    Consumer wa_id or E.164 phone (leading + optional)

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

    the optional parameters

Returns:



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
797
798
799
800
801
802
803
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 751

def get_whats_app_block_status_with_http_info(, user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_block_status ...'
  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 WhatsAppApi.get_whats_app_block_status"
  end
  # verify the required parameter 'user' is set
  if @api_client.config.client_side_validation && user.nil?
    fail ArgumentError, "Missing the required parameter 'user' when calling WhatsAppApi.get_whats_app_block_status"
  end
  # resource path
  local_var_path = '/v1/whatsapp/block-users/status'

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

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

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

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

#get_whats_app_blocked_users(account_id, opts = {}) ⇒ GetWhatsAppBlockedUsers200Response

List blocked users List the WhatsApp users blocked on this number. Cursor-paginated; pass nextCursor back as after to fetch the next page. The blocklist holds up to 64,000 users.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Page size.

  • :after (String)

    Cursor from a previous response's `nextCursor`.

Returns:



812
813
814
815
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 812

def get_whats_app_blocked_users(, opts = {})
  data, _status_code, _headers = get_whats_app_blocked_users_with_http_info(, opts)
  data
end

#get_whats_app_blocked_users_with_http_info(account_id, opts = {}) ⇒ Array<(GetWhatsAppBlockedUsers200Response, Integer, Hash)>

List blocked users List the WhatsApp users blocked on this number. Cursor-paginated; pass `nextCursor` back as `after` to fetch the next page. The blocklist holds up to 64,000 users.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Page size.

  • :after (String)

    Cursor from a previous response's `nextCursor`.

Returns:



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
874
875
876
877
878
879
880
881
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 824

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

  # resource path
  local_var_path = '/v1/whatsapp/block-users'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].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] || 'GetWhatsAppBlockedUsers200Response'

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

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

#get_whats_app_business_profile(account_id, opts = {}) ⇒ GetWhatsAppBusinessProfile200Response

Get business profile Retrieve the WhatsApp Business profile for the account (about, address, description, email, websites, etc.).

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



888
889
890
891
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 888

def get_whats_app_business_profile(, opts = {})
  data, _status_code, _headers = get_whats_app_business_profile_with_http_info(, opts)
  data
end

#get_whats_app_business_profile_with_http_info(account_id, opts = {}) ⇒ Array<(GetWhatsAppBusinessProfile200Response, Integer, Hash)>

Get business profile Retrieve the WhatsApp Business profile for the account (about, address, description, email, websites, etc.).

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 898

def get_whats_app_business_profile_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_business_profile ...'
  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 WhatsAppApi.get_whats_app_business_profile"
  end
  # resource path
  local_var_path = '/v1/whatsapp/business-profile'

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

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

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

#get_whats_app_dataset(account_id, opts = {}) ⇒ GetWhatsAppDataset200Response

Get CTWA conversions dataset Returns the Meta Click-to-WhatsApp conversions dataset currently linked to the WhatsApp account, if one has been provisioned. Reads only from the stored metadata.metaCapiDatasetId — never hits Meta, never creates a dataset. Use this to detect whether POST /v1/whatsapp/conversions is configured for an account.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



952
953
954
955
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 952

def get_whats_app_dataset(, opts = {})
  data, _status_code, _headers = get_whats_app_dataset_with_http_info(, opts)
  data
end

#get_whats_app_dataset_with_http_info(account_id, opts = {}) ⇒ Array<(GetWhatsAppDataset200Response, Integer, Hash)>

Get CTWA conversions dataset Returns the Meta Click-to-WhatsApp conversions dataset currently linked to the WhatsApp account, if one has been provisioned. Reads only from the stored `metadata.metaCapiDatasetId` — never hits Meta, never creates a dataset. Use this to detect whether `POST /v1/whatsapp/conversions` is configured for an account.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



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
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 962

def get_whats_app_dataset_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_dataset ...'
  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 WhatsAppApi.get_whats_app_dataset"
  end
  # resource path
  local_var_path = '/v1/whatsapp/dataset'

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

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

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

#get_whats_app_display_name(account_id, opts = {}) ⇒ GetWhatsAppDisplayName200Response

Get display name status Fetch the current display name and its Meta review status for a WhatsApp Business account. Display name changes require Meta approval and can take 1-3 business days.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1016
1017
1018
1019
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1016

def get_whats_app_display_name(, opts = {})
  data, _status_code, _headers = get_whats_app_display_name_with_http_info(, opts)
  data
end

#get_whats_app_display_name_with_http_info(account_id, opts = {}) ⇒ Array<(GetWhatsAppDisplayName200Response, Integer, Hash)>

Get display name status Fetch the current display name and its Meta review status for a WhatsApp Business account. Display name changes require Meta approval and can take 1-3 business days.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



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
1072
1073
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1026

def get_whats_app_display_name_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_display_name ...'
  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 WhatsAppApi.get_whats_app_display_name"
  end
  # resource path
  local_var_path = '/v1/whatsapp/business-profile/display-name'

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

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

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

#get_whats_app_group_chat(group_id, account_id, opts = {}) ⇒ GetWhatsAppGroupChat200Response

Get group info Retrieve metadata about a WhatsApp group including subject, description, participants, and settings. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1081
1082
1083
1084
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1081

def get_whats_app_group_chat(group_id, , opts = {})
  data, _status_code, _headers = get_whats_app_group_chat_with_http_info(group_id, , opts)
  data
end

#get_whats_app_group_chat_with_http_info(group_id, account_id, opts = {}) ⇒ Array<(GetWhatsAppGroupChat200Response, Integer, Hash)>

Get group info Retrieve metadata about a WhatsApp group including subject, description, participants, and settings. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1092

def get_whats_app_group_chat_with_http_info(group_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_group_chat ...'
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling WhatsAppApi.get_whats_app_group_chat"
  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 WhatsAppApi.get_whats_app_group_chat"
  end
  # resource path
  local_var_path = '/v1/whatsapp/wa-groups/{groupId}'.sub('{' + 'groupId' + '}', CGI.escape(group_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] || 'GetWhatsAppGroupChat200Response'

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

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

#get_whats_app_template(template_name, account_id, opts = {}) ⇒ GetWhatsAppTemplate200Response

Get template Retrieve a single message template by name.

Parameters:

  • template_name (String)

    Template name

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1151
1152
1153
1154
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1151

def get_whats_app_template(template_name, , opts = {})
  data, _status_code, _headers = get_whats_app_template_with_http_info(template_name, , opts)
  data
end

#get_whats_app_template_with_http_info(template_name, account_id, opts = {}) ⇒ Array<(GetWhatsAppTemplate200Response, Integer, Hash)>

Get template Retrieve a single message template by name.

Parameters:

  • template_name (String)

    Template name

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1162

def get_whats_app_template_with_http_info(template_name, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_template ...'
  end
  # verify the required parameter 'template_name' is set
  if @api_client.config.client_side_validation && template_name.nil?
    fail ArgumentError, "Missing the required parameter 'template_name' when calling WhatsAppApi.get_whats_app_template"
  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 WhatsAppApi.get_whats_app_template"
  end
  # resource path
  local_var_path = '/v1/whatsapp/templates/{templateName}'.sub('{' + 'templateName' + '}', CGI.escape(template_name.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] || 'GetWhatsAppTemplate200Response'

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

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

#get_whats_app_templates(account_id, opts = {}) ⇒ GetWhatsAppTemplates200Response

List templates List all message templates for the WhatsApp Business Account (WABA) associated with the given account. Templates are fetched directly from the WhatsApp Cloud API.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1220
1221
1222
1223
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1220

def get_whats_app_templates(, opts = {})
  data, _status_code, _headers = get_whats_app_templates_with_http_info(, opts)
  data
end

#get_whats_app_templates_with_http_info(account_id, opts = {}) ⇒ Array<(GetWhatsAppTemplates200Response, Integer, Hash)>

List templates List all message templates for the WhatsApp Business Account (WABA) associated with the given account. Templates are fetched directly from the WhatsApp Cloud API.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1230

def get_whats_app_templates_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_templates ...'
  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 WhatsAppApi.get_whats_app_templates"
  end
  # resource path
  local_var_path = '/v1/whatsapp/templates'

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

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

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

#get_whatsapp_business_username(account_id, opts = {}) ⇒ GetWhatsappBusinessUsername200Response

Get business username Fetch the current WhatsApp Business username and its approval status. Username status can be approved (active), reserved (pending activation), or none (no username set).

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1284
1285
1286
1287
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1284

def get_whatsapp_business_username(, opts = {})
  data, _status_code, _headers = get_whatsapp_business_username_with_http_info(, opts)
  data
end

#get_whatsapp_business_username_suggestions(account_id, opts = {}) ⇒ GetWhatsappBusinessUsernameSuggestions200Response

Get username suggestions Retrieve a list of available WhatsApp Business username suggestions based on the account's business profile name. Use these to help users discover valid, unclaimed usernames.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1348
1349
1350
1351
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1348

def get_whatsapp_business_username_suggestions(, opts = {})
  data, _status_code, _headers = get_whatsapp_business_username_suggestions_with_http_info(, opts)
  data
end

#get_whatsapp_business_username_suggestions_with_http_info(account_id, opts = {}) ⇒ Array<(GetWhatsappBusinessUsernameSuggestions200Response, Integer, Hash)>

Get username suggestions Retrieve a list of available WhatsApp Business username suggestions based on the account's business profile name. Use these to help users discover valid, unclaimed usernames.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1358

def get_whatsapp_business_username_suggestions_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whatsapp_business_username_suggestions ...'
  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 WhatsAppApi.get_whatsapp_business_username_suggestions"
  end
  # resource path
  local_var_path = '/v1/whatsapp/business-profile/username/suggestions'

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

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

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

#get_whatsapp_business_username_with_http_info(account_id, opts = {}) ⇒ Array<(GetWhatsappBusinessUsername200Response, Integer, Hash)>

Get business username Fetch the current WhatsApp Business username and its approval status. Username status can be `approved` (active), `reserved` (pending activation), or `none` (no username set).

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1294

def get_whatsapp_business_username_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whatsapp_business_username ...'
  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 WhatsAppApi.get_whatsapp_business_username"
  end
  # resource path
  local_var_path = '/v1/whatsapp/business-profile/username'

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

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

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

#list_whats_app_conversions(account_id, opts = {}) ⇒ ListWhatsAppConversions200Response

List conversion events Returns the most recent conversion events sent through POST /v1/whatsapp/conversions for the given WhatsApp account. Sourced from delivery logs (Axiom late dataset), so the visible window is bounded by log retention (about 30 days). Useful for rendering a "recent activity" panel on the conversions setup tab without standing up a parallel persistence layer. Per-event payload mirrors the structured log we write on every successful send: eventName, conversationId, eventsReceived, eventsFailed, traceId, durationMs, and the wall-clock timestamp.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Max events to return (1-200, default 50). (default to 50)

Returns:



1413
1414
1415
1416
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1413

def list_whats_app_conversions(, opts = {})
  data, _status_code, _headers = list_whats_app_conversions_with_http_info(, opts)
  data
end

#list_whats_app_conversions_with_http_info(account_id, opts = {}) ⇒ Array<(ListWhatsAppConversions200Response, Integer, Hash)>

List conversion events Returns the most recent conversion events sent through `POST /v1/whatsapp/conversions` for the given WhatsApp account. Sourced from delivery logs (Axiom `late` dataset), so the visible window is bounded by log retention (about 30 days). Useful for rendering a &quot;recent activity&quot; panel on the conversions setup tab without standing up a parallel persistence layer. Per-event payload mirrors the structured log we write on every successful send: `eventName`, `conversationId`, `eventsReceived`, `eventsFailed`, `traceId`, `durationMs`, and the wall-clock `timestamp`.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Max events to return (1-200, default 50). (default to 50)

Returns:



1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1424

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

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

  # resource path
  local_var_path = '/v1/whatsapp/conversions'

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

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

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

#list_whats_app_group_chats(account_id, opts = {}) ⇒ ListWhatsAppGroupChats200Response

List active groups List active WhatsApp group chats for a business phone number. These are actual WhatsApp group conversations on the platform. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Max groups to return (default to 25)

  • :after (String)

    Pagination cursor

Returns:



1489
1490
1491
1492
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1489

def list_whats_app_group_chats(, opts = {})
  data, _status_code, _headers = list_whats_app_group_chats_with_http_info(, opts)
  data
end

#list_whats_app_group_chats_with_http_info(account_id, opts = {}) ⇒ Array<(ListWhatsAppGroupChats200Response, Integer, Hash)>

List active groups List active WhatsApp group chats for a business phone number. These are actual WhatsApp group conversations on the platform. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Max groups to return (default to 25)

  • :after (String)

    Pagination cursor

Returns:



1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1501

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

  # resource path
  local_var_path = '/v1/whatsapp/wa-groups'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].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] || 'ListWhatsAppGroupChats200Response'

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

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

#list_whats_app_group_join_requests(group_id, account_id, opts = {}) ⇒ ListWhatsAppGroupJoinRequests200Response

List join requests List pending join requests for a WhatsApp group (only for groups with approval_required mode). Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1562
1563
1564
1565
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1562

def list_whats_app_group_join_requests(group_id, , opts = {})
  data, _status_code, _headers = list_whats_app_group_join_requests_with_http_info(group_id, , opts)
  data
end

#list_whats_app_group_join_requests_with_http_info(group_id, account_id, opts = {}) ⇒ Array<(ListWhatsAppGroupJoinRequests200Response, Integer, Hash)>

List join requests List pending join requests for a WhatsApp group (only for groups with approval_required mode). Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1573

def list_whats_app_group_join_requests_with_http_info(group_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.list_whats_app_group_join_requests ...'
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling WhatsAppApi.list_whats_app_group_join_requests"
  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 WhatsAppApi.list_whats_app_group_join_requests"
  end
  # resource path
  local_var_path = '/v1/whatsapp/wa-groups/{groupId}/join-requests'.sub('{' + 'groupId' + '}', CGI.escape(group_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] || 'ListWhatsAppGroupJoinRequests200Response'

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

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

#reject_whats_app_group_join_requests(group_id, account_id, reject_whats_app_group_join_requests_request, opts = {}) ⇒ UnpublishPost200Response

Reject join requests Reject pending join requests for a WhatsApp group. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1633
1634
1635
1636
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1633

def reject_whats_app_group_join_requests(group_id, , reject_whats_app_group_join_requests_request, opts = {})
  data, _status_code, _headers = reject_whats_app_group_join_requests_with_http_info(group_id, , reject_whats_app_group_join_requests_request, opts)
  data
end

#reject_whats_app_group_join_requests_with_http_info(group_id, account_id, reject_whats_app_group_join_requests_request, opts = {}) ⇒ Array<(UnpublishPost200Response, Integer, Hash)>

Reject join requests Reject pending join requests for a WhatsApp group. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:

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

    UnpublishPost200Response data, response status code and response headers



1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1645

def reject_whats_app_group_join_requests_with_http_info(group_id, , reject_whats_app_group_join_requests_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.reject_whats_app_group_join_requests ...'
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling WhatsAppApi.reject_whats_app_group_join_requests"
  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 WhatsAppApi.reject_whats_app_group_join_requests"
  end
  # verify the required parameter 'reject_whats_app_group_join_requests_request' is set
  if @api_client.config.client_side_validation && reject_whats_app_group_join_requests_request.nil?
    fail ArgumentError, "Missing the required parameter 'reject_whats_app_group_join_requests_request' when calling WhatsAppApi.reject_whats_app_group_join_requests"
  end
  # resource path
  local_var_path = '/v1/whatsapp/wa-groups/{groupId}/join-requests'.sub('{' + 'groupId' + '}', CGI.escape(group_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']
  # 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(reject_whats_app_group_join_requests_request)

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

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

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

#remove_whats_app_group_participants(group_id, account_id, remove_whats_app_group_participants_request, opts = {}) ⇒ UnpublishPost200Response

Remove participants Remove participants from a WhatsApp group. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1714
1715
1716
1717
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1714

def remove_whats_app_group_participants(group_id, , remove_whats_app_group_participants_request, opts = {})
  data, _status_code, _headers = remove_whats_app_group_participants_with_http_info(group_id, , remove_whats_app_group_participants_request, opts)
  data
end

#remove_whats_app_group_participants_with_http_info(group_id, account_id, remove_whats_app_group_participants_request, opts = {}) ⇒ Array<(UnpublishPost200Response, Integer, Hash)>

Remove participants Remove participants from a WhatsApp group. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:

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

    UnpublishPost200Response data, response status code and response headers



1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1726

def remove_whats_app_group_participants_with_http_info(group_id, , remove_whats_app_group_participants_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.remove_whats_app_group_participants ...'
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling WhatsAppApi.remove_whats_app_group_participants"
  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 WhatsAppApi.remove_whats_app_group_participants"
  end
  # verify the required parameter 'remove_whats_app_group_participants_request' is set
  if @api_client.config.client_side_validation && remove_whats_app_group_participants_request.nil?
    fail ArgumentError, "Missing the required parameter 'remove_whats_app_group_participants_request' when calling WhatsAppApi.remove_whats_app_group_participants"
  end
  # resource path
  local_var_path = '/v1/whatsapp/wa-groups/{groupId}/participants'.sub('{' + 'groupId' + '}', CGI.escape(group_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']
  # 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(remove_whats_app_group_participants_request)

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

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

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

#send_whats_app_conversion(send_whats_app_conversion_request, opts = {}) ⇒ SendWhatsAppConversion200Response

Send WhatsApp conversion event Forward a WhatsApp Business Messaging conversion event (LeadSubmitted, Purchase, AddToCart, InitiateCheckout, ViewContent) to Meta's Conversions API with action_source = business_messaging and messaging_channel = whatsapp. The endpoint looks up the originating CTWA click ID (ctwa_clid) captured on the first inbound message of the conversation and replays it on every event so Meta can attribute the conversion back to the Click-to-WhatsApp ad that drove the chat. Configuration prerequisite on the WhatsApp account metadata: - metaCapiDatasetId: the Meta dataset ID linked to the WABA. Provision one with POST /v1/whatsapp/dataset. The WABA ID (already set automatically at connect time) is forwarded as user_data.whatsapp_business_account_id, which is the per-channel attribution identifier Meta requires for WhatsApp events. No Facebook Page ID is needed (that field is the Messenger-branch identifier). Identify the conversation by either conversationId (preferred) or phoneE164 (digits only, no +). At least one is required. If the conversation has no captured ctwa_clid, the request returns 422 because there is nothing to attribute. Token and dataset coupling: the WhatsApp account's accessToken must have access to the configured metaCapiDatasetId. By default a WABA's system-user token is scoped to the WABA's own Business Manager and cannot post to a pixel owned by a different Business; Meta returns code 100 in that case. Either share the dataset with the WhatsApp app's Business in BM, or use a dataset already in the same Business as the WABA.

Parameters:

Returns:



1793
1794
1795
1796
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1793

def send_whats_app_conversion(send_whats_app_conversion_request, opts = {})
  data, _status_code, _headers = send_whats_app_conversion_with_http_info(send_whats_app_conversion_request, opts)
  data
end

#send_whats_app_conversion_with_http_info(send_whats_app_conversion_request, opts = {}) ⇒ Array<(SendWhatsAppConversion200Response, Integer, Hash)>

Send WhatsApp conversion event Forward a WhatsApp Business Messaging conversion event (`LeadSubmitted`, `Purchase`, `AddToCart`, `InitiateCheckout`, `ViewContent`) to Meta's Conversions API with `action_source = business_messaging` and `messaging_channel = whatsapp`. The endpoint looks up the originating CTWA click ID (`ctwa_clid`) captured on the first inbound message of the conversation and replays it on every event so Meta can attribute the conversion back to the Click-to-WhatsApp ad that drove the chat. Configuration prerequisite on the WhatsApp account metadata: - `metaCapiDatasetId`: the Meta dataset ID linked to the WABA. Provision one with `POST /v1/whatsapp/dataset`. The WABA ID (already set automatically at connect time) is forwarded as `user_data.whatsapp_business_account_id`, which is the per-channel attribution identifier Meta requires for WhatsApp events. No Facebook Page ID is needed (that field is the Messenger-branch identifier). Identify the conversation by either `conversationId` (preferred) or `phoneE164` (digits only, no `+`). At least one is required. If the conversation has no captured `ctwa_clid`, the request returns 422 because there is nothing to attribute. Token and dataset coupling: the WhatsApp account's accessToken must have access to the configured `metaCapiDatasetId`. By default a WABA's system-user token is scoped to the WABA's own Business Manager and cannot post to a pixel owned by a different Business; Meta returns code 100 in that case. Either share the dataset with the WhatsApp app's Business in BM, or use a dataset already in the same Business as the WABA.

Parameters:

Returns:



1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1803

def send_whats_app_conversion_with_http_info(send_whats_app_conversion_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.send_whats_app_conversion ...'
  end
  # verify the required parameter 'send_whats_app_conversion_request' is set
  if @api_client.config.client_side_validation && send_whats_app_conversion_request.nil?
    fail ArgumentError, "Missing the required parameter 'send_whats_app_conversion_request' when calling WhatsAppApi.send_whats_app_conversion"
  end
  # resource path
  local_var_path = '/v1/whatsapp/conversions'

  # 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_whats_app_conversion_request)

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

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

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

#set_whatsapp_business_username(set_whatsapp_business_username_request, opts = {}) ⇒ SetWhatsappBusinessUsername200Response

Set business username Claim or transfer a WhatsApp Business username for the account. Username rules: 3-35 characters, letters/digits/period/underscore only, must contain at least one letter, no leading or trailing periods, no consecutive periods, no www prefix, no domain TLD suffix (e.g. .com). If the desired username is currently held by another account, pass transferAction: \"force_transfer\" to request a transfer. On failure the API returns a standard error envelope with one of these codes: whatsapp_username_unavailable (already taken and transfer not requested), whatsapp_username_ineligible (account not eligible to claim a username), or whatsapp_username_transfer_required (username is held elsewhere; retry with force_transfer).

Parameters:

Returns:



1861
1862
1863
1864
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1861

def set_whatsapp_business_username(set_whatsapp_business_username_request, opts = {})
  data, _status_code, _headers = set_whatsapp_business_username_with_http_info(set_whatsapp_business_username_request, opts)
  data
end

#set_whatsapp_business_username_with_http_info(set_whatsapp_business_username_request, opts = {}) ⇒ Array<(SetWhatsappBusinessUsername200Response, Integer, Hash)>

Set business username Claim or transfer a WhatsApp Business username for the account. Username rules: 3-35 characters, letters/digits/period/underscore only, must contain at least one letter, no leading or trailing periods, no consecutive periods, no `www` prefix, no domain TLD suffix (e.g. `.com`). If the desired username is currently held by another account, pass `transferAction: &quot;force_transfer&quot;` to request a transfer. On failure the API returns a standard error envelope with one of these codes: `whatsapp_username_unavailable` (already taken and transfer not requested), `whatsapp_username_ineligible` (account not eligible to claim a username), or `whatsapp_username_transfer_required` (username is held elsewhere; retry with `force_transfer`).

Parameters:

Returns:



1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1871

def set_whatsapp_business_username_with_http_info(set_whatsapp_business_username_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.set_whatsapp_business_username ...'
  end
  # verify the required parameter 'set_whatsapp_business_username_request' is set
  if @api_client.config.client_side_validation && set_whatsapp_business_username_request.nil?
    fail ArgumentError, "Missing the required parameter 'set_whatsapp_business_username_request' when calling WhatsAppApi.set_whatsapp_business_username"
  end
  # resource path
  local_var_path = '/v1/whatsapp/business-profile/username'

  # 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_whatsapp_business_username_request)

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

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

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

#unblock_whats_app_users(unblock_whats_app_users_request, opts = {}) ⇒ UnblockWhatsAppUsers200Response

Unblock users Unblock one or more previously blocked WhatsApp users on this number. Up to 1,000 users per request; per-user failures are reported in failed without failing the rest of the batch.

Parameters:

Returns:



1929
1930
1931
1932
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1929

def unblock_whats_app_users(unblock_whats_app_users_request, opts = {})
  data, _status_code, _headers = unblock_whats_app_users_with_http_info(unblock_whats_app_users_request, opts)
  data
end

#unblock_whats_app_users_with_http_info(unblock_whats_app_users_request, opts = {}) ⇒ Array<(UnblockWhatsAppUsers200Response, Integer, Hash)>

Unblock users Unblock one or more previously blocked WhatsApp users on this number. Up to 1,000 users per request; per-user failures are reported in `failed` without failing the rest of the batch.

Parameters:

Returns:



1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1939

def unblock_whats_app_users_with_http_info(unblock_whats_app_users_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.unblock_whats_app_users ...'
  end
  # verify the required parameter 'unblock_whats_app_users_request' is set
  if @api_client.config.client_side_validation && unblock_whats_app_users_request.nil?
    fail ArgumentError, "Missing the required parameter 'unblock_whats_app_users_request' when calling WhatsAppApi.unblock_whats_app_users"
  end
  # resource path
  local_var_path = '/v1/whatsapp/block-users'

  # 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(unblock_whats_app_users_request)

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

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

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

#update_whats_app_business_profile(update_whats_app_business_profile_request, opts = {}) ⇒ UnpublishPost200Response

Update business profile Update the WhatsApp Business profile. All fields are optional; only provided fields will be updated. Constraints: about max 139 chars, description max 512 chars, max 2 websites.

Parameters:

Returns:



1997
1998
1999
2000
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 1997

def update_whats_app_business_profile(update_whats_app_business_profile_request, opts = {})
  data, _status_code, _headers = update_whats_app_business_profile_with_http_info(update_whats_app_business_profile_request, opts)
  data
end

#update_whats_app_business_profile_with_http_info(update_whats_app_business_profile_request, opts = {}) ⇒ Array<(UnpublishPost200Response, Integer, Hash)>

Update business profile Update the WhatsApp Business profile. All fields are optional; only provided fields will be updated. Constraints: about max 139 chars, description max 512 chars, max 2 websites.

Parameters:

Returns:

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

    UnpublishPost200Response data, response status code and response headers



2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 2007

def update_whats_app_business_profile_with_http_info(update_whats_app_business_profile_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.update_whats_app_business_profile ...'
  end
  # verify the required parameter 'update_whats_app_business_profile_request' is set
  if @api_client.config.client_side_validation && update_whats_app_business_profile_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_whats_app_business_profile_request' when calling WhatsAppApi.update_whats_app_business_profile"
  end
  # resource path
  local_var_path = '/v1/whatsapp/business-profile'

  # 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(update_whats_app_business_profile_request)

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

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

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

#update_whats_app_display_name(update_whats_app_display_name_request, opts = {}) ⇒ UpdateWhatsAppDisplayName200Response

Request display name change Submit a display name change request for the WhatsApp Business account. The new name must follow WhatsApp naming guidelines (3-512 characters, must represent your business). Changes require Meta review and approval, which typically takes 1-3 business days.

Parameters:

Returns:



2065
2066
2067
2068
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 2065

def update_whats_app_display_name(update_whats_app_display_name_request, opts = {})
  data, _status_code, _headers = update_whats_app_display_name_with_http_info(update_whats_app_display_name_request, opts)
  data
end

#update_whats_app_display_name_with_http_info(update_whats_app_display_name_request, opts = {}) ⇒ Array<(UpdateWhatsAppDisplayName200Response, Integer, Hash)>

Request display name change Submit a display name change request for the WhatsApp Business account. The new name must follow WhatsApp naming guidelines (3-512 characters, must represent your business). Changes require Meta review and approval, which typically takes 1-3 business days.

Parameters:

Returns:



2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 2075

def update_whats_app_display_name_with_http_info(update_whats_app_display_name_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.update_whats_app_display_name ...'
  end
  # verify the required parameter 'update_whats_app_display_name_request' is set
  if @api_client.config.client_side_validation && update_whats_app_display_name_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_whats_app_display_name_request' when calling WhatsAppApi.update_whats_app_display_name"
  end
  # resource path
  local_var_path = '/v1/whatsapp/business-profile/display-name'

  # 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(update_whats_app_display_name_request)

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

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

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

#update_whats_app_group_chat(group_id, account_id, update_whats_app_group_chat_request, opts = {}) ⇒ UnpublishPost200Response

Update group settings Update the subject, description, or join approval mode of a WhatsApp group. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



2135
2136
2137
2138
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 2135

def update_whats_app_group_chat(group_id, , update_whats_app_group_chat_request, opts = {})
  data, _status_code, _headers = update_whats_app_group_chat_with_http_info(group_id, , update_whats_app_group_chat_request, opts)
  data
end

#update_whats_app_group_chat_with_http_info(group_id, account_id, update_whats_app_group_chat_request, opts = {}) ⇒ Array<(UnpublishPost200Response, Integer, Hash)>

Update group settings Update the subject, description, or join approval mode of a WhatsApp group. Not available on Coexistence numbers. Requires a Cloud API-only number.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:

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

    UnpublishPost200Response data, response status code and response headers



2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 2147

def update_whats_app_group_chat_with_http_info(group_id, , update_whats_app_group_chat_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.update_whats_app_group_chat ...'
  end
  # verify the required parameter 'group_id' is set
  if @api_client.config.client_side_validation && group_id.nil?
    fail ArgumentError, "Missing the required parameter 'group_id' when calling WhatsAppApi.update_whats_app_group_chat"
  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 WhatsAppApi.update_whats_app_group_chat"
  end
  # verify the required parameter 'update_whats_app_group_chat_request' is set
  if @api_client.config.client_side_validation && update_whats_app_group_chat_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_whats_app_group_chat_request' when calling WhatsAppApi.update_whats_app_group_chat"
  end
  # resource path
  local_var_path = '/v1/whatsapp/wa-groups/{groupId}'.sub('{' + 'groupId' + '}', CGI.escape(group_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']
  # 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(update_whats_app_group_chat_request)

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

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

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

#update_whats_app_template(template_name, update_whats_app_template_request, opts = {}) ⇒ UpdateWhatsAppTemplate200Response

Update template Update a message template's components. Only certain fields can be updated depending on the template's current approval state. Approved templates can only have components updated.

Parameters:

  • template_name (String)

    Template name

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

    the optional parameters

Returns:



2215
2216
2217
2218
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 2215

def update_whats_app_template(template_name, update_whats_app_template_request, opts = {})
  data, _status_code, _headers = update_whats_app_template_with_http_info(template_name, update_whats_app_template_request, opts)
  data
end

#update_whats_app_template_with_http_info(template_name, update_whats_app_template_request, opts = {}) ⇒ Array<(UpdateWhatsAppTemplate200Response, Integer, Hash)>

Update template Update a message template's components. Only certain fields can be updated depending on the template's current approval state. Approved templates can only have components updated.

Parameters:

  • template_name (String)

    Template name

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

    the optional parameters

Returns:



2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 2226

def update_whats_app_template_with_http_info(template_name, update_whats_app_template_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.update_whats_app_template ...'
  end
  # verify the required parameter 'template_name' is set
  if @api_client.config.client_side_validation && template_name.nil?
    fail ArgumentError, "Missing the required parameter 'template_name' when calling WhatsAppApi.update_whats_app_template"
  end
  # verify the required parameter 'update_whats_app_template_request' is set
  if @api_client.config.client_side_validation && update_whats_app_template_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_whats_app_template_request' when calling WhatsAppApi.update_whats_app_template"
  end
  # resource path
  local_var_path = '/v1/whatsapp/templates/{templateName}'.sub('{' + 'templateName' + '}', CGI.escape(template_name.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(update_whats_app_template_request)

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

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

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

#upload_whats_app_profile_photo(account_id, file, opts = {}) ⇒ UnpublishPost200Response

Upload profile picture Upload a new profile picture for the WhatsApp Business Profile. Uses Meta's resumable upload API under the hood: creates an upload session, uploads the image bytes, then updates the business profile with the resulting handle. Provide the image either as a binary upload (multipart/form-data with file) or as a download URL (application/json with url) — with a URL we fetch the image server-side and upload the bytes for you. Meta's profile-photo API is bytes-only, so there is no direct URL passthrough. JPEG/PNG, max 5MB either way.

Parameters:

  • account_id (String)

    WhatsApp social account ID

  • file (File)

    Image file (JPEG or PNG, max 5MB, recommended 640x640)

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

    the optional parameters

Returns:



2289
2290
2291
2292
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 2289

def upload_whats_app_profile_photo(, file, opts = {})
  data, _status_code, _headers = upload_whats_app_profile_photo_with_http_info(, file, opts)
  data
end

#upload_whats_app_profile_photo_with_http_info(account_id, file, opts = {}) ⇒ Array<(UnpublishPost200Response, Integer, Hash)>

Upload profile picture Upload a new profile picture for the WhatsApp Business Profile. Uses Meta's resumable upload API under the hood: creates an upload session, uploads the image bytes, then updates the business profile with the resulting handle. Provide the image either as a binary upload (`multipart/form-data` with `file`) or as a download URL (`application/json` with `url`) — with a URL we fetch the image server-side and upload the bytes for you. Meta's profile-photo API is bytes-only, so there is no direct URL passthrough. JPEG/PNG, max 5MB either way.

Parameters:

  • account_id (String)

    WhatsApp social account ID

  • file (File)

    Image file (JPEG or PNG, max 5MB, recommended 640x640)

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

    the optional parameters

Returns:

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

    UnpublishPost200Response data, response status code and response headers



2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
# File 'lib/zernio-sdk/api/whats_app_api.rb', line 2300

def upload_whats_app_profile_photo_with_http_info(, file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.upload_whats_app_profile_photo ...'
  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 WhatsAppApi.upload_whats_app_profile_photo"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling WhatsAppApi.upload_whats_app_profile_photo"
  end
  # resource path
  local_var_path = '/v1/whatsapp/business-profile/photo'

  # 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(['multipart/form-data', 'application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

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