Class: Zernio::SMSApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SMSApi

Returns a new instance of SMSApi.



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

def api_client
  @api_client
end

Instance Method Details

#appeal_sms_registration(id, appeal_sms_registration_request, opts = {}) ⇒ AppealSmsRegistration200Response

Appeal a rejected campaign Appeals a rejected 10DLC campaign with the carrier registry. Only a registration that reached campaign creation can be appealed; a brand-level rejection should be fixed and re-verified instead. On success the registration returns to pending. Content rejections (e.g. an opt-in flow without a verifiable form link, or unrealistic samples) should be FIXED in the same call: pass the corrected messageFlow / sample1 / sample2 and the campaign is updated before the appeal is filed, so the reviewer sees the new content. The current content is on GET /v1/sms/registrations/{id} (campaignContent).

Parameters:

Returns:



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

def appeal_sms_registration(id, appeal_sms_registration_request, opts = {})
  data, _status_code, _headers = appeal_sms_registration_with_http_info(id, appeal_sms_registration_request, opts)
  data
end

#appeal_sms_registration_with_http_info(id, appeal_sms_registration_request, opts = {}) ⇒ Array<(AppealSmsRegistration200Response, Integer, Hash)>

Appeal a rejected campaign Appeals a rejected 10DLC campaign with the carrier registry. Only a registration that reached campaign creation can be appealed; a brand-level rejection should be fixed and re-verified instead. On success the registration returns to `pending`. Content rejections (e.g. an opt-in flow without a verifiable form link, or unrealistic samples) should be FIXED in the same call: pass the corrected `messageFlow` / `sample1` / `sample2` and the campaign is updated before the appeal is filed, so the reviewer sees the new content. The current content is on `GET /v1/sms/registrations/id` (`campaignContent`).

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/zernio-sdk/api/sms_api.rb', line 39

def appeal_sms_registration_with_http_info(id, appeal_sms_registration_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.appeal_sms_registration ...'
  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 SMSApi.appeal_sms_registration"
  end
  # verify the required parameter 'appeal_sms_registration_request' is set
  if @api_client.config.client_side_validation && appeal_sms_registration_request.nil?
    fail ArgumentError, "Missing the required parameter 'appeal_sms_registration_request' when calling SMSApi.appeal_sms_registration"
  end
  # resource path
  local_var_path = '/v1/sms/registrations/{id}/appeal'.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(appeal_sms_registration_request)

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

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

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

#deactivate_sms_registration(id, opts = {}) ⇒ DeactivateSmsRegistration200Response

Deactivate a brand/campaign registration Terminates the campaign with the carrier registry so the recurring monthly campaign fee stops (carriers bill the first 3 months of a campaign regardless). Numbers covered by it can no longer SEND texts — receiving is unaffected — until they're registered under a new brand. Irreversible: a deactivated campaign cannot be restored; texting again later requires a new registration (new one-time and review fees). Idempotent.

Parameters:

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

    the optional parameters

Returns:



101
102
103
104
# File 'lib/zernio-sdk/api/sms_api.rb', line 101

def deactivate_sms_registration(id, opts = {})
  data, _status_code, _headers = deactivate_sms_registration_with_http_info(id, opts)
  data
end

#deactivate_sms_registration_with_http_info(id, opts = {}) ⇒ Array<(DeactivateSmsRegistration200Response, Integer, Hash)>

Deactivate a brand/campaign registration Terminates the campaign with the carrier registry so the recurring monthly campaign fee stops (carriers bill the first 3 months of a campaign regardless). Numbers covered by it can no longer SEND texts — receiving is unaffected — until they're registered under a new brand. Irreversible: a deactivated campaign cannot be restored; texting again later requires a new registration (new one-time and review fees). Idempotent.

Parameters:

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

    the optional parameters

Returns:



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

def deactivate_sms_registration_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.deactivate_sms_registration ...'
  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 SMSApi.deactivate_sms_registration"
  end
  # resource path
  local_var_path = '/v1/sms/registrations/{id}'.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] || 'DeactivateSmsRegistration200Response'

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

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

