Class: Zernio::WhatsAppPhoneNumbersApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WhatsAppPhoneNumbersApi

Returns a new instance of WhatsAppPhoneNumbersApi.



19
20
21
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#check_whats_app_number_availability(country, opts = {}) ⇒ CheckPhoneNumberAvailability200Response

Check country availability Deprecated alias of /v1/phone-numbers/availability; same contract. New integrations should use that path. Pre-purchase check, so you can warn BEFORE a customer invests in KYC (regulated review is async, 1-3 days). Tells you whether we have deliverable inventory, and what address the customer needs: - addressConstraint: geo → the registered address MUST be in one of the returned areas (the only place we have stock). A different-area address passes pre-approval but the number can never be assigned. - addressConstraint: country → any in-country address works. - addressConstraint: none → field-only / instant country, no address. Call this before starting the KYC form for regulated countries.

Parameters:

  • country (String)

    ISO-2 country code.

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

    the optional parameters

Options Hash (opts):

  • :number_type (String)

    Check a specific offered type (stock and address constraints are per type). Omitted = the country's default type.

Returns:



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

def check_whats_app_number_availability(country, opts = {})
  data, _status_code, _headers = check_whats_app_number_availability_with_http_info(country, opts)
  data
end

#check_whats_app_number_availability_with_http_info(country, opts = {}) ⇒ Array<(CheckPhoneNumberAvailability200Response, Integer, Hash)>

Check country availability Deprecated alias of `/v1/phone-numbers/availability`; same contract. New integrations should use that path. Pre-purchase check, so you can warn BEFORE a customer invests in KYC (regulated review is async, 1-3 days). Tells you whether we have deliverable inventory, and what address the customer needs: - `addressConstraint: geo` → the registered address MUST be in one of the returned `areas` (the only place we have stock). A different-area address passes pre-approval but the number can never be assigned. - `addressConstraint: country` → any in-country address works. - `addressConstraint: none` → field-only / instant country, no address. Call this before starting the KYC form for regulated countries.

Parameters:

  • country (String)

    ISO-2 country code.

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

    the optional parameters

Options Hash (opts):

  • :number_type (String)

    Check a specific offered type (stock and address constraints are per type). Omitted = the country's default type.

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

def check_whats_app_number_availability_with_http_info(country, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.check_whats_app_number_availability ...'
  end
  # verify the required parameter 'country' is set
  if @api_client.config.client_side_validation && country.nil?
    fail ArgumentError, "Missing the required parameter 'country' when calling WhatsAppPhoneNumbersApi.check_whats_app_number_availability"
  end
  allowable_values = ["local", "mobile", "national", "toll_free"]
  if @api_client.config.client_side_validation && opts[:'number_type'] && !allowable_values.include?(opts[:'number_type'])
    fail ArgumentError, "invalid value for \"number_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/availability'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'country'] = country
  query_params[:'numberType'] = opts[:'number_type'] if !opts[:'number_type'].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] || 'CheckPhoneNumberAvailability200Response'

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

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

Create a hosted KYC link Deprecated alias of /v1/phone-numbers/kyc/share; same contract. New integrations should use that path. Create a single-use, 7-day hosted KYC link that your end customer completes WITHOUT a Zernio login — useful when the person who holds the ID and address is not your team. They fill the regulated verification on a Zernio-hosted page; the number provisions under YOUR account once they submit. Only regulated (KYC) countries are valid: a country that does not require KYC returns 400. White-label the page with branding (your company name, logo, brand color). Supply redirect_url to send the end customer back to your own site after a successful submit (completion params are appended — see below). Listen for the whatsapp.number.kyc_submitted webhook to react when the form is completed.

Parameters:

Returns:



98
99
100
101
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 98

def create_whats_app_number_kyc_link(create_phone_number_kyc_link_request, opts = {})
  data, _status_code, _headers = create_whats_app_number_kyc_link_with_http_info(create_phone_number_kyc_link_request, opts)
  data
