Class: Late::WhatsAppApi

Inherits:
Object
  • Object
show all
Defined in:
lib/late-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/late-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/late-sdk/api/whats_app_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_whats_app_broadcast_recipients(broadcast_id, add_whats_app_broadcast_recipients_request, opts = {}) ⇒ AddWhatsAppBroadcastRecipients200Response

Add recipients Deprecated. Use ‘POST /v1/broadcasts/id/recipients` instead. Add recipients to a draft broadcast. Maximum 1000 recipients per request. Duplicate phone numbers are automatically skipped.

Parameters:

Returns:



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

def add_whats_app_broadcast_recipients(broadcast_id, add_whats_app_broadcast_recipients_request, opts = {})
  data, _status_code, _headers = add_whats_app_broadcast_recipients_with_http_info(broadcast_id, add_whats_app_broadcast_recipients_request, opts)
  data
end

#add_whats_app_broadcast_recipients_with_http_info(broadcast_id, add_whats_app_broadcast_recipients_request, opts = {}) ⇒ Array<(AddWhatsAppBroadcastRecipients200Response, Integer, Hash)>

Add recipients Deprecated. Use &#x60;POST /v1/broadcasts/id/recipients&#x60; instead. Add recipients to a draft broadcast. Maximum 1000 recipients per request. Duplicate phone numbers are automatically skipped.

Parameters:

Returns:



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

def add_whats_app_broadcast_recipients_with_http_info(broadcast_id, add_whats_app_broadcast_recipients_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.add_whats_app_broadcast_recipients ...'
  end
  # verify the required parameter 'broadcast_id' is set
  if @api_client.config.client_side_validation && broadcast_id.nil?
    fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling WhatsAppApi.add_whats_app_broadcast_recipients"
  end
  # verify the required parameter 'add_whats_app_broadcast_recipients_request' is set
  if @api_client.config.client_side_validation && add_whats_app_broadcast_recipients_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_whats_app_broadcast_recipients_request' when calling WhatsAppApi.add_whats_app_broadcast_recipients"
  end
  # resource path
  local_var_path = '/v1/whatsapp/broadcasts/{broadcastId}/recipients'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

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

#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.

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:



103
104
105
106
# File 'lib/late-sdk/api/whats_app_api.rb', line 103

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.

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



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

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.

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:



184
185
186
187
# File 'lib/late-sdk/api/whats_app_api.rb', line 184

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.

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



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

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

#bulk_delete_whats_app_contacts(bulk_delete_whats_app_contacts_request, opts = {}) ⇒ BulkDeleteWhatsAppContacts200Response

Bulk delete contacts Deprecated. Use ‘DELETE /v1/contacts/id` for individual deletes instead. Permanently delete multiple contacts at once (max 500 per request).

Parameters:

Returns:



263
264
265
266
# File 'lib/late-sdk/api/whats_app_api.rb', line 263

def bulk_delete_whats_app_contacts(bulk_delete_whats_app_contacts_request, opts = {})
  data, _status_code, _headers = bulk_delete_whats_app_contacts_with_http_info(bulk_delete_whats_app_contacts_request, opts)
  data
end

#bulk_delete_whats_app_contacts_with_http_info(bulk_delete_whats_app_contacts_request, opts = {}) ⇒ Array<(BulkDeleteWhatsAppContacts200Response, Integer, Hash)>

Bulk delete contacts Deprecated. Use &#x60;DELETE /v1/contacts/id&#x60; for individual deletes instead. Permanently delete multiple contacts at once (max 500 per request).

Parameters:

Returns:



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
319
320
321
322
323
324
# File 'lib/late-sdk/api/whats_app_api.rb', line 273

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

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

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

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

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

#bulk_update_whats_app_contacts(bulk_update_whats_app_contacts_request, opts = {}) ⇒ BulkUpdateWhatsAppContacts200Response

Bulk update contacts Deprecated. Use ‘PATCH /v1/contacts/id` for individual updates instead. Perform bulk operations on multiple contacts (max 500 per request). Supported actions: addTags, removeTags, addGroups, removeGroups, optIn, optOut, block, unblock.

Parameters:

Returns:



331
332
333
334
# File 'lib/late-sdk/api/whats_app_api.rb', line 331

def bulk_update_whats_app_contacts(bulk_update_whats_app_contacts_request, opts = {})
  data, _status_code, _headers = bulk_update_whats_app_contacts_with_http_info(bulk_update_whats_app_contacts_request, opts)
  data
end

#bulk_update_whats_app_contacts_with_http_info(bulk_update_whats_app_contacts_request, opts = {}) ⇒ Array<(BulkUpdateWhatsAppContacts200Response, Integer, Hash)>

Bulk update contacts Deprecated. Use &#x60;PATCH /v1/contacts/id&#x60; for individual updates instead. Perform bulk operations on multiple contacts (max 500 per request). Supported actions: addTags, removeTags, addGroups, removeGroups, optIn, optOut, block, unblock.

Parameters:

Returns:



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
387
388
389
390
391
392
# File 'lib/late-sdk/api/whats_app_api.rb', line 341

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

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

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

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

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

#cancel_whats_app_broadcast_schedule(broadcast_id, opts = {}) ⇒ CancelWhatsAppBroadcastSchedule200Response

Cancel scheduled broadcast Deprecated. Use ‘POST /v1/broadcasts/id/cancel` instead. Cancel a scheduled broadcast and return it to draft status. Only broadcasts in scheduled status can be cancelled.