#disable_sms_on_number(id, opts = {}) ⇒ DisableSmsOnNumber200Response

Disable SMS on a number Turns off SMS for the number (deactivates its SMS account). The carrier registration is untouched, so re-enabling later just reactivates it, with no re-registration.

Parameters:

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

    the optional parameters

Returns:



164
165
166
167
# File 'lib/zernio-sdk/api/sms_api.rb', line 164

def disable_sms_on_number(id, opts = {})
  data, _status_code, _headers = disable_sms_on_number_with_http_info(id, opts)
  data
end

#disable_sms_on_number_with_http_info(id, opts = {}) ⇒ Array<(DisableSmsOnNumber200Response, Integer, Hash)>

Disable SMS on a number Turns off SMS for the number (deactivates its SMS account). The carrier registration is untouched, so re-enabling later just reactivates it, with no re-registration.

Parameters:

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

    the optional parameters

Returns:



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

def disable_sms_on_number_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.disable_sms_on_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 SMSApi.disable_sms_on_number"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/sms'.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] || 'DisableSmsOnNumber200Response'

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

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

#enable_sms_on_number(id, opts = {}) ⇒ EnableSmsOnNumber200Response

Enable SMS on a number Turns on SMS for one of your numbers. The number's real carrier capability is checked first: some number types can't do SMS at all (smsCapable: false), and a number still provisioning at the carrier returns notReady: true (try again once provisioning finishes). US numbers additionally need a carrier registration before messages deliver; the response tells you which path applies: - alreadyRegistered: true: a prior registration still covers this number; SMS was simply reactivated. - reusable set: you have an approved registration this number can join in one click via POST /v1/phone-numbers/{id}/sms/reuse-registration (no new brand/campaign, no extra carrier fee). - needsRegistration: true and no reusable: start one via POST /v1/sms/registrations. Idempotent: re-running re-attempts any carrier-side setup that failed.

Parameters:

  • id (String)

    Phone number record ID (from GET /v1/phone-numbers).

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

    the optional parameters

Returns:



227
228
229
230
# File 'lib/zernio-sdk/api/sms_api.rb', line 227

def enable_sms_on_number(id, opts = {})
  data, _status_code, _headers = enable_sms_on_number_with_http_info(id, opts)
  data
end

#enable_sms_on_number_with_http_info(id, opts = {}) ⇒ Array<(EnableSmsOnNumber200Response, Integer, Hash)>

Enable SMS on a number Turns on SMS for one of your numbers. The number's real carrier capability is checked first: some number types can't do SMS at all (`smsCapable: false`), and a number still provisioning at the carrier returns `notReady: true` (try again once provisioning finishes). US numbers additionally need a carrier registration before messages deliver; the response tells you which path applies: - `alreadyRegistered: true`: a prior registration still covers this number; SMS was simply reactivated. - `reusable` set: you have an approved registration this number can join in one click via `POST /v1/phone-numbers/id/sms/reuse-registration` (no new brand/campaign, no extra carrier fee). - `needsRegistration: true` and no `reusable`: start one via `POST /v1/sms/registrations`. Idempotent: re-running re-attempts any carrier-side setup that failed.

Parameters:

  • id (String)

    Phone number record ID (from GET /v1/phone-numbers).

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

    the optional parameters

Returns:



237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/zernio-sdk/api/sms_api.rb', line 237

def enable_sms_on_number_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.enable_sms_on_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 SMSApi.enable_sms_on_number"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/sms'.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] || 'EnableSmsOnNumber200Response'

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

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

#get_sms_registration(id, opts = {}) ⇒ GetSmsRegistration200Response

Get a carrier registration Poll this for approval progress after starting a registration.

Parameters:

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

    the optional parameters

Returns:



290
291
292
293
# File 'lib/zernio-sdk/api/sms_api.rb', line 290

def get_sms_registration(id, opts = {})
  data, _status_code, _headers = get_sms_registration_with_http_info(id, opts)
  data
