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

#create_sms_sender_id(create_sms_sender_id_request, opts = {}) ⇒ CreateSmsSenderId200Response

Create an alphanumeric sender ID Registers an alphanumeric sender ID (e.g. ZERNIO) — a branded from for one-way international SMS. No phone number purchase or carrier registration is needed; once created, pass it as from on POST /v1/sms/messages. Constraints: 3-11 characters (letters, digits, spaces; at least one letter). Sends cannot reach the US, Canada, or Puerto Rico, are text-only, and recipients cannot reply. Sender IDs that impersonate well-known brands or institutions are rejected, and an ID already registered by another workspace returns 409 (active sender IDs are globally unique, first-come-first-served). Creating the same sender ID again is a no-op (re-activates it after a delete).

Parameters:

Returns:



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

def create_sms_sender_id(create_sms_sender_id_request, opts = {})
  data, _status_code, _headers = create_sms_sender_id_with_http_info(create_sms_sender_id_request, opts)
  data
end

#create_sms_sender_id_with_http_info(create_sms_sender_id_request, opts = {}) ⇒ Array<(CreateSmsSenderId200Response, Integer, Hash)>

Create an alphanumeric sender ID Registers an alphanumeric sender ID (e.g. `ZERNIO`) — a branded `from` for one-way international SMS. No phone number purchase or carrier registration is needed; once created, pass it as `from` on `POST /v1/sms/messages`. Constraints: 3-11 characters (letters, digits, spaces; at least one letter). Sends cannot reach the US, Canada, or Puerto Rico, are text-only, and recipients cannot reply. Sender IDs that impersonate well-known brands or institutions are rejected, and an ID already registered by another workspace returns 409 (active sender IDs are globally unique, first-come-first-served). Creating the same sender ID again is a no-op (re-activates it after a delete).

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

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

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

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

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

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



169
170
171
172
# File 'lib/zernio-sdk/api/sms_api.rb', line 169

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:



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

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

#delete_sms_sender_id(id, opts = {}) ⇒ DeleteSmsSenderId200Response

Delete an alphanumeric sender ID Deactivates the sender ID so it can no longer send. Re-creating the same sender ID via POST /v1/sms/sender-ids re-activates it.

Parameters:

  • id (String)

    Sender ID resource id.

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

    the optional parameters

Returns:



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

def delete_sms_sender_id(id, opts = {})
  data, _status_code, _headers = delete_sms_sender_id_with_http_info(id, opts)
  data
end

#delete_sms_sender_id_with_http_info(id, opts = {}) ⇒ Array<(DeleteSmsSenderId200Response, Integer, Hash)>

Delete an alphanumeric sender ID Deactivates the sender ID so it can no longer send. Re-creating the same sender ID via `POST /v1/sms/sender-ids` re-activates it.

Parameters:

  • id (String)

    Sender ID resource id.

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

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

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

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



295
296
297
298
# File 'lib/zernio-sdk/api/sms_api.rb', line 295

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:



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

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:



358
359
360
361
# File 'lib/zernio-sdk/api/sms_api.rb', line 358

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:



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

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:



421
422
423
424
# File 'lib/zernio-sdk/api/sms_api.rb', line 421

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:



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/zernio-sdk/api/sms_api.rb', line 431

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:



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

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



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
548
549
550
551
552
# File 'lib/zernio-sdk/api/sms_api.rb', line 496

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:



558
559
560
561
# File 'lib/zernio-sdk/api/sms_api.rb', line 558

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:



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 567

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

#list_sms_sender_ids(opts = {}) ⇒ ListSmsSenderIds200Response

List alphanumeric sender IDs

Parameters:

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

    the optional parameters

Returns:



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

def list_sms_sender_ids(opts = {})
  data, _status_code, _headers = list_sms_sender_ids_with_http_info(opts)
  data
end

