Class: SibApiV3Sdk::SMSCampaignsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/sib-api-v3-sdk/api/sms_campaigns_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SMSCampaignsApi

Returns a new instance of SMSCampaignsApi.



19
20
21
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_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/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_sms_campaign(create_sms_campaign, opts = {}) ⇒ CreateModel

Creates an SMS campaign

Parameters:

  • create_sms_campaign

    Values to create an SMS Campaign

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 28

def create_sms_campaign(create_sms_campaign, opts = {})
  data, _status_code, _headers = create_sms_campaign_with_http_info(create_sms_campaign, opts)
  return data
end

#create_sms_campaign_with_http_info(create_sms_campaign, opts = {}) ⇒ Array<(CreateModel, Fixnum, Hash)>

Creates an SMS campaign

Parameters:

  • create_sms_campaign

    Values to create an SMS Campaign

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

    the optional parameters

Returns:

  • (Array<(CreateModel, Fixnum, Hash)>)

    CreateModel data, response status code and response headers



38
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
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 38

def create_sms_campaign_with_http_info(create_sms_campaign, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMSCampaignsApi.create_sms_campaign ..."
  end
  # verify the required parameter 'create_sms_campaign' is set
  if @api_client.config.client_side_validation && create_sms_campaign.nil?
    fail ArgumentError, "Missing the required parameter 'create_sms_campaign' when calling SMSCampaignsApi.create_sms_campaign"
  end
  # resource path
  local_var_path = "/smsCampaigns"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_sms_campaign)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateModel')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSCampaignsApi#create_sms_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_sms_campaign(campaign_id, opts = {}) ⇒ nil

Delete the SMS campaign

Parameters:

  • campaign_id

    id of the SMS campaign

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

    the optional parameters

Returns:

  • (nil)


83
84
85
86
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 83

def delete_sms_campaign(campaign_id, opts = {})
  delete_sms_campaign_with_http_info(campaign_id, opts)
  return nil
end

#delete_sms_campaign_with_http_info(campaign_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete the SMS campaign

Parameters:

  • campaign_id

    id of the SMS campaign

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 93