Parameters:

  • broadcast_id (String)

    Broadcast ID

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

    the optional parameters

Returns:



399
400
401
402
# File 'lib/late-sdk/api/whats_app_api.rb', line 399

def cancel_whats_app_broadcast_schedule(broadcast_id, opts = {})
  data, _status_code, _headers = cancel_whats_app_broadcast_schedule_with_http_info(broadcast_id, opts)
  data
end

#cancel_whats_app_broadcast_schedule_with_http_info(broadcast_id, opts = {}) ⇒ Array<(CancelWhatsAppBroadcastSchedule200Response, Integer, Hash)>

Cancel scheduled broadcast Deprecated. Use &#x60;POST /v1/broadcasts/id/cancel&#x60; instead. Cancel a scheduled broadcast and return it to draft status. Only broadcasts in scheduled status can be cancelled.

Parameters:

  • broadcast_id (String)

    Broadcast ID

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

    the optional parameters

Returns:



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

def cancel_whats_app_broadcast_schedule_with_http_info(broadcast_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.cancel_whats_app_broadcast_schedule ...'
  end
  # verify the required parameter 'broadcast_id' is set
  if @api_client.config.client_side_validation && broadcast_id.nil?
    fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling WhatsAppApi.cancel_whats_app_broadcast_schedule"
  end
  # resource path
  local_var_path = '/v1/whatsapp/broadcasts/{broadcastId}/schedule'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))

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

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

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

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

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

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

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

#create_whats_app_broadcast(create_whats_app_broadcast_request, opts = {}) ⇒ CreateWhatsAppBroadcast200Response

Create broadcast Deprecated. Use ‘POST /v1/broadcasts` instead. Create a new draft broadcast. Optionally include initial recipients. After creation, add recipients and then send or schedule the broadcast.

Parameters:

Returns:



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

def create_whats_app_broadcast(create_whats_app_broadcast_request, opts = {})
  data, _status_code, _headers = create_whats_app_broadcast_with_http_info(create_whats_app_broadcast_request, opts)
  data
end

#create_whats_app_broadcast_with_http_info(create_whats_app_broadcast_request, opts = {}) ⇒ Array<(CreateWhatsAppBroadcast200Response, Integer, Hash)>

Create broadcast Deprecated. Use &#x60;POST /v1/broadcasts&#x60; instead. Create a new draft broadcast. Optionally include initial recipients. After creation, add recipients and then send or schedule the broadcast.

Parameters:

Returns:



472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/late-sdk/api/whats_app_api.rb', line 472

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

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

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

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

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

#create_whats_app_contact(create_whats_app_contact_request, opts = {}) ⇒ CreateWhatsAppContact200Response

Create contact Deprecated. Use ‘POST /v1/contacts` instead. Create a new WhatsApp contact. Phone number must be unique per account and in E.164 format (e.g., +1234567890).

Parameters:

Returns:



530
531
532
533
# File 'lib/late-sdk/api/whats_app_api.rb', line 530

def create_whats_app_contact(create_whats_app_contact_request, opts = {})
  data, _status_code, _headers = create_whats_app_contact_with_http_info(create_whats_app_contact_request, opts)
  data
end

#create_whats_app_contact_with_http_info(create_whats_app_contact_request, opts = {}) ⇒ Array<(CreateWhatsAppContact200Response, Integer, Hash)>

Create contact Deprecated. Use &#x60;POST /v1/contacts&#x60; instead. Create a new WhatsApp contact. Phone number must be unique per account and in E.164 format (e.g., +1234567890).

Parameters:

Returns:



540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
# File 'lib/late-sdk/api/whats_app_api.rb', line 540

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

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

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

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

  new_options = opts.merge(
    :operation => :"WhatsAppApi.create_whats_app_contact",
    :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_contact\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.

Parameters:

Returns:



598
599
600
601
# File 'lib/late-sdk/api/whats_app_api.rb', line 598

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.

Parameters:

Returns:



608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
# File 'lib/late-sdk/api/whats_app_api.rb', line 608

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.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



667
668
669
670
# File 'lib/late-sdk/api/whats_app_api.rb', line 667

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.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



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

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: business.facebook.com/wa/manage/message-templates/

Parameters:

Returns:



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

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 &#x60;components&#x60; with your own content. Submitted to Meta for review (can take up to 24h). **Library template:** Provide &#x60;library_template_name&#x60; instead of &#x60;components&#x60; to use a pre-built template from Meta&#39;s template library. Library templates are pre-approved (no review wait). You can optionally customize parameters and buttons via &#x60;library_template_body_inputs&#x60; and &#x60;library_template_button_inputs&#x60;. Browse available library templates at: business.facebook.com/wa/manage/message-templates/

Parameters:

Returns:



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

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_broadcast(broadcast_id, opts = {}) ⇒ UnpublishPost200Response

Delete broadcast Deprecated. Use ‘DELETE /v1/broadcasts/id` instead. Delete a broadcast. Only draft or cancelled broadcasts can be deleted.

Parameters:

  • broadcast_id (String)

    Broadcast ID

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

    the optional parameters

Returns:



804
805
806
807
# File 'lib/late-sdk/api/whats_app_api.rb', line 804

def delete_whats_app_broadcast(broadcast_id, opts = {})
  data, _status_code, _headers = delete_whats_app_broadcast_with_http_info(broadcast_id, opts)
  data
end

#delete_whats_app_broadcast_with_http_info(broadcast_id, opts = {}) ⇒ Array<(UnpublishPost200Response, Integer, Hash)>

Delete broadcast Deprecated. Use &#x60;DELETE /v1/broadcasts/id&#x60; instead. Delete a broadcast. Only draft or cancelled broadcasts can be deleted.

Parameters:

  • broadcast_id (String)

    Broadcast ID

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

    the optional parameters

Returns:

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

    UnpublishPost200Response data, response status code and response headers



814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
# File 'lib/late-sdk/api/whats_app_api.rb', line 814

def delete_whats_app_broadcast_with_http_info(broadcast_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.delete_whats_app_broadcast ...'
  end
  # verify the required parameter 'broadcast_id' is set
  if @api_client.config.client_side_validation && broadcast_id.nil?
    fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling WhatsAppApi.delete_whats_app_broadcast"
  end
  # resource path
  local_var_path = '/v1/whatsapp/broadcasts/{broadcastId}'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))

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

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

  # 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_broadcast",
    :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_broadcast\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_whats_app_contact(contact_id, opts = {}) ⇒ UnpublishPost200Response

Delete contact Deprecated. Use ‘DELETE /v1/contacts/id` instead. Permanently delete a WhatsApp contact.

Parameters:

  • contact_id (String)

    Contact ID

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

    the optional parameters

Returns:



867
868
869
870
# File 'lib/late-sdk/api/whats_app_api.rb', line 867

def delete_whats_app_contact(contact_id, opts = {})
  data, _status_code, _headers = delete_whats_app_contact_with_http_info(contact_id, opts)
  data
end

#delete_whats_app_contact_with_http_info(contact_id, opts = {}) ⇒ Array<(UnpublishPost200Response, Integer, Hash)>

Delete contact Deprecated. Use &#x60;DELETE /v1/contacts/id&#x60; instead. Permanently delete a WhatsApp contact.

Parameters:

  • contact_id (String)

    Contact ID

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

    the optional parameters

Returns:

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

    UnpublishPost200Response data, response status code and response headers



877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
# File 'lib/late-sdk/api/whats_app_api.rb', line 877

def delete_whats_app_contact_with_http_info(contact_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.delete_whats_app_contact ...'
  end
  # verify the required parameter 'contact_id' is set
  if @api_client.config.client_side_validation && contact_id.nil?
    fail ArgumentError, "Missing the required parameter 'contact_id' when calling WhatsAppApi.delete_whats_app_contact"
  end
  # resource path
  local_var_path = '/v1/whatsapp/contacts/{contactId}'.sub('{' + 'contactId' + '}', CGI.escape(contact_id.to_s))

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

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

  # 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_contact",
    :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_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_whats_app_group(delete_whats_app_group_request, opts = {}) ⇒ RenameWhatsAppGroup200Response

Delete group Deprecated. Use contact tags via ‘PATCH /v1/contacts/id` instead. Delete a contact group. This removes the group from all contacts but does not delete the contacts themselves.

Parameters:

Returns:



930
931
932
933
# File 'lib/late-sdk/api/whats_app_api.rb', line 930

def delete_whats_app_group(delete_whats_app_group_request, opts = {})
  data, _status_code, _headers = delete_whats_app_group_with_http_info(delete_whats_app_group_request, opts)
  data
end

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

Delete group Delete a WhatsApp group and remove all participants.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



999
1000
1001
1002
# File 'lib/late-sdk/api/whats_app_api.rb', line 999

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.

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



1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
# File 'lib/late-sdk/api/whats_app_api.rb', line 1010

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_group_with_http_info(delete_whats_app_group_request, opts = {}) ⇒ Array<(RenameWhatsAppGroup200Response, Integer, Hash)>

Delete group Deprecated. Use contact tags via &#x60;PATCH /v1/contacts/id&#x60; instead. Delete a contact group. This removes the group from all contacts but does not delete the contacts themselves.

Parameters:

Returns:



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

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

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

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

  new_options = opts.merge(
    :operation => :"WhatsAppApi.delete_whats_app_group",
    :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\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:



1069
1070
1071
1072
# File 'lib/late-sdk/api/whats_app_api.rb', line 1069

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



1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
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
# File 'lib/late-sdk/api/whats_app_api.rb', line 1080

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

#get_whats_app_broadcast(broadcast_id, opts = {}) ⇒ GetWhatsAppBroadcast200Response

Get broadcast Deprecated. Use ‘GET /v1/broadcasts/id` instead. Retrieve detailed information about a single broadcast including delivery statistics.

Parameters:

  • broadcast_id (String)

    Broadcast ID

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

    the optional parameters

Returns:



1138
1139
1140
1141
# File 'lib/late-sdk/api/whats_app_api.rb', line 1138

def get_whats_app_broadcast(broadcast_id, opts = {})
  data, _status_code, _headers = get_whats_app_broadcast_with_http_info(broadcast_id, opts)
  data
end

#get_whats_app_broadcast_recipients(broadcast_id, opts = {}) ⇒ GetWhatsAppBroadcastRecipients200Response

List recipients Deprecated. Use ‘GET /v1/broadcasts/id/recipients` instead. List recipients of a broadcast with their delivery status. Supports filtering by delivery status and pagination.

Parameters:

  • broadcast_id (String)

    Broadcast ID

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

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by recipient delivery status

  • :limit (Integer)

    Maximum results (default 100) (default to 100)

  • :skip (Integer)

    Offset for pagination (default to 0)

Returns:



1204
1205
1206
1207
# File 'lib/late-sdk/api/whats_app_api.rb', line 1204

def get_whats_app_broadcast_recipients(broadcast_id, opts = {})
  data, _status_code, _headers = get_whats_app_broadcast_recipients_with_http_info(broadcast_id, opts)
  data
end

#get_whats_app_broadcast_recipients_with_http_info(broadcast_id, opts = {}) ⇒ Array<(GetWhatsAppBroadcastRecipients200Response, Integer, Hash)>

List recipients Deprecated. Use &#x60;GET /v1/broadcasts/id/recipients&#x60; instead. List recipients of a broadcast with their delivery status. Supports filtering by delivery status and pagination.

Parameters:

  • broadcast_id (String)

    Broadcast ID

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

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by recipient delivery status

  • :limit (Integer)

    Maximum results (default 100) (default to 100)

  • :skip (Integer)

    Offset for pagination (default to 0)

Returns:



1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
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
# File 'lib/late-sdk/api/whats_app_api.rb', line 1217

def get_whats_app_broadcast_recipients_with_http_info(broadcast_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_broadcast_recipients ...'
  end
  # verify the required parameter 'broadcast_id' is set
  if @api_client.config.client_side_validation && broadcast_id.nil?
    fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling WhatsAppApi.get_whats_app_broadcast_recipients"
  end
  allowable_values = ["pending", "sent", "delivered", "read", "failed"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/whatsapp/broadcasts/{broadcastId}/recipients'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))

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

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

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

#get_whats_app_broadcast_with_http_info(broadcast_id, opts = {}) ⇒ Array<(GetWhatsAppBroadcast200Response, Integer, Hash)>

Get broadcast Deprecated. Use &#x60;GET /v1/broadcasts/id&#x60; instead. Retrieve detailed information about a single broadcast including delivery statistics.

Parameters:

  • broadcast_id (String)

    Broadcast ID

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

    the optional parameters

Returns:



1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
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
# File 'lib/late-sdk/api/whats_app_api.rb', line 1148

def get_whats_app_broadcast_with_http_info(broadcast_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_broadcast ...'
  end
  # verify the required parameter 'broadcast_id' is set
  if @api_client.config.client_side_validation && broadcast_id.nil?
    fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling WhatsAppApi.get_whats_app_broadcast"
  end
  # resource path
  local_var_path = '/v1/whatsapp/broadcasts/{broadcastId}'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))

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

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

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

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

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

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

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

#get_whats_app_broadcasts(account_id, opts = {}) ⇒ GetWhatsAppBroadcasts200Response

List broadcasts Deprecated. Use ‘GET /v1/broadcasts?profileId=profileId` instead. List all WhatsApp broadcasts for an account. Returns broadcasts sorted by creation date (newest first) without the full recipients list for performance.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by broadcast status

  • :limit (Integer)

    Maximum results (default 50) (default to 50)

  • :skip (Integer)

    Offset for pagination (default to 0)

Returns:



1280
1281
1282
1283
# File 'lib/late-sdk/api/whats_app_api.rb', line 1280

def get_whats_app_broadcasts(, opts = {})
  data, _status_code, _headers = get_whats_app_broadcasts_with_http_info(, opts)
  data
end

#get_whats_app_broadcasts_with_http_info(account_id, opts = {}) ⇒ Array<(GetWhatsAppBroadcasts200Response, Integer, Hash)>

List broadcasts Deprecated. Use &#x60;GET /v1/broadcasts?profileId&#x3D;profileId&#x60; instead. List all WhatsApp broadcasts for an account. Returns broadcasts sorted by creation date (newest first) without the full recipients list for performance.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by broadcast status

  • :limit (Integer)

    Maximum results (default 50) (default to 50)

  • :skip (Integer)

    Offset for pagination (default to 0)

Returns:



1293
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
1342
1343
1344
1345
1346
1347
# File 'lib/late-sdk/api/whats_app_api.rb', line 1293

def get_whats_app_broadcasts_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_broadcasts ...'
  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_broadcasts"
  end
  allowable_values = ["draft", "scheduled", "sending", "completed", "failed", "cancelled"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/whatsapp/broadcasts'

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

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

  new_options = opts.merge(
    :operation => :"WhatsAppApi.get_whats_app_broadcasts",
    :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_broadcasts\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:



1354
1355
1356
1357
# File 'lib/late-sdk/api/whats_app_api.rb', line 1354

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:



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
1406
1407
1408
1409
1410
1411
# File 'lib/late-sdk/api/whats_app_api.rb', line 1364

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_contact(contact_id, opts = {}) ⇒ GetWhatsAppContact200Response

Get contact Deprecated. Use ‘GET /v1/contacts/id` instead. Retrieve a single WhatsApp contact by ID with full details.

Parameters:

  • contact_id (String)

    Contact ID

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

    the optional parameters

Returns:



1418
1419
1420
1421
# File 'lib/late-sdk/api/whats_app_api.rb', line 1418

def get_whats_app_contact(contact_id, opts = {})
  data, _status_code, _headers = get_whats_app_contact_with_http_info(contact_id, opts)
  data
end

#get_whats_app_contact_with_http_info(contact_id, opts = {}) ⇒ Array<(GetWhatsAppContact200Response, Integer, Hash)>

Get contact Deprecated. Use &#x60;GET /v1/contacts/id&#x60; instead. Retrieve a single WhatsApp contact by ID with full details.

Parameters:

  • contact_id (String)

    Contact ID

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

    the optional parameters

Returns:



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

def get_whats_app_contact_with_http_info(contact_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_contact ...'
  end
  # verify the required parameter 'contact_id' is set
  if @api_client.config.client_side_validation && contact_id.nil?
    fail ArgumentError, "Missing the required parameter 'contact_id' when calling WhatsAppApi.get_whats_app_contact"
  end
  # resource path
  local_var_path = '/v1/whatsapp/contacts/{contactId}'.sub('{' + 'contactId' + '}', CGI.escape(contact_id.to_s))

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

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

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

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

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

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

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

#get_whats_app_contacts(account_id, opts = {}) ⇒ GetWhatsAppContacts200Response

List contacts Deprecated. Use ‘GET /v1/contacts?profileId=profileId` instead. List WhatsApp contacts for an account. Supports filtering by tags, groups, opt-in status, and text search. Returns contacts sorted by name with available filter options.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search contacts by name, phone, email, or company

  • :tag (String)

    Filter by tag

  • :group (String)

    Filter by group

  • :opted_in (String)

    Filter by opt-in status

  • :limit (Integer)

    Maximum results (default 50) (default to 50)

  • :skip (Integer)

    Offset for pagination (default to 0)

Returns:



1487
1488
1489
1490
# File 'lib/late-sdk/api/whats_app_api.rb', line 1487

def get_whats_app_contacts(, opts = {})
  data, _status_code, _headers = get_whats_app_contacts_with_http_info(, opts)
  data
end

#get_whats_app_contacts_with_http_info(account_id, opts = {}) ⇒ Array<(GetWhatsAppContacts200Response, Integer, Hash)>

List contacts Deprecated. Use &#x60;GET /v1/contacts?profileId&#x3D;profileId&#x60; instead. List WhatsApp contacts for an account. Supports filtering by tags, groups, opt-in status, and text search. Returns contacts sorted by name with available filter options.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Search contacts by name, phone, email, or company

  • :tag (String)

    Filter by tag

  • :group (String)

    Filter by group

  • :opted_in (String)

    Filter by opt-in status

  • :limit (Integer)

    Maximum results (default 50) (default to 50)

  • :skip (Integer)

    Offset for pagination (default to 0)

Returns:



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
1555
1556
1557
1558
1559
1560
# File 'lib/late-sdk/api/whats_app_api.rb', line 1503

def get_whats_app_contacts_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.get_whats_app_contacts ...'
  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_contacts"
  end
  allowable_values = ["true", "false"]
  if @api_client.config.client_side_validation && opts[:'opted_in'] && !allowable_values.include?(opts[:'opted_in'])
    fail ArgumentError, "invalid value for \"opted_in\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/whatsapp/contacts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?
  query_params[:'group'] = opts[:'group'] if !opts[:'group'].nil?
  query_params[:'optedIn'] = opts[:'opted_in'] if !opts[:'opted_in'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].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] || 'GetWhatsAppContacts200Response'

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

  new_options = opts.merge(
    :operation => :"WhatsAppApi.get_whats_app_contacts",
    :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_contacts\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 and review 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:



1567
1568
1569
1570
# File 'lib/late-sdk/api/whats_app_api.rb', line 1567

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 and review 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:



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/late-sdk/api/whats_app_api.rb', line 1577

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.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



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

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.

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



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

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_groups(account_id, opts = {}) ⇒ GetWhatsAppGroups200Response

List contact groups Deprecated. Use contact tags via ‘GET /v1/contacts` for grouping instead. WhatsApp groups have no cross-platform equivalent. List all contact groups for a WhatsApp account with contact counts. Groups are derived from the groups field on contacts, not stored as separate documents.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1701
1702
1703
1704
# File 'lib/late-sdk/api/whats_app_api.rb', line 1701

def get_whats_app_groups(, opts = {})
  data, _status_code, _headers = get_whats_app_groups_with_http_info(, opts)
  data
end

#get_whats_app_groups_with_http_info(account_id, opts = {}) ⇒ Array<(GetWhatsAppGroups200Response, Integer, Hash)>

List contact groups Deprecated. Use contact tags via &#x60;GET /v1/contacts&#x60; for grouping instead. WhatsApp groups have no cross-platform equivalent. List all contact groups for a WhatsApp account with contact counts. Groups are derived from the groups field on contacts, not stored as separate documents.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
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
# File 'lib/late-sdk/api/whats_app_api.rb', line 1711

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

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

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

  new_options = opts.merge(
    :operation => :"WhatsAppApi.get_whats_app_groups",
    :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_groups\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:



1766
1767
1768
1769
# File 'lib/late-sdk/api/whats_app_api.rb', line 1766

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:



1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
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
# File 'lib/late-sdk/api/whats_app_api.rb', line 1777

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:



1835
1836
1837
1838
# File 'lib/late-sdk/api/whats_app_api.rb', line 1835

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:



1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
# File 'lib/late-sdk/api/whats_app_api.rb', line 1845

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

#import_whats_app_contacts(import_whats_app_contacts_request, opts = {}) ⇒ ImportWhatsAppContacts200Response

Bulk import contacts Deprecated. Use ‘POST /v1/contacts/bulk` instead. Import up to 1000 contacts at once. Each contact requires a phone number and name. Duplicates are skipped by default. Supports default tags and groups applied to all imported contacts.

Parameters:

Returns:



1899
1900
1901
1902
# File 'lib/late-sdk/api/whats_app_api.rb', line 1899

def import_whats_app_contacts(import_whats_app_contacts_request, opts = {})
  data, _status_code, _headers = import_whats_app_contacts_with_http_info(import_whats_app_contacts_request, opts)
  data
end

#import_whats_app_contacts_with_http_info(import_whats_app_contacts_request, opts = {}) ⇒ Array<(ImportWhatsAppContacts200Response, Integer, Hash)>

Bulk import contacts Deprecated. Use &#x60;POST /v1/contacts/bulk&#x60; instead. Import up to 1000 contacts at once. Each contact requires a phone number and name. Duplicates are skipped by default. Supports default tags and groups applied to all imported contacts.

Parameters:

Returns:



1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
# File 'lib/late-sdk/api/whats_app_api.rb', line 1909

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

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

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

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

  new_options = opts.merge(
    :operation => :"WhatsAppApi.import_whats_app_contacts",
    :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#import_whats_app_contacts\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.

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:



1969
1970
1971
1972
# File 'lib/late-sdk/api/whats_app_api.rb', line 1969

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.

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:



1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
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
# File 'lib/late-sdk/api/whats_app_api.rb', line 1981

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).

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



2042
2043
2044
2045
# File 'lib/late-sdk/api/whats_app_api.rb', line 2042

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).

Parameters:

  • group_id (String)

    Group ID

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
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
# File 'lib/late-sdk/api/whats_app_api.rb', line 2053

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.

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:



2113
2114
2115
2116
# File 'lib/late-sdk/api/whats_app_api.rb', line 2113

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.

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



2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
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
# File 'lib/late-sdk/api/whats_app_api.rb', line 2125

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_broadcast_recipients(broadcast_id, remove_whats_app_broadcast_recipients_request, opts = {}) ⇒ RemoveWhatsAppBroadcastRecipients200Response

Remove recipients Deprecated. Use ‘POST /v1/broadcasts/id/recipients` with removal flag instead. Remove recipients from a draft broadcast by phone number.

Parameters:

Returns:



2193
2194
2195
2196
# File 'lib/late-sdk/api/whats_app_api.rb', line 2193

def remove_whats_app_broadcast_recipients(broadcast_id, remove_whats_app_broadcast_recipients_request, opts = {})
  data, _status_code, _headers = remove_whats_app_broadcast_recipients_with_http_info(broadcast_id, remove_whats_app_broadcast_recipients_request, opts)
  data
end

#remove_whats_app_broadcast_recipients_with_http_info(broadcast_id, remove_whats_app_broadcast_recipients_request, opts = {}) ⇒ Array<(RemoveWhatsAppBroadcastRecipients200Response, Integer, Hash)>

Remove recipients Deprecated. Use &#x60;POST /v1/broadcasts/id/recipients&#x60; with removal flag instead. Remove recipients from a draft broadcast by phone number.

Parameters:

Returns:



2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
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
# File 'lib/late-sdk/api/whats_app_api.rb', line 2204

def remove_whats_app_broadcast_recipients_with_http_info(broadcast_id, remove_whats_app_broadcast_recipients_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.remove_whats_app_broadcast_recipients ...'
  end
  # verify the required parameter 'broadcast_id' is set
  if @api_client.config.client_side_validation && broadcast_id.nil?
    fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling WhatsAppApi.remove_whats_app_broadcast_recipients"
  end
  # verify the required parameter 'remove_whats_app_broadcast_recipients_request' is set
  if @api_client.config.client_side_validation && remove_whats_app_broadcast_recipients_request.nil?
    fail ArgumentError, "Missing the required parameter 'remove_whats_app_broadcast_recipients_request' when calling WhatsAppApi.remove_whats_app_broadcast_recipients"
  end
  # resource path
  local_var_path = '/v1/whatsapp/broadcasts/{broadcastId}/recipients'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

  new_options = opts.merge(
    :operation => :"WhatsAppApi.remove_whats_app_broadcast_recipients",
    :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_broadcast_recipients\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.

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:



2268
2269
2270
2271
# File 'lib/late-sdk/api/whats_app_api.rb', line 2268

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.

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



2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
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
# File 'lib/late-sdk/api/whats_app_api.rb', line 2280

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

#rename_whats_app_group(rename_whats_app_group_request, opts = {}) ⇒ RenameWhatsAppGroup200Response

Rename group Deprecated. Use contact tags via ‘PATCH /v1/contacts/id` instead. Rename a contact group. This updates the group name on all contacts that belong to the group.

Parameters:

Returns:



2347
2348
2349
2350
# File 'lib/late-sdk/api/whats_app_api.rb', line 2347

def rename_whats_app_group(rename_whats_app_group_request, opts = {})
  data, _status_code, _headers = rename_whats_app_group_with_http_info(rename_whats_app_group_request, opts)
  data
end

#rename_whats_app_group_with_http_info(rename_whats_app_group_request, opts = {}) ⇒ Array<(RenameWhatsAppGroup200Response, Integer, Hash)>

Rename group Deprecated. Use contact tags via &#x60;PATCH /v1/contacts/id&#x60; instead. Rename a contact group. This updates the group name on all contacts that belong to the group.

Parameters:

Returns:



2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
# File 'lib/late-sdk/api/whats_app_api.rb', line 2357

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

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

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

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

#schedule_whats_app_broadcast(broadcast_id, schedule_whats_app_broadcast_request, opts = {}) ⇒ ScheduleWhatsAppBroadcast200Response

Schedule broadcast Deprecated. Use ‘POST /v1/broadcasts/id/schedule` instead. Schedule a draft broadcast for future sending. The scheduled time must be in the future and no more than 30 days in advance. The broadcast must be in draft status and have recipients.

Parameters:

  • broadcast_id (String)

    Broadcast ID

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

    the optional parameters

Returns:



2416
2417
2418
2419
# File 'lib/late-sdk/api/whats_app_api.rb', line 2416

def schedule_whats_app_broadcast(broadcast_id, schedule_whats_app_broadcast_request, opts = {})
  data, _status_code, _headers = schedule_whats_app_broadcast_with_http_info(broadcast_id, schedule_whats_app_broadcast_request, opts)
  data
end

#schedule_whats_app_broadcast_with_http_info(broadcast_id, schedule_whats_app_broadcast_request, opts = {}) ⇒ Array<(ScheduleWhatsAppBroadcast200Response, Integer, Hash)>

Schedule broadcast Deprecated. Use &#x60;POST /v1/broadcasts/id/schedule&#x60; instead. Schedule a draft broadcast for future sending. The scheduled time must be in the future and no more than 30 days in advance. The broadcast must be in draft status and have recipients.

Parameters:

  • broadcast_id (String)

    Broadcast ID

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

    the optional parameters

Returns:



2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
# File 'lib/late-sdk/api/whats_app_api.rb', line 2427

def schedule_whats_app_broadcast_with_http_info(broadcast_id, schedule_whats_app_broadcast_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.schedule_whats_app_broadcast ...'
  end
  # verify the required parameter 'broadcast_id' is set
  if @api_client.config.client_side_validation && broadcast_id.nil?
    fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling WhatsAppApi.schedule_whats_app_broadcast"
  end
  # verify the required parameter 'schedule_whats_app_broadcast_request' is set
  if @api_client.config.client_side_validation && schedule_whats_app_broadcast_request.nil?
    fail ArgumentError, "Missing the required parameter 'schedule_whats_app_broadcast_request' when calling WhatsAppApi.schedule_whats_app_broadcast"
  end
  # resource path
  local_var_path = '/v1/whatsapp/broadcasts/{broadcastId}/schedule'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

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

#send_whats_app_broadcast(broadcast_id, opts = {}) ⇒ SendWhatsAppBroadcast200Response

Send broadcast Deprecated. Use ‘POST /v1/broadcasts/id/send` instead. Start sending a broadcast immediately. The broadcast must be in draft or scheduled status and have at least one recipient. Messages are sent sequentially with rate limiting.

Parameters:

  • broadcast_id (String)

    Broadcast ID

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

    the optional parameters

Returns:



2489
2490
2491
2492
# File 'lib/late-sdk/api/whats_app_api.rb', line 2489

def send_whats_app_broadcast(broadcast_id, opts = {})
  data, _status_code, _headers = send_whats_app_broadcast_with_http_info(broadcast_id, opts)
  data
end

#send_whats_app_broadcast_with_http_info(broadcast_id, opts = {}) ⇒ Array<(SendWhatsAppBroadcast200Response, Integer, Hash)>

Send broadcast Deprecated. Use &#x60;POST /v1/broadcasts/id/send&#x60; instead. Start sending a broadcast immediately. The broadcast must be in draft or scheduled status and have at least one recipient. Messages are sent sequentially with rate limiting.

Parameters:

  • broadcast_id (String)

    Broadcast ID

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

    the optional parameters

Returns:



2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
# File 'lib/late-sdk/api/whats_app_api.rb', line 2499

def send_whats_app_broadcast_with_http_info(broadcast_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.send_whats_app_broadcast ...'
  end
  # verify the required parameter 'broadcast_id' is set
  if @api_client.config.client_side_validation && broadcast_id.nil?
    fail ArgumentError, "Missing the required parameter 'broadcast_id' when calling WhatsAppApi.send_whats_app_broadcast"
  end
  # resource path
  local_var_path = '/v1/whatsapp/broadcasts/{broadcastId}/send'.sub('{' + 'broadcastId' + '}', CGI.escape(broadcast_id.to_s))

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

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

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

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

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

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

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

#send_whats_app_bulk(send_whats_app_bulk_request, opts = {}) ⇒ SendWhatsAppBulk200Response

Bulk send template messages Deprecated. Use ‘POST /v1/broadcasts` to create a broadcast, `POST /v1/broadcasts/id/recipients` to add recipients, then `POST /v1/broadcasts/id/send` to send. Send a template message to multiple recipients in a single request. Maximum 100 recipients per request. Only template messages are supported for bulk sending (not free-form text). Each recipient can have optional per-recipient template variables for personalization. Returns detailed results for each recipient.

Parameters:

Returns:



2552
2553
2554
2555
# File 'lib/late-sdk/api/whats_app_api.rb', line 2552

def send_whats_app_bulk(send_whats_app_bulk_request, opts = {})
  data, _status_code, _headers = send_whats_app_bulk_with_http_info(send_whats_app_bulk_request, opts)
  data
end

#send_whats_app_bulk_with_http_info(send_whats_app_bulk_request, opts = {}) ⇒ Array<(SendWhatsAppBulk200Response, Integer, Hash)>

Bulk send template messages Deprecated. Use &#x60;POST /v1/broadcasts&#x60; to create a broadcast, &#x60;POST /v1/broadcasts/id/recipients&#x60; to add recipients, then &#x60;POST /v1/broadcasts/id/send&#x60; to send. Send a template message to multiple recipients in a single request. Maximum 100 recipients per request. Only template messages are supported for bulk sending (not free-form text). Each recipient can have optional per-recipient template variables for personalization. Returns detailed results for each recipient.

Parameters:

Returns:

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

    SendWhatsAppBulk200Response data, response status code and response headers



2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
# File 'lib/late-sdk/api/whats_app_api.rb', line 2562

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

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

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

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

  new_options = opts.merge(
    :operation => :"WhatsAppApi.send_whats_app_bulk",
    :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_bulk\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:



2620
2621
2622
2623
# File 'lib/late-sdk/api/whats_app_api.rb', line 2620

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



2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
# File 'lib/late-sdk/api/whats_app_api.rb', line 2630

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_contact(contact_id, update_whats_app_contact_request, opts = {}) ⇒ UpdateWhatsAppContact200Response

Update contact Deprecated. Use ‘PATCH /v1/contacts/id` instead. Update an existing WhatsApp contact. All fields are optional; only provided fields will be updated. Custom fields are merged with existing values. Set a custom field to null to remove it.

Parameters:

  • contact_id (String)

    Contact ID

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

    the optional parameters

Returns:



2689
2690
2691
2692
# File 'lib/late-sdk/api/whats_app_api.rb', line 2689

def update_whats_app_contact(contact_id, update_whats_app_contact_request, opts = {})
  data, _status_code, _headers = update_whats_app_contact_with_http_info(contact_id, update_whats_app_contact_request, opts)
  data
end

#update_whats_app_contact_with_http_info(contact_id, update_whats_app_contact_request, opts = {}) ⇒ Array<(UpdateWhatsAppContact200Response, Integer, Hash)>

Update contact Deprecated. Use &#x60;PATCH /v1/contacts/id&#x60; instead. Update an existing WhatsApp contact. All fields are optional; only provided fields will be updated. Custom fields are merged with existing values. Set a custom field to null to remove it.

Parameters:

  • contact_id (String)

    Contact ID

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

    the optional parameters

Returns:



2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
# File 'lib/late-sdk/api/whats_app_api.rb', line 2700

def update_whats_app_contact_with_http_info(contact_id, update_whats_app_contact_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppApi.update_whats_app_contact ...'
  end
  # verify the required parameter 'contact_id' is set
  if @api_client.config.client_side_validation && contact_id.nil?
    fail ArgumentError, "Missing the required parameter 'contact_id' when calling WhatsAppApi.update_whats_app_contact"
  end
  # verify the required parameter 'update_whats_app_contact_request' is set
  if @api_client.config.client_side_validation && update_whats_app_contact_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_whats_app_contact_request' when calling WhatsAppApi.update_whats_app_contact"
  end
  # resource path
  local_var_path = '/v1/whatsapp/contacts/{contactId}'.sub('{' + 'contactId' + '}', CGI.escape(contact_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

  new_options = opts.merge(
    :operation => :"WhatsAppApi.update_whats_app_contact",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WhatsAppApi#update_whats_app_contact\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:



2762
2763
2764
2765
# File 'lib/late-sdk/api/whats_app_api.rb', line 2762

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:



2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
# File 'lib/late-sdk/api/whats_app_api.rb', line 2772

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.

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:



2832
2833
2834
2835
# File 'lib/late-sdk/api/whats_app_api.rb', line 2832

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.

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



2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
# File 'lib/late-sdk/api/whats_app_api.rb', line 2844

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:



2912
2913
2914
2915
# File 'lib/late-sdk/api/whats_app_api.rb', line 2912

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&#39;s components. Only certain fields can be updated depending on the template&#39;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:



2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
# File 'lib/late-sdk/api/whats_app_api.rb', line 2923

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.

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:



2986
2987
2988
2989
# File 'lib/late-sdk/api/whats_app_api.rb', line 2986

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&#39;s resumable upload API under the hood: creates an upload session, uploads the image bytes, then updates the business profile with the resulting handle.

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



2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
# File 'lib/late-sdk/api/whats_app_api.rb', line 2997

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'])
  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