end

Create a hosted KYC link Deprecated alias of `/v1/phone-numbers/kyc/share`; same contract. New integrations should use that path. Create a single-use, 7-day hosted KYC link that your end customer completes WITHOUT a Zernio login — useful when the person who holds the ID and address is not your team. They fill the regulated verification on a Zernio-hosted page; the number provisions under YOUR account once they submit. Only regulated (KYC) countries are valid: a country that does not require KYC returns 400. White-label the page with `branding` (your company name, logo, brand color). Supply `redirect_url` to send the end customer back to your own site after a successful submit (completion params are appended — see below). Listen for the `whatsapp.number.kyc_submitted` webhook to react when the form is completed.

Parameters:

Returns:



108
109
110
111
112
113
114
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
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 108

def create_whats_app_number_kyc_link_with_http_info(create_phone_number_kyc_link_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.create_whats_app_number_kyc_link ...'
  end
  # verify the required parameter 'create_phone_number_kyc_link_request' is set
  if @api_client.config.client_side_validation && create_phone_number_kyc_link_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_phone_number_kyc_link_request' when calling WhatsAppPhoneNumbersApi.create_whats_app_number_kyc_link"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/kyc/share'

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

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

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

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

#get_whats_app_number_info(account_id, opts = {}) ⇒ GetWhatsAppNumberInfo200Response

Get number status Live snapshot of a connected number straight from Meta: the phone-number node (display number, display name + approval, quality rating, messaging-limit tier, throughput, official-business badge, connection status, health_status) and its owning WhatsApp Business Account (name, business verification, timezone, health_status). Fetched live because Meta updates quality/tier/name/health over time; the call also refreshes the cached values shown on the connection card.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



166
167
168
169
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 166

def get_whats_app_number_info(, opts = {})
  data, _status_code, _headers = get_whats_app_number_info_with_http_info(, opts)
  data
end

#get_whats_app_number_info_with_http_info(account_id, opts = {}) ⇒ Array<(GetWhatsAppNumberInfo200Response, Integer, Hash)>

Get number status Live snapshot of a connected number straight from Meta: the phone-number node (display number, display name + approval, quality rating, messaging-limit tier, throughput, official-business badge, connection status, health_status) and its owning WhatsApp Business Account (name, business verification, timezone, health_status). Fetched live because Meta updates quality/tier/name/health over time; the call also refreshes the cached values shown on the connection card.

Parameters:

  • account_id (String)

    WhatsApp social account ID

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

    the optional parameters

Returns:



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 176

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

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

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

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

#get_whats_app_number_kyc_form(country, profile_id, opts = {}) ⇒ GetWhatsAppNumberKycForm200Response

Get KYC form spec Deprecated alias of /v1/phone-numbers/kyc; same contract. New integrations should use that path. For a Tier 3/4 country, the fields the end customer must provide (Telnyx regulatory requirements) before a number can be ordered: text, date, address, or file (document) per requirement.

Parameters:

  • country (String)
  • profile_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



231
232
233
234
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 231

def get_whats_app_number_kyc_form(country, profile_id, opts = {})
  data, _status_code, _headers = get_whats_app_number_kyc_form_with_http_info(country, profile_id, opts)
  data
end

#get_whats_app_number_kyc_form_with_http_info(country, profile_id, opts = {}) ⇒ Array<(GetWhatsAppNumberKycForm200Response, Integer, Hash)>

Get KYC form spec Deprecated alias of `/v1/phone-numbers/kyc`; same contract. New integrations should use that path. For a Tier 3/4 country, the fields the end customer must provide (Telnyx regulatory requirements) before a number can be ordered: text, date, address, or file (document) per requirement.

Parameters:

  • country (String)
  • profile_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 242

def get_whats_app_number_kyc_form_with_http_info(country, profile_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.get_whats_app_number_kyc_form ...'
  end
  # verify the required parameter 'country' is set
  if @api_client.config.client_side_validation && country.nil?
    fail ArgumentError, "Missing the required parameter 'country' when calling WhatsAppPhoneNumbersApi.get_whats_app_number_kyc_form"
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling WhatsAppPhoneNumbersApi.get_whats_app_number_kyc_form"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/kyc'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'country'] = country
  query_params[:'profileId'] = profile_id

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

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

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

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

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

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

#get_whats_app_number_remediation(id, opts = {}) ⇒ GetWhatsAppNumberRemediation200Response

Get declined requirements Deprecated alias of /v1/phone-numbers/{id}/remediate; same contract. New integrations should use that path. For a number in regulatory_declined, returns ONLY the requirements the reviewer flagged declined, as a form spec (same shape as the KYC form GET). The customer fixes just those — Telnyx supports correcting a declined requirement group and re-submitting it (no new number/group). Falls back to the full spec if the provider exposes no per-requirement flags.

Parameters:

  • id (String)

    WhatsAppPhoneNumber id.

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

    the optional parameters

Returns:



301
302
303
304
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 301

def get_whats_app_number_remediation(id, opts = {})
  data, _status_code, _headers = get_whats_app_number_remediation_with_http_info(id, opts)
  data
end

#get_whats_app_number_remediation_with_http_info(id, opts = {}) ⇒ Array<(GetWhatsAppNumberRemediation200Response, Integer, Hash)>

Get declined requirements Deprecated alias of `/v1/phone-numbers/id/remediate`; same contract. New integrations should use that path. For a number in `regulatory_declined`, returns ONLY the requirements the reviewer flagged declined, as a form spec (same shape as the KYC form GET). The customer fixes just those — Telnyx supports correcting a declined requirement group and re-submitting it (no new number/group). Falls back to the full spec if the provider exposes no per-requirement flags.

Parameters:

  • id (String)

    WhatsAppPhoneNumber id.

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

    the optional parameters

Returns:



311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 311

def get_whats_app_number_remediation_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.get_whats_app_number_remediation ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WhatsAppPhoneNumbersApi.get_whats_app_number_remediation"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/{id}/remediate'.sub('{' + 'id' + '}', CGI.escape(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] || 'GetWhatsAppNumberRemediation200Response'

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

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

#get_whats_app_phone_number(phone_number_id, opts = {}) ⇒ GetPhoneNumber200Response

Get phone number Deprecated alias of /v1/phone-numbers/{id}; same contract. New integrations should use that path. Retrieve the current status of a purchased phone number. Poll this to track Meta pre-verification (US sync path) and, for regulated (Tier 3/4) numbers, the async lifecycle: pending_regulatory → active (or regulatory_declined). When a regulated number has an Onfido ID step, onfidoVerificationUrl appears here once the order is placed — forward it to the end user. (Or subscribe to the whatsapp.number.* webhooks instead of polling.)

Parameters:

  • phone_number_id (String)

    Phone number record ID

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

    the optional parameters

Returns:



364
365
366
367
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 364

def get_whats_app_phone_number(phone_number_id, opts = {})
  data, _status_code, _headers = get_whats_app_phone_number_with_http_info(phone_number_id, opts)
  data
end

#get_whats_app_phone_number_with_http_info(phone_number_id, opts = {}) ⇒ Array<(GetPhoneNumber200Response, Integer, Hash)>

Get phone number Deprecated alias of `/v1/phone-numbers/id`; same contract. New integrations should use that path. Retrieve the current status of a purchased phone number. Poll this to track Meta pre-verification (US sync path) and, for regulated (Tier 3/4) numbers, the async lifecycle: pending_regulatory → active (or regulatory_declined). When a regulated number has an Onfido ID step, `onfidoVerificationUrl` appears here once the order is placed — forward it to the end user. (Or subscribe to the whatsapp.number.* webhooks instead of polling.)

Parameters:

  • phone_number_id (String)

    Phone number record ID

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

    the optional parameters

Returns:

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

    GetPhoneNumber200Response data, response status code and response headers



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

def get_whats_app_phone_number_with_http_info(phone_number_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.get_whats_app_phone_number ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling WhatsAppPhoneNumbersApi.get_whats_app_phone_number"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/{phoneNumberId}'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_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] || 'GetPhoneNumber200Response'

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

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

#get_whats_app_phone_numbers(opts = {}) ⇒ ListPhoneNumbers200Response

List phone numbers Deprecated alias of /v1/phone-numbers; same contract. New integrations should use that path. List all WhatsApp phone numbers purchased by the authenticated user. By default, released numbers are excluded. Connected (bring-your-own) numbers are returned in the separate connected array — they are not billed and have no provisioning lifecycle.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by status (by default excludes released numbers). NOTE: `status=pending_regulatory` returns the &quot;provisioning&quot; view — numbers still in review PLUS recently-declined (last 30 days) ones, so a failed registration surfaces (with `regulatoryDeclineReason`) instead of silently disappearing. Declined numbers can be re-submitted via POST /v1/whatsapp/phone-numbers/id/remediate. `verifying` is the short-lived state after the number is provisioned on our side while WhatsApp confirms the activation code; the number is not billed until it reaches `active`.

  • :profile_id (String)

    Filter by profile

Returns:



428
429
430
431
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 428

def get_whats_app_phone_numbers(opts = {})
  data, _status_code, _headers = get_whats_app_phone_numbers_with_http_info(opts)
  data
end

#get_whats_app_phone_numbers_with_http_info(opts = {}) ⇒ Array<(ListPhoneNumbers200Response, Integer, Hash)>

List phone numbers Deprecated alias of `/v1/phone-numbers`; same contract. New integrations should use that path. List all WhatsApp phone numbers purchased by the authenticated user. By default, released numbers are excluded. Connected (bring-your-own) numbers are returned in the separate `connected` array — they are not billed and have no provisioning lifecycle.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by status (by default excludes released numbers). NOTE: `status=pending_regulatory` returns the &quot;provisioning&quot; view — numbers still in review PLUS recently-declined (last 30 days) ones, so a failed registration surfaces (with `regulatoryDeclineReason`) instead of silently disappearing. Declined numbers can be re-submitted via POST /v1/whatsapp/phone-numbers/id/remediate. `verifying` is the short-lived state after the number is provisioned on our side while WhatsApp confirms the activation code; the number is not billed until it reaches `active`.

  • :profile_id (String)

    Filter by profile

Returns:

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

    ListPhoneNumbers200Response data, response status code and response headers



439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 439

def get_whats_app_phone_numbers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.get_whats_app_phone_numbers ...'
  end
  allowable_values = ["provisioning", "verifying", "pending_payment", "pending_regulatory", "regulatory_declined", "active", "suspended", "releasing", "released"]
  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/phone-numbers'

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

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

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

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

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

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

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

#list_whats_app_number_countries(opts = {}) ⇒ ListWhatsAppNumberCountries200Response

List offerable number countries Deprecated alias of /v1/phone-numbers/countries; same contract. New integrations should use that path. The WhatsApp number countries available to purchase, each with its flat monthly price (cents), regulatory tier, whether it needs end-user KYC (Tier 3/4), and whether outbound calling is available (not BIC-blocked). Drives the country picker. Tier-4 countries appear only when enabled.

Parameters:

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

    the optional parameters

Returns:



493
494
495
496
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 493

def list_whats_app_number_countries(opts = {})
  data, _status_code, _headers = list_whats_app_number_countries_with_http_info(opts)
  data
end

#list_whats_app_number_countries_with_http_info(opts = {}) ⇒ Array<(ListWhatsAppNumberCountries200Response, Integer, Hash)>

List offerable number countries Deprecated alias of `/v1/phone-numbers/countries`; same contract. New integrations should use that path. The WhatsApp number countries available to purchase, each with its flat monthly price (cents), regulatory tier, whether it needs end-user KYC (Tier 3/4), and whether outbound calling is available (not BIC-blocked). Drives the country picker. Tier-4 countries appear only when enabled.

Parameters:

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

    the optional parameters

Returns:



502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 502

def list_whats_app_number_countries_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.list_whats_app_number_countries ...'
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/countries'

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

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

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

#purchase_whats_app_phone_number(purchase_whats_app_phone_number_request, opts = {}) ⇒ PurchasePhoneNumber200Response

Purchase phone number Deprecated alias of /v1/phone-numbers/purchase; same contract. New integrations should use that path. Payment-first: you do not pick a specific number, the system provisions one and auto-assigns it. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns 402 PAYMENT_REQUIRED; a regulated country returns 202 with status: \"kyc_required\" and a kycUrl. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.

Parameters:

Returns:



551
552
553
554
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 551

def purchase_whats_app_phone_number(purchase_whats_app_phone_number_request, opts = {})
  data, _status_code, _headers = purchase_whats_app_phone_number_with_http_info(purchase_whats_app_phone_number_request, opts)
  data
end

#purchase_whats_app_phone_number_with_http_info(purchase_whats_app_phone_number_request, opts = {}) ⇒ Array<(PurchasePhoneNumber200Response, Integer, Hash)>

Purchase phone number Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New integrations should use that path. Payment-first: you do not pick a specific number, the system provisions one and auto-assigns it. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: &quot;kyc_required&quot;` and a `kycUrl`. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.

Parameters:

Returns:



561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 561

def purchase_whats_app_phone_number_with_http_info(purchase_whats_app_phone_number_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.purchase_whats_app_phone_number ...'
  end
  # verify the required parameter 'purchase_whats_app_phone_number_request' is set
  if @api_client.config.client_side_validation && purchase_whats_app_phone_number_request.nil?
    fail ArgumentError, "Missing the required parameter 'purchase_whats_app_phone_number_request' when calling WhatsAppPhoneNumbersApi.purchase_whats_app_phone_number"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/purchase'

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

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

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

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

#release_whats_app_phone_number(phone_number_id, opts = {}) ⇒ ReleasePhoneNumber200Response

Release phone number Deprecated alias of /v1/phone-numbers/{id}; same contract. New integrations should use that path. Release a purchased phone number. This will: 1. Disconnect any linked WhatsApp social account 2. Decrement the Stripe subscription quantity (or cancel if last number) 3. Release the number from Telnyx 4. Mark the number as released

Parameters:

  • phone_number_id (String)

    Phone number record ID

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

    the optional parameters

Returns:



619
620
621
622
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 619

def release_whats_app_phone_number(phone_number_id, opts = {})
  data, _status_code, _headers = release_whats_app_phone_number_with_http_info(phone_number_id, opts)
  data
end

#release_whats_app_phone_number_with_http_info(phone_number_id, opts = {}) ⇒ Array<(ReleasePhoneNumber200Response, Integer, Hash)>

Release phone number Deprecated alias of `/v1/phone-numbers/id`; same contract. New integrations should use that path. Release a purchased phone number. This will: 1. Disconnect any linked WhatsApp social account 2. Decrement the Stripe subscription quantity (or cancel if last number) 3. Release the number from Telnyx 4. Mark the number as released

Parameters:

  • phone_number_id (String)

    Phone number record ID

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

    the optional parameters

Returns:



629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 629

def release_whats_app_phone_number_with_http_info(phone_number_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.release_whats_app_phone_number ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling WhatsAppPhoneNumbersApi.release_whats_app_phone_number"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/{phoneNumberId}'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_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] || 'ReleasePhoneNumber200Response'

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

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

#remediate_whats_app_number(id, remediate_phone_number_request, opts = {}) ⇒ RemediatePhoneNumber200Response

Resubmit a declined number Deprecated alias of /v1/phone-numbers/{id}/remediate; same contract. New integrations should use that path. Submit corrected values/documents for the declined requirement(s). We PATCH them onto the SAME requirement group and re-submit it for approval; the number goes regulatory_declinedpending_regulatory. No new number and no new billing. Body shape matches the KYC submit (values / documents / address) — send only the corrected fields.

Parameters:

Returns:



683
684
685
686
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 683

def remediate_whats_app_number(id, remediate_phone_number_request, opts = {})
  data, _status_code, _headers = remediate_whats_app_number_with_http_info(id, remediate_phone_number_request, opts)
  data
end

#remediate_whats_app_number_with_http_info(id, remediate_phone_number_request, opts = {}) ⇒ Array<(RemediatePhoneNumber200Response, Integer, Hash)>

Resubmit a declined number Deprecated alias of `/v1/phone-numbers/id/remediate`; same contract. New integrations should use that path. Submit corrected values/documents for the declined requirement(s). We PATCH them onto the SAME requirement group and re-submit it for approval; the number goes `regulatory_declined` → `pending_regulatory`. No new number and no new billing. Body shape matches the KYC submit (values / documents / address) — send only the corrected fields.

Parameters:

Returns:



694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 694

def remediate_whats_app_number_with_http_info(id, remediate_phone_number_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.remediate_whats_app_number ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WhatsAppPhoneNumbersApi.remediate_whats_app_number"
  end
  # verify the required parameter 'remediate_phone_number_request' is set
  if @api_client.config.client_side_validation && remediate_phone_number_request.nil?
    fail ArgumentError, "Missing the required parameter 'remediate_phone_number_request' when calling WhatsAppPhoneNumbersApi.remediate_whats_app_number"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/{id}/remediate'.sub('{' + 'id' + '}', CGI.escape(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(remediate_phone_number_request)

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

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

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

#search_available_whats_app_numbers(opts = {}) ⇒ SearchAvailableWhatsAppNumbers200Response

Search available numbers Deprecated alias of /v1/phone-numbers/available; same contract. New integrations should use that path. Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/whatsapp/phone-numbers/countries).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :country (String) — default: default to 'US'
  • :type (String)

    Number type; defaults to the country's WhatsApp-safe type

  • :prefix (String)

    Area code

  • :locality (String)

    City

  • :contains (String)

    Pattern to match within the number

  • :limit (Integer) — default: default to 20

Returns:



761
762
763
764
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 761

def search_available_whats_app_numbers(opts = {})
  data, _status_code, _headers = search_available_whats_app_numbers_with_http_info(opts)
  data
end

#search_available_whats_app_numbers_with_http_info(opts = {}) ⇒ Array<(SearchAvailableWhatsAppNumbers200Response, Integer, Hash)>

Search available numbers Deprecated alias of `/v1/phone-numbers/available`; same contract. New integrations should use that path. Search the provider's inventory for numbers available to purchase in a country (default US). Optional filters narrow the results. The country must be offerable (see GET /v1/whatsapp/phone-numbers/countries).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :country (String) — default: default to 'US'
  • :type (String)

    Number type; defaults to the country's WhatsApp-safe type

  • :prefix (String)

    Area code

  • :locality (String)

    City

  • :contains (String)

    Pattern to match within the number

  • :limit (Integer) — default: default to 20

Returns:



776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 776

def search_available_whats_app_numbers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.search_available_whats_app_numbers ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WhatsAppPhoneNumbersApi.search_available_whats_app_numbers, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/available'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
  query_params[:'locality'] = opts[:'locality'] if !opts[:'locality'].nil?
  query_params[:'contains'] = opts[:'contains'] if !opts[:'contains'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

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

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

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

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

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

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

#submit_whats_app_number_kyc(submit_whats_app_number_kyc_request, opts = {}) ⇒ SubmitPhoneNumberKyc200Response

Submit KYC Deprecated alias of /v1/phone-numbers/kyc; same contract. New integrations should use that path. Submit the end customer's KYC (textual values, uploaded documents, address) for a Tier 3/4 country. Documents are streamed straight to the number provider and are not stored by Zernio. Builds + submits a regulatory requirement group and claims a pending_regulatory slot; the number is ordered + activated once the provider approves (asynchronous). A customer may hold several same-country numbers in review at once; a double-submit of the SAME attempt is deduped via submissionId. For an ID-card document requirement, carriers commonly require BOTH sides: combine the front and back into a single file before uploading (the dashboard does this automatically). A one-sided ID is a common decline reason; fix it via POST /v1/whatsapp/phone-numbers/id/remediate. Before submitting, call GET /v1/whatsapp/phone-numbers/availability to check the country has deliverable inventory and, for geographic-match countries, which area the address must be in — otherwise the submission can pass review yet never be assignable a number.

Parameters:

Returns:



835
836
837
838
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 835

def submit_whats_app_number_kyc(submit_whats_app_number_kyc_request, opts = {})
  data, _status_code, _headers = submit_whats_app_number_kyc_with_http_info(submit_whats_app_number_kyc_request, opts)
  data
end

#submit_whats_app_number_kyc_with_http_info(submit_whats_app_number_kyc_request, opts = {}) ⇒ Array<(SubmitPhoneNumberKyc200Response, Integer, Hash)>

Submit KYC Deprecated alias of `/v1/phone-numbers/kyc`; same contract. New integrations should use that path. Submit the end customer's KYC (textual values, uploaded documents, address) for a Tier 3/4 country. Documents are streamed straight to the number provider and are not stored by Zernio. Builds + submits a regulatory requirement group and claims a pending_regulatory slot; the number is ordered + activated once the provider approves (asynchronous). A customer may hold several same-country numbers in review at once; a double-submit of the SAME attempt is deduped via `submissionId`. For an ID-card document requirement, carriers commonly require BOTH sides: combine the front and back into a single file before uploading (the dashboard does this automatically). A one-sided ID is a common decline reason; fix it via POST /v1/whatsapp/phone-numbers/id/remediate. Before submitting, call GET /v1/whatsapp/phone-numbers/availability to check the country has deliverable inventory and, for geographic-match countries, which area the address must be in — otherwise the submission can pass review yet never be assignable a number.

Parameters:

Returns:



845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 845

def submit_whats_app_number_kyc_with_http_info(submit_whats_app_number_kyc_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.submit_whats_app_number_kyc ...'
  end
  # verify the required parameter 'submit_whats_app_number_kyc_request' is set
  if @api_client.config.client_side_validation && submit_whats_app_number_kyc_request.nil?
    fail ArgumentError, "Missing the required parameter 'submit_whats_app_number_kyc_request' when calling WhatsAppPhoneNumbersApi.submit_whats_app_number_kyc"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/kyc'

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

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

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

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

#upload_whats_app_number_kyc_document(x_filename, body, opts = {}) ⇒ UploadPhoneNumberKycDocument200Response

Upload a KYC document Deprecated alias of /v1/phone-numbers/kyc/upload-document; same contract. New integrations should use that path. Upload ONE document and get back its provider document id, to reference from POST /v1/whatsapp/phone-numbers/kyc via documents[].documentId. Send the RAW file bytes as the request body (not base64); put the filename in the X-Filename header. Uploading documents one-per-request keeps each request under the ~4.5MB body limit. The document streams straight to the number provider and is not stored by Zernio.

Parameters:

  • x_filename (String)

    URL-encoded original filename.

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

    the optional parameters

Returns:



904
905
906
907
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 904

def upload_whats_app_number_kyc_document(x_filename, body, opts = {})
  data, _status_code, _headers = upload_whats_app_number_kyc_document_with_http_info(x_filename, body, opts)
  data
end

#upload_whats_app_number_kyc_document_with_http_info(x_filename, body, opts = {}) ⇒ Array<(UploadPhoneNumberKycDocument200Response, Integer, Hash)>

Upload a KYC document Deprecated alias of `/v1/phone-numbers/kyc/upload-document`; same contract. New integrations should use that path. Upload ONE document and get back its provider document id, to reference from POST /v1/whatsapp/phone-numbers/kyc via `documents.documentId`. Send the RAW file bytes as the request body (not base64); put the filename in the `X-Filename` header. Uploading documents one-per-request keeps each request under the ~4.5MB body limit. The document streams straight to the number provider and is not stored by Zernio.

Parameters:

  • x_filename (String)

    URL-encoded original filename.

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

    the optional parameters

Returns:



915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
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
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 915

def upload_whats_app_number_kyc_document_with_http_info(x_filename, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.upload_whats_app_number_kyc_document ...'
  end
  # verify the required parameter 'x_filename' is set
  if @api_client.config.client_side_validation && x_filename.nil?
    fail ArgumentError, "Missing the required parameter 'x_filename' when calling WhatsAppPhoneNumbersApi.upload_whats_app_number_kyc_document"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling WhatsAppPhoneNumbersApi.upload_whats_app_number_kyc_document"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/kyc/upload-document'

  # 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/octet-stream'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Filename'] = x_filename

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

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

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

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

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

#validate_whats_app_number_kyc_address(validate_phone_number_kyc_address_request, opts = {}) ⇒ ValidatePhoneNumberKycAddress200Response

Pre-validate KYC address Deprecated alias of /v1/phone-numbers/kyc/validate-address; same contract. New integrations should use that path. Optional early check for the address step of a Tier 4 (end-user identity) registration: validates a postal address for deliverability BEFORE the full KYC submit, so it can be corrected before any documents are uploaded. The full submit (POST /v1/whatsapp/phone-numbers/kyc) re-validates the address, so this call is purely a fast feedback path and skipping it is safe. Only the postal address is sent (no documents, no gov-ID fields). A region (administrative_area) is required by the validator; when it is omitted the pre-check is skipped and { ok: true, skipped: true } is returned (the final submit still validates).

Parameters:

Returns:



978
979
980
981
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 978

def validate_whats_app_number_kyc_address(validate_phone_number_kyc_address_request, opts = {})
  data, _status_code, _headers = validate_whats_app_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts)
  data
end

#validate_whats_app_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts = {}) ⇒ Array<(ValidatePhoneNumberKycAddress200Response, Integer, Hash)>

Pre-validate KYC address Deprecated alias of `/v1/phone-numbers/kyc/validate-address`; same contract. New integrations should use that path. Optional early check for the address step of a Tier 4 (end-user identity) registration: validates a postal address for deliverability BEFORE the full KYC submit, so it can be corrected before any documents are uploaded. The full submit (POST /v1/whatsapp/phone-numbers/kyc) re-validates the address, so this call is purely a fast feedback path and skipping it is safe. Only the postal address is sent (no documents, no gov-ID fields). A region (`administrative_area`) is required by the validator; when it is omitted the pre-check is skipped and `{ ok: true, skipped: true }` is returned (the final submit still validates).

Parameters:

Returns:



988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
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
# File 'lib/zernio-sdk/api/whats_app_phone_numbers_api.rb', line 988

def validate_whats_app_number_kyc_address_with_http_info(validate_phone_number_kyc_address_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WhatsAppPhoneNumbersApi.validate_whats_app_number_kyc_address ...'
  end
  # verify the required parameter 'validate_phone_number_kyc_address_request' is set
  if @api_client.config.client_side_validation && validate_phone_number_kyc_address_request.nil?
    fail ArgumentError, "Missing the required parameter 'validate_phone_number_kyc_address_request' when calling WhatsAppPhoneNumbersApi.validate_whats_app_number_kyc_address"
  end
  # resource path
  local_var_path = '/v1/whatsapp/phone-numbers/kyc/validate-address'

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

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

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

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