end

#get_sms_registration_with_http_info(id, opts = {}) ⇒ Array<(GetSmsRegistration200Response, Integer, Hash)>

Get a carrier registration Poll this for approval progress after starting a registration.

Parameters:

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

    the optional parameters

Returns:



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

def get_sms_registration_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.get_sms_registration ...'
  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 SMSApi.get_sms_registration"
  end
  # resource path
  local_var_path = '/v1/sms/registrations/{id}'.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] || 'GetSmsRegistration200Response'

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

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

#list_sms_opt_outs(opts = {}) ⇒ ListSmsOptOuts200Response

List SMS opt-outs The recipients who opted out of SMS (replied STOP) across your numbers, most recent first. Compliance surface: you must be able to see and export your opt-out list. Read-only: a recipient is re-subscribed only by replying START. Pass format=csv to download a CSV instead of JSON.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :format (String) — default: default to 'json'
  • :limit (Integer) — default: default to 500

Returns:



354
355
356
357
# File 'lib/zernio-sdk/api/sms_api.rb', line 354

def list_sms_opt_outs(opts = {})
  data, _status_code, _headers = list_sms_opt_outs_with_http_info(opts)
  data
end

#list_sms_opt_outs_with_http_info(opts = {}) ⇒ Array<(ListSmsOptOuts200Response, Integer, Hash)>

List SMS opt-outs The recipients who opted out of SMS (replied STOP) across your numbers, most recent first. Compliance surface: you must be able to see and export your opt-out list. Read-only: a recipient is re-subscribed only by replying START. Pass `format=csv` to download a CSV instead of JSON.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :format (String) — default: default to 'json'
  • :limit (Integer) — default: default to 500

Returns:

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

    ListSmsOptOuts200Response data, response status code and response headers



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
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/zernio-sdk/api/sms_api.rb', line 365

def list_sms_opt_outs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.list_sms_opt_outs ...'
  end
  allowable_values = ["json", "csv"]
  if @api_client.config.client_side_validation && opts[:'format'] && !allowable_values.include?(opts[:'format'])
    fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 5000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMSApi.list_sms_opt_outs, must be smaller than or equal to 5000.'
  end

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

  # resource path
  local_var_path = '/v1/sms/opt-outs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'format'] = opts[:'format'] if !opts[:'format'].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', 'text/csv']) 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] || 'ListSmsOptOuts200Response'

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

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

#list_sms_registrations(opts = {}) ⇒ ListSmsRegistrations200Response

List carrier registrations

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :include_deactivated (Boolean)

    Deactivated (terminated) registrations are hidden by default — pass true to include them.

Returns:



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

def list_sms_registrations(opts = {})
  data, _status_code, _headers = list_sms_registrations_with_http_info(opts)
  data
end

#list_sms_registrations_with_http_info(opts = {}) ⇒ Array<(ListSmsRegistrations200Response, Integer, Hash)>

List carrier registrations

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :include_deactivated (Boolean)

    Deactivated (terminated) registrations are hidden by default — pass true to include them.

Returns:



436
437
438
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
# File 'lib/zernio-sdk/api/sms_api.rb', line 436

def list_sms_registrations_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.list_sms_registrations ...'
  end
  # resource path
  local_var_path = '/v1/sms/registrations'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'includeDeactivated'] = opts[:'include_deactivated'] if !opts[:'include_deactivated'].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] || 'ListSmsRegistrations200Response'

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

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

#lookup_sms_number(number, opts = {}) ⇒ LookupSmsNumber200Response