def delete_sms_campaign_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMSCampaignsApi.delete_sms_campaign ..."
  end
  # verify the required parameter 'campaign_id' is set
  if @api_client.config.client_side_validation && campaign_id.nil?
    fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.delete_sms_campaign"
  end
  # resource path
  local_var_path = "/smsCampaigns/{campaignId}".sub('{' + 'campaignId' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSCampaignsApi#delete_sms_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_sms_campaign(campaign_id, opts = {}) ⇒ GetSmsCampaign

Get an SMS campaign

Parameters:

  • campaign_id

    id of the SMS campaign

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

    the optional parameters

Returns:



137
138
139
140
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 137

def get_sms_campaign(campaign_id, opts = {})
  data, _status_code, _headers = get_sms_campaign_with_http_info(campaign_id, opts)
  return data
end

#get_sms_campaign_with_http_info(campaign_id, opts = {}) ⇒ Array<(GetSmsCampaign, Fixnum, Hash)>

Get an SMS campaign

Parameters:

  • campaign_id

    id of the SMS campaign

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

    the optional parameters

Returns:

  • (Array<(GetSmsCampaign, Fixnum, Hash)>)

    GetSmsCampaign data, response status code and response headers



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 147

def get_sms_campaign_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMSCampaignsApi.get_sms_campaign ..."
  end
  # verify the required parameter 'campaign_id' is set
  if @api_client.config.client_side_validation && campaign_id.nil?
    fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.get_sms_campaign"
  end
  # resource path
  local_var_path = "/smsCampaigns/{campaignId}".sub('{' + 'campaignId' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetSmsCampaign')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSCampaignsApi#get_sms_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_sms_campaigns(opts = {}) ⇒ GetSmsCampaigns

Returns the informations for all your created SMS campaigns

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :status (String)

    Status of campaign.

  • :start_date (DateTime)

    Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either &#39;status&#39; not passed and if passed is set to &#39;sent&#39; )

  • :end_date (DateTime)

    Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either &#39;status&#39; not passed and if passed is set to &#39;sent&#39; )

  • :limit (Integer)

    Number limitation for the result returned (default to 500)

  • :offset (Integer)

    Beginning point in the list to retrieve from. (default to 0)

Returns:



196
197
198
199
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 196

def get_sms_campaigns(opts = {})
  data, _status_code, _headers = get_sms_campaigns_with_http_info(opts)
  return data
end

#get_sms_campaigns_with_http_info(opts = {}) ⇒ Array<(GetSmsCampaigns, Fixnum, Hash)>

Returns the informations for all your created SMS campaigns

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :status (String)

    Status of campaign.

  • :start_date (DateTime)

    Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either &#39;status&#39; not passed and if passed is set to &#39;sent&#39; )

  • :end_date (DateTime)

    Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either &#39;status&#39; not passed and if passed is set to &#39;sent&#39; )

  • :limit (Integer)

    Number limitation for the result returned

  • :offset (Integer)

    Beginning point in the list to retrieve from.

Returns:

  • (Array<(GetSmsCampaigns, Fixnum, Hash)>)

    GetSmsCampaigns data, response status code and response headers



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 210

def get_sms_campaigns_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMSCampaignsApi.get_sms_campaigns ..."
  end
  if @api_client.config.client_side_validation && opts[:'status'] && !['suspended', 'archive', 'sent', 'queued', 'draft', 'inProcess'].include?(opts[:'status'])
    fail ArgumentError, 'invalid value for "status", must be one of suspended, archive, sent, queued, draft, inProcess'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMSCampaignsApi.get_sms_campaigns, must be smaller than or equal to 1000.'
  end

  # resource path
  local_var_path = "/smsCampaigns"

  # query parameters
  query_params = {}
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetSmsCampaigns')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSCampaignsApi#get_sms_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#request_sms_recipient_export(campaign_id, opts = {}) ⇒ CreatedProcessId

Exports the recipients of the specified campaign. It returns the background process ID which on completion calls the notify URL that you have set in the input.

Parameters:

  • campaign_id

    id of the campaign

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

    the optional parameters

Options Hash (opts):

Returns:



264
265
266
267
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 264

def request_sms_recipient_export(campaign_id, opts = {})
  data, _status_code, _headers = request_sms_recipient_export_with_http_info(campaign_id, opts)
  return data
end

#request_sms_recipient_export_with_http_info(campaign_id, opts = {}) ⇒ Array<(CreatedProcessId, Fixnum, Hash)>

Exports the recipients of the specified campaign. It returns the background process ID which on completion calls the notify URL that you have set in the input.

Parameters:

  • campaign_id

    id of the campaign

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(CreatedProcessId, Fixnum, Hash)>)

    CreatedProcessId data, response status code and response headers



275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 275

def request_sms_recipient_export_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMSCampaignsApi.request_sms_recipient_export ..."
  end
  # verify the required parameter 'campaign_id' is set
  if @api_client.config.client_side_validation && campaign_id.nil?
    fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.request_sms_recipient_export"
  end
  # resource path
  local_var_path = "/smsCampaigns/{campaignId}/exportRecipients".sub('{' + 'campaignId' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'recipient_export'])
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreatedProcessId')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSCampaignsApi#request_sms_recipient_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_sms_campaign_now(campaign_id, opts = {}) ⇒ nil

Send your SMS campaign immediately

Parameters:

  • campaign_id

    id of the campaign

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

    the optional parameters

Returns:

  • (nil)


320
321
322
323
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 320

def send_sms_campaign_now(campaign_id, opts = {})
  send_sms_campaign_now_with_http_info(campaign_id, opts)
  return nil
end

#send_sms_campaign_now_with_http_info(campaign_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Send your SMS campaign immediately

Parameters:

  • campaign_id

    id of the campaign

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 330