#list_sms_sender_ids_with_http_info(opts = {}) ⇒ Array<(ListSmsSenderIds200Response, Integer, Hash)>

List alphanumeric sender IDs

Parameters:

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

    the optional parameters

Returns:

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

    ListSmsSenderIds200Response data, response status code and response headers



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

def list_sms_sender_ids_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.list_sms_sender_ids ...'
  end
  # resource path
  local_var_path = '/v1/sms/sender-ids'

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

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

  new_options = opts.merge(
    :operation => :"SMSApi.list_sms_sender_ids",
    :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_sender_ids\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:



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

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



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

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

#request_sms_sender_id_limit_increase(request_sms_sender_id_limit_increase_request, opts = {}) ⇒ RequestSmsSenderIdLimitIncrease200Response

Request a higher sender ID daily limit Asks support to raise the workspace's daily sender-ID message cap. There is no self-serve raise: the request (desired cap + use case) is reviewed manually, usually within a business day.

Parameters:

Returns:



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

def request_sms_sender_id_limit_increase(request_sms_sender_id_limit_increase_request, opts = {})
  data, _status_code, _headers = request_sms_sender_id_limit_increase_with_http_info(request_sms_sender_id_limit_increase_request, opts)
  data
end

#request_sms_sender_id_limit_increase_with_http_info(request_sms_sender_id_limit_increase_request, opts = {}) ⇒ Array<(RequestSmsSenderIdLimitIncrease200Response, Integer, Hash)>

Request a higher sender ID daily limit Asks support to raise the workspace's daily sender-ID message cap. There is no self-serve raise: the request (desired cap + use case) is reviewed manually, usually within a business day.

Parameters:

Returns:



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

def request_sms_sender_id_limit_increase_with_http_info(request_sms_sender_id_limit_increase_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SMSApi.request_sms_sender_id_limit_increase ...'
  end
  # verify the required parameter 'request_sms_sender_id_limit_increase_request' is set
  if @api_client.config.client_side_validation && request_sms_sender_id_limit_increase_request.nil?
    fail ArgumentError, "Missing the required parameter 'request_sms_sender_id_limit_increase_request' when calling SMSApi.request_sms_sender_id_limit_increase"
  end
  # resource path
  local_var_path = '/v1/sms/sender-ids/limit-request'

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

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

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

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



808
809
810
811
# File 'lib/zernio-sdk/api/sms_api.rb', line 808

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:



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

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:



871
872
873
874
# File 'lib/zernio-sdk/api/sms_api.rb', line 871

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:



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

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, or from an approved alphanumeric sender ID (/v1/sms/sender-ids). At least one of text / mediaUrls is required. 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. Alphanumeric sender IDs are one-way and international only: they cannot reach the US, Canada, or Puerto Rico (403), are text-only (no MMS), and recipients cannot reply. Some destination countries substitute a numeric sender to ensure delivery. 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:



935
936
937
938
# File 'lib/zernio-sdk/api/sms_api.rb', line 935

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, or from an approved alphanumeric sender ID (`/v1/sms/sender-ids`). At least one of `text` / `mediaUrls` is required. 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. Alphanumeric sender IDs are one-way and international only: they cannot reach the US, Canada, or Puerto Rico (403), are text-only (no MMS), and recipients cannot reply. Some destination countries substitute a numeric sender to ensure delivery. 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



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

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:



1009
1010
1011
1012
# File 'lib/zernio-sdk/api/sms_api.rb', line 1009

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:



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

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:



1077
1078
1079
1080
# File 'lib/zernio-sdk/api/sms_api.rb', line 1077

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:



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

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:



1146
1147
1148
1149
# File 'lib/zernio-sdk/api/sms_api.rb', line 1146

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:



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

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:



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

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:



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

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:



1290
1291
1292
1293
# File 'lib/zernio-sdk/api/sms_api.rb', line 1290

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:



1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
# File 'lib/zernio-sdk/api/sms_api.rb', line 1301

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