Look up carrier + line type Carrier name and line type (mobile / landline / voip / toll-free) for a number, plus smsReachable (landlines can't receive SMS). Use it to validate recipients before sending. Each lookup is billed by the carrier-data provider, so call it explicitly (e.g. pre-validating an opt-in list), not on every send.

Parameters:

  • number (String)

    Number to look up (E.164; formatting is normalized).

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

    the optional parameters

Returns:



486
487
488
489
# File 'lib/zernio-sdk/api/sms_api.rb', line 486

def lookup_sms_number(number, opts = {})
  data, _status_code, _headers = lookup_sms_number_with_http_info(number, opts)
  data
end

#lookup_sms_number_with_http_info(number, opts = {}) ⇒ Array<(LookupSmsNumber200Response, Integer, Hash)>

Look up carrier + line type Carrier name and line type (mobile / landline / voip / toll-free) for a number, plus `smsReachable` (landlines can't receive SMS). Use it to validate recipients before sending. Each lookup is billed by the carrier-data provider, so call it explicitly (e.g. pre-validating an opt-in list), not on every send.

Parameters:

  • number (String)

    Number to look up (E.164; formatting is normalized).

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

    the optional parameters

Returns:

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

    LookupSmsNumber200Response data, response status code and response headers



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

def lookup_sms_number_with_http_info(number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.lookup_sms_number ...'
  end
  # verify the required parameter 'number' is set
  if @api_client.config.client_side_validation && number.nil?
    fail ArgumentError, "Missing the required parameter 'number' when calling SMSApi.lookup_sms_number"
  end
  if @api_client.config.client_side_validation && number.to_s.length < 8
    fail ArgumentError, 'invalid value for "number" when calling SMSApi.lookup_sms_number, the character length must be greater than or equal to 8.'
  end

  # resource path
  local_var_path = '/v1/sms/lookup'

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

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

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

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

#resend_sms_registration_otp(id, opts = {}) ⇒ ResendSmsRegistrationOtp200Response

Re-send the sole-prop OTP Re-sends the sole-proprietor verification PIN to the brand's mobile number — use it when the original code expired or never arrived. Only valid while the registration is pending and awaiting its OTP; rate limited to one send per minute.

Parameters:

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

    the optional parameters

Returns:



554
555
556
557
# File 'lib/zernio-sdk/api/sms_api.rb', line 554

def resend_sms_registration_otp(id, opts = {})
  data, _status_code, _headers = resend_sms_registration_otp_with_http_info(id, opts)
  data
end

#resend_sms_registration_otp_with_http_info(id, opts = {}) ⇒ Array<(ResendSmsRegistrationOtp200Response, Integer, Hash)>

Re-send the sole-prop OTP Re-sends the sole-proprietor verification PIN to the brand's mobile number — use it when the original code expired or never arrived. Only valid while the registration is pending and awaiting its OTP; rate limited to one send per minute.

Parameters:

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

    the optional parameters

Returns:



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

def resend_sms_registration_otp_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.resend_sms_registration_otp ...'
  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 SMSApi.resend_sms_registration_otp"
  end
  # resource path
  local_var_path = '/v1/sms/registrations/{id}/resend-otp'.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] || 'ResendSmsRegistrationOtp200Response'

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

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

#reuse_sms_registration_for_number(id, opts = {}) ⇒ ReuseSmsRegistrationForNumber200Response

Add number to SMS registration Attaches this number to your existing approved 10DLC campaign instead of running a fresh registration: the number inherits the campaign's approval (no new brand or campaign, no extra carrier fee). Enable SMS on the number first (POST /v1/phone-numbers/{id}/sms; its response tells you whether a reusable registration exists).

Parameters:

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

    the optional parameters

Returns:



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

def reuse_sms_registration_for_number(id, opts = {})
  data, _status_code, _headers = reuse_sms_registration_for_number_with_http_info(id, opts)
  data
end

#reuse_sms_registration_for_number_with_http_info(id, opts = {}) ⇒ Array<(ReuseSmsRegistrationForNumber200Response, Integer, Hash)>

Add number to SMS registration Attaches this number to your existing approved 10DLC campaign instead of running a fresh registration: the number inherits the campaign's approval (no new brand or campaign, no extra carrier fee). Enable SMS on the number first (`POST /v1/phone-numbers/id/sms`; its response tells you whether a reusable registration exists).

Parameters:

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

    the optional parameters

Returns:



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

def reuse_sms_registration_for_number_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.reuse_sms_registration_for_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 SMSApi.reuse_sms_registration_for_number"
  end
  # resource path
  local_var_path = '/v1/phone-numbers/{id}/sms/reuse-registration'.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] || 'ReuseSmsRegistrationForNumber200Response'

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

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

#send_sms(send_sms_request, opts = {}) ⇒ SendSms200Response

Send an SMS/MMS Sends an SMS (or MMS when mediaUrls is set) from one of your SMS-enabled numbers. At least one of text / mediaUrls is required. Both numbers are normalized to E.164, so from matches regardless of formatting and replies thread into the same inbox conversation. US numbers must have an approved carrier registration (/v1/sms/registrations) before messages deliver. Idempotency: send an Idempotency-Key header to make retries safe: same key + same body replays the original response instead of sending a second message; same key + different body returns 422; a key still in flight returns 409.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Optional client-generated unique key (e.g. a UUID) that makes send retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.

Returns:



681
682
683
684
# File 'lib/zernio-sdk/api/sms_api.rb', line 681

def send_sms(send_sms_request, opts = {})
  data, _status_code, _headers = send_sms_with_http_info(send_sms_request, opts)
  data
end

#send_sms_with_http_info(send_sms_request, opts = {}) ⇒ Array<(SendSms200Response, Integer, Hash)>

Send an SMS/MMS Sends an SMS (or MMS when `mediaUrls` is set) from one of your SMS-enabled numbers. At least one of `text` / `mediaUrls` is required. Both numbers are normalized to E.164, so `from` matches regardless of formatting and replies thread into the same inbox conversation. US numbers must have an approved carrier registration (`/v1/sms/registrations`) before messages deliver. Idempotency: send an `Idempotency-Key` header to make retries safe: same key + same body replays the original response instead of sending a second message; same key + different body returns 422; a key still in flight returns 409.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Optional client-generated unique key (e.g. a UUID) that makes send retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.

Returns:

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

    SendSms200Response data, response status code and response headers



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

def send_sms_with_http_info(send_sms_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.send_sms ...'
  end
  # verify the required parameter 'send_sms_request' is set
  if @api_client.config.client_side_validation && send_sms_request.nil?
    fail ArgumentError, "Missing the required parameter 'send_sms_request' when calling SMSApi.send_sms"
  end
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
    fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SMSApi.send_sms, the character length must be smaller than or equal to 255.'
  end

  # resource path
  local_var_path = '/v1/sms/messages'

  # 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
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

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

#share_sms_registration(share_sms_registration_request, opts = {}) ⇒ ShareSmsRegistration200Response

Create a registration share link Creates a single-use, expiring link (valid 7 days) that lets someone else (whoever has the legal business details) fill in the carrier registration form for one of your numbers, without a Zernio login. The registration is created under your account once the form is submitted.

Parameters:

Returns:



755
756
757
758
# File 'lib/zernio-sdk/api/sms_api.rb', line 755

def share_sms_registration(share_sms_registration_request, opts = {})
  data, _status_code, _headers = share_sms_registration_with_http_info(share_sms_registration_request, opts)
  data
end

#share_sms_registration_with_http_info(share_sms_registration_request, opts = {}) ⇒ Array<(ShareSmsRegistration200Response, Integer, Hash)>

Create a registration share link Creates a single-use, expiring link (valid 7 days) that lets someone else (whoever has the legal business details) fill in the carrier registration form for one of your numbers, without a Zernio login. The registration is created under your account once the form is submitted.

Parameters:

Returns:



765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
# File 'lib/zernio-sdk/api/sms_api.rb', line 765

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

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

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

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

#start_sms_registration(start_sms_registration_request, opts = {}) ⇒ StartSmsRegistration200Response

Start a carrier registration Starts the US carrier registration that a number needs before SMS delivers: 10DLC (standard company or sole-proprietor) or toll-free verification. 10DLC needs brand + campaign; toll-free needs tollFree. Approval is asynchronous; poll GET /v1/sms/registrations/{id} (sole-prop registrations first need the OTP step: a code is texted to the brand's mobile number, submit it via /verify-otp). Already have an approved registration? Add another number to it with POST /v1/phone-numbers/{id}/sms/reuse-registration instead of registering (and paying the carrier brand fee) again. Rather have your client fill in the legal business details? Create a share link with POST /v1/sms/registrations/share.

Parameters:

Returns:



823
824
825
826
# File 'lib/zernio-sdk/api/sms_api.rb', line 823

def start_sms_registration(start_sms_registration_request, opts = {})
  data, _status_code, _headers = start_sms_registration_with_http_info(start_sms_registration_request, opts)
  data
end

#start_sms_registration_with_http_info(start_sms_registration_request, opts = {}) ⇒ Array<(StartSmsRegistration200Response, Integer, Hash)>

Start a carrier registration Starts the US carrier registration that a number needs before SMS delivers: 10DLC (standard company or sole-proprietor) or toll-free verification. 10DLC needs `brand` + `campaign`; toll-free needs `tollFree`. Approval is asynchronous; poll `GET /v1/sms/registrations/id` (sole-prop registrations first need the OTP step: a code is texted to the brand's mobile number, submit it via `/verify-otp`). Already have an approved registration? Add another number to it with `POST /v1/phone-numbers/id/sms/reuse-registration` instead of registering (and paying the carrier brand fee) again. Rather have your client fill in the legal business details? Create a share link with `POST /v1/sms/registrations/share`.

Parameters:

Returns:



833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
# File 'lib/zernio-sdk/api/sms_api.rb', line 833

def start_sms_registration_with_http_info(start_sms_registration_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.start_sms_registration ...'
  end
  # verify the required parameter 'start_sms_registration_request' is set
  if @api_client.config.client_side_validation && start_sms_registration_request.nil?
    fail ArgumentError, "Missing the required parameter 'start_sms_registration_request' when calling SMSApi.start_sms_registration"
  end
  # resource path
  local_var_path = '/v1/sms/registrations'

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

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

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

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

#upload_sms_opt_in_proof(id, file, opts = {}) ⇒ UploadSmsOptInProofFile200Response

Upload opt-in form proof for an appeal Hosts a screenshot (or PDF) of your SMS opt-in form and returns its public URL. Carrier reviewers reject campaigns whose consent can't be verified and ask for a "link/screenshot of the opt-in form" — the registry has no attachment field, so include the returned URL inside the messageFlow you submit with the appeal (POST /v1/sms/registrations/{id}/appeal).

Parameters:

  • id (String)
  • file (File)

    PNG, JPG, WebP, GIF or PDF, max 4MB.

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

    the optional parameters

Returns:



892
893
894
895
# File 'lib/zernio-sdk/api/sms_api.rb', line 892

def upload_sms_opt_in_proof(id, file, opts = {})
  data, _status_code, _headers = upload_sms_opt_in_proof_with_http_info(id, file, opts)
  data
end

#upload_sms_opt_in_proof_file(file, opts = {}) ⇒ UploadSmsOptInProofFile200Response

Upload opt-in form proof Hosts a screenshot (or PDF) of your SMS opt-in form and returns its public URL. Include that URL in the campaign's messageFlow (the opt-in workflow text) — the carrier registry has no attachment field, so reviewers verify consent by opening links in that answer. Works before a registration exists (use it when registering) and for appeals. /v1/sms/registrations/{id}/opt-in-proof is an alias.

Parameters:

  • file (File)

    PNG, JPG, WebP, GIF or PDF, max 4MB.

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

    the optional parameters

Returns:



966
967
968
969
# File 'lib/zernio-sdk/api/sms_api.rb', line 966

def upload_sms_opt_in_proof_file(file, opts = {})
  data, _status_code, _headers = upload_sms_opt_in_proof_file_with_http_info(file, opts)
  data
end

#upload_sms_opt_in_proof_file_with_http_info(file, opts = {}) ⇒ Array<(UploadSmsOptInProofFile200Response, Integer, Hash)>

Upload opt-in form proof Hosts a screenshot (or PDF) of your SMS opt-in form and returns its public URL. Include that URL in the campaign's `messageFlow` (the opt-in workflow text) — the carrier registry has no attachment field, so reviewers verify consent by opening links in that answer. Works before a registration exists (use it when registering) and for appeals. `/v1/sms/registrations/id/opt-in-proof` is an alias.

Parameters:

  • file (File)

    PNG, JPG, WebP, GIF or PDF, max 4MB.

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

    the optional parameters

Returns:



976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
# File 'lib/zernio-sdk/api/sms_api.rb', line 976

def upload_sms_opt_in_proof_file_with_http_info(file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.upload_sms_opt_in_proof_file ...'
  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 SMSApi.upload_sms_opt_in_proof_file"
  end
  # resource path
  local_var_path = '/v1/sms/opt-in-proof'

  # 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['file'] = file

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

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

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

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

#upload_sms_opt_in_proof_with_http_info(id, file, opts = {}) ⇒ Array<(UploadSmsOptInProofFile200Response, Integer, Hash)>

Upload opt-in form proof for an appeal Hosts a screenshot (or PDF) of your SMS opt-in form and returns its public URL. Carrier reviewers reject campaigns whose consent can't be verified and ask for a &quot;link/screenshot of the opt-in form&quot; — the registry has no attachment field, so include the returned URL inside the `messageFlow` you submit with the appeal (`POST /v1/sms/registrations/id/appeal`).

Parameters:

  • id (String)
  • file (File)

    PNG, JPG, WebP, GIF or PDF, max 4MB.

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

    the optional parameters

Returns:



903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
# File 'lib/zernio-sdk/api/sms_api.rb', line 903

def upload_sms_opt_in_proof_with_http_info(id, file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.upload_sms_opt_in_proof ...'
  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 SMSApi.upload_sms_opt_in_proof"
  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 SMSApi.upload_sms_opt_in_proof"
  end
  # resource path
  local_var_path = '/v1/sms/registrations/{id}/opt-in-proof'.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(['multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

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

#verify_sms_registration_otp(id, verify_sms_registration_otp_request, opts = {}) ⇒ VerifySmsRegistrationOtp200Response

Submit the sole-prop OTP Completes sole-proprietor 10DLC brand verification by submitting the one-time PIN texted to the brand's mobile number. On success the registration continues to campaign creation automatically.

Parameters:

Returns:



1036
1037
1038
1039
# File 'lib/zernio-sdk/api/sms_api.rb', line 1036

def verify_sms_registration_otp(id, verify_sms_registration_otp_request, opts = {})
  data, _status_code, _headers = verify_sms_registration_otp_with_http_info(id, verify_sms_registration_otp_request, opts)
  data
end

#verify_sms_registration_otp_with_http_info(id, verify_sms_registration_otp_request, opts = {}) ⇒ Array<(VerifySmsRegistrationOtp200Response, Integer, Hash)>

Submit the sole-prop OTP Completes sole-proprietor 10DLC brand verification by submitting the one-time PIN texted to the brand's mobile number. On success the registration continues to campaign creation automatically.

Parameters:

Returns:



1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
# File 'lib/zernio-sdk/api/sms_api.rb', line 1047

def verify_sms_registration_otp_with_http_info(id, verify_sms_registration_otp_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.verify_sms_registration_otp ...'
  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 SMSApi.verify_sms_registration_otp"
  end
  # verify the required parameter 'verify_sms_registration_otp_request' is set
  if @api_client.config.client_side_validation && verify_sms_registration_otp_request.nil?
    fail ArgumentError, "Missing the required parameter 'verify_sms_registration_otp_request' when calling SMSApi.verify_sms_registration_otp"
  end
  # resource path
  local_var_path = '/v1/sms/registrations/{id}/verify-otp'.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(verify_sms_registration_otp_request)

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

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

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