def send_sms_campaign_now_with_http_info(campaign_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMSCampaignsApi.send_sms_campaign_now ..."
  end
  # verify the required parameter 'campaign_id' is set
  if @api_client.config.client_side_validation && campaign_id.nil?
    fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.send_sms_campaign_now"
  end
  # resource path
  local_var_path = "/smsCampaigns/{campaignId}/sendNow".sub('{' + 'campaignId' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSCampaignsApi#send_sms_campaign_now\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_sms_report(campaign_id, send_report, opts = {}) ⇒ nil

Send report of SMS campaigns Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail.

Parameters:

  • campaign_id

    id of the campaign

  • send_report

    Values for send a report

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

    the optional parameters

Returns:

  • (nil)


375
376
377
378
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 375

def send_sms_report(campaign_id, send_report, opts = {})
  send_sms_report_with_http_info(campaign_id, send_report, opts)
  return nil
end

#send_sms_report_with_http_info(campaign_id, send_report, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Send report of SMS campaigns Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail.

Parameters:

  • campaign_id

    id of the campaign

  • send_report

    Values for send a report

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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
422
423
424
425
426
427
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 386

def send_sms_report_with_http_info(campaign_id, send_report, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMSCampaignsApi.send_sms_report ..."
  end
  # verify the required parameter 'campaign_id' is set
  if @api_client.config.client_side_validation && campaign_id.nil?
    fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.send_sms_report"
  end
  # verify the required parameter 'send_report' is set
  if @api_client.config.client_side_validation && send_report.nil?
    fail ArgumentError, "Missing the required parameter 'send_report' when calling SMSCampaignsApi.send_sms_report"
  end
  # resource path
  local_var_path = "/smsCampaigns/{campaignId}/sendReport".sub('{' + 'campaignId' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(send_report)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSCampaignsApi#send_sms_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_test_sms(campaign_id, phone_number, opts = {}) ⇒ nil

Send an SMS

Parameters:

  • campaign_id

    Id of the SMS campaign

  • phone_number

    Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted

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

    the optional parameters

Returns:

  • (nil)


435
436
437
438
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 435

def send_test_sms(campaign_id, phone_number, opts = {})
  send_test_sms_with_http_info(campaign_id, phone_number, opts)
  return nil
end

#send_test_sms_with_http_info(campaign_id, phone_number, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Send an SMS

Parameters:

  • campaign_id

    Id of the SMS campaign

  • phone_number

    Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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

def send_test_sms_with_http_info(campaign_id, phone_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMSCampaignsApi.send_test_sms ..."
  end
  # verify the required parameter 'campaign_id' is set
  if @api_client.config.client_side_validation && campaign_id.nil?
    fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.send_test_sms"
  end
  # verify the required parameter 'phone_number' is set
  if @api_client.config.client_side_validation && phone_number.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number' when calling SMSCampaignsApi.send_test_sms"
  end
  # resource path
  local_var_path = "/smsCampaigns/{campaignId}/sendTest".sub('{' + 'campaignId' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(phone_number)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSCampaignsApi#send_test_sms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_sms_campaign(campaign_id, update_sms_campaign, opts = {}) ⇒ nil

Updates an SMS campaign

Parameters:

  • campaign_id

    id of the SMS campaign

  • update_sms_campaign

    Values to update an SMS Campaign

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

    the optional parameters

Returns:

  • (nil)


495
496
497
498
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 495

def update_sms_campaign(campaign_id, update_sms_campaign, opts = {})
  update_sms_campaign_with_http_info(campaign_id, update_sms_campaign, opts)
  return nil
end

#update_sms_campaign_status(campaign_id, status, opts = {}) ⇒ nil

Update the campaign status

Parameters:

  • campaign_id

    id of the campaign

  • status

    Status of the campaign.

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

    the optional parameters

Returns:

  • (nil)


555
556
557
558
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 555

def update_sms_campaign_status(campaign_id, status, opts = {})
  update_sms_campaign_status_with_http_info(campaign_id, status, opts)
  return nil
end

#update_sms_campaign_status_with_http_info(campaign_id, status, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update the campaign status

Parameters:

  • campaign_id

    id of the campaign

  • status

    Status of the campaign.

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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
# File 'lib/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 566

def update_sms_campaign_status_with_http_info(campaign_id, status, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMSCampaignsApi.update_sms_campaign_status ..."
  end
  # verify the required parameter 'campaign_id' is set
  if @api_client.config.client_side_validation && campaign_id.nil?
    fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.update_sms_campaign_status"
  end
  # verify the required parameter 'status' is set
  if @api_client.config.client_side_validation && status.nil?
    fail ArgumentError, "Missing the required parameter 'status' when calling SMSCampaignsApi.update_sms_campaign_status"
  end
  # resource path
  local_var_path = "/smsCampaigns/{campaignId}/status".sub('{' + 'campaignId' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(status)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSCampaignsApi#update_sms_campaign_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_sms_campaign_with_http_info(campaign_id, update_sms_campaign, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Updates an SMS campaign

Parameters:

  • campaign_id

    id of the SMS campaign

  • update_sms_campaign

    Values to update an SMS Campaign

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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/sib-api-v3-sdk/api/sms_campaigns_api.rb', line 506

def update_sms_campaign_with_http_info(campaign_id, update_sms_campaign, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SMSCampaignsApi.update_sms_campaign ..."
  end
  # verify the required parameter 'campaign_id' is set
  if @api_client.config.client_side_validation && campaign_id.nil?
    fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.update_sms_campaign"
  end
  # verify the required parameter 'update_sms_campaign' is set
  if @api_client.config.client_side_validation && update_sms_campaign.nil?
    fail ArgumentError, "Missing the required parameter 'update_sms_campaign' when calling SMSCampaignsApi.update_sms_campaign"
  end
  # resource path
  local_var_path = "/smsCampaigns/{campaignId}".sub('{' + 'campaignId' + '}', campaign_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(update_sms_campaign)
  auth_names = ['api-key', 'partner-key']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SMSCampaignsApi#update_sms_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end