Class: SibApiV3Sdk::ContactsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ContactsApi

Returns a new instance of ContactsApi.



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

def api_client
  @api_client
end

Instance Method Details

#add_contact_to_list(list_id, contact_emails, opts = {}) ⇒ PostContactInfo

Add existing contacts to a list

Parameters:

  • list_id

    Id of the list

  • contact_emails

    Emails addresses OR IDs of the contacts

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

    the optional parameters

Returns:



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

def add_contact_to_list(list_id, contact_emails, opts = {})
  data, _status_code, _headers = add_contact_to_list_with_http_info(list_id, contact_emails, opts)
  data
end

#add_contact_to_list_with_http_info(list_id, contact_emails, opts = {}) ⇒ Array<(PostContactInfo, Fixnum, Hash)>

Add existing contacts to a list

Parameters:

  • list_id

    Id of the list

  • contact_emails

    Emails addresses OR IDs of the contacts

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

    the optional parameters

Returns:

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

    PostContactInfo data, response status code and response headers



37
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
77
78
79
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 37

def add_contact_to_list_with_http_info(list_id, contact_emails, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.add_contact_to_list ...'
  end
  # verify the required parameter 'list_id' is set
  if @api_client.config.client_side_validation && list_id.nil?
    fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.add_contact_to_list"
  end
  # verify the required parameter 'contact_emails' is set
  if @api_client.config.client_side_validation && contact_emails.nil?
    fail ArgumentError, "Missing the required parameter 'contact_emails' when calling ContactsApi.add_contact_to_list"
  end
  # resource path
  local_var_path = '/contacts/lists/{listId}/contacts/add'.sub('{' + 'listId' + '}', list_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(contact_emails)
  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 => 'PostContactInfo')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#add_contact_to_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_attribute(attribute_category, attribute_name, create_attribute, opts = {}) ⇒ nil

Create contact attribute

Parameters:

  • attribute_category

    Category of the attribute

  • attribute_name

    Name of the attribute

  • create_attribute

    Values to create an attribute

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

    the optional parameters

Returns:

  • (nil)


86
87
88
89
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 86

def create_attribute(attribute_category, attribute_name, create_attribute, opts = {})
  create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts)
  nil
end

#create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create contact attribute

Parameters:

  • attribute_category

    Category of the attribute

  • attribute_name

    Name of the attribute

  • create_attribute

    Values to create an attribute

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 97

def create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.create_attribute ...'
  end
  # verify the required parameter 'attribute_category' is set
  if @api_client.config.client_side_validation && attribute_category.nil?
    fail ArgumentError, "Missing the required parameter 'attribute_category' when calling ContactsApi.create_attribute"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category)
    fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global"
  end
  # verify the required parameter 'attribute_name' is set
  if @api_client.config.client_side_validation && attribute_name.nil?
    fail ArgumentError, "Missing the required parameter 'attribute_name' when calling ContactsApi.create_attribute"
  end
  # verify the required parameter 'create_attribute' is set
  if @api_client.config.client_side_validation && create_attribute.nil?
    fail ArgumentError, "Missing the required parameter 'create_attribute' when calling ContactsApi.create_attribute"
  end
  # resource path
  local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.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(create_attribute)
  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: ContactsApi#create_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_contact(create_contact, opts = {}) ⇒ CreateUpdateContactModel

Create a contact

Parameters:

  • create_contact

    Values to create a contact

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

    the optional parameters

Returns:



151
152
153
154
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 151

def create_contact(create_contact, opts = {})
  data, _status_code, _headers = create_contact_with_http_info(create_contact, opts)
  data
end

#create_contact_with_http_info(create_contact, opts = {}) ⇒ Array<(CreateUpdateContactModel, Fixnum, Hash)>

Create a contact

Parameters:

  • create_contact

    Values to create a contact

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

    the optional parameters

Returns:

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

    CreateUpdateContactModel data, response status code and response headers



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
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 160

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

  # 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_contact)
  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 => 'CreateUpdateContactModel')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#create_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_doi_contact(create_doi_contact, opts = {}) ⇒ nil

Create Contact via DOI (Double-Opt-In) Flow

Parameters:

  • create_doi_contact

    Values to create the Double opt-in (DOI) contact

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

    the optional parameters

Returns:

  • (nil)


203
204
205
206
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 203

def create_doi_contact(create_doi_contact, opts = {})
  create_doi_contact_with_http_info(create_doi_contact, opts)
  nil
end

#create_doi_contact_with_http_info(create_doi_contact, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create Contact via DOI (Double-Opt-In) Flow

Parameters:

  • create_doi_contact

    Values to create the Double opt-in (DOI) contact

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

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

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

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

Create a folder

Parameters:

  • create_folder

    Name of the folder

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

    the optional parameters

Returns:



254
255
256
257
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 254

def create_folder(create_folder, opts = {})
  data, _status_code, _headers = create_folder_with_http_info(create_folder, opts)
  data
end

#create_folder_with_http_info(create_folder, opts = {}) ⇒ Array<(CreateModel, Fixnum, Hash)>

Create a folder

Parameters:

  • create_folder

    Name of the folder

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

    the optional parameters

Returns:

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

    CreateModel data, response status code and response headers



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 263

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

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

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

Create a list

Parameters:

  • create_list

    Values to create a list

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

    the optional parameters

Returns:



306
307
308
309
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 306

def create_list(create_list, opts = {})
  data, _status_code, _headers = create_list_with_http_info(create_list, opts)
  data
end

#create_list_with_http_info(create_list, opts = {}) ⇒ Array<(CreateModel, Fixnum, Hash)>

Create a list

Parameters:

  • create_list

    Values to create a list

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

    the optional parameters

Returns:

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

    CreateModel data, response status code and response headers



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 315

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

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

#delete_attribute(attribute_category, attribute_name, opts = {}) ⇒ nil

Delete an attribute

Parameters:

  • attribute_category

    Category of the attribute

  • attribute_name

    Name of the existing attribute

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

    the optional parameters

Returns:

  • (nil)


359
360
361
362
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 359

def delete_attribute(attribute_category, attribute_name, opts = {})
  delete_attribute_with_http_info(attribute_category, attribute_name, opts)
  nil
end

#delete_attribute_with_http_info(attribute_category, attribute_name, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete an attribute

Parameters:

  • attribute_category

    Category of the attribute

  • attribute_name

    Name of the existing attribute

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

def delete_attribute_with_http_info(attribute_category, attribute_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.delete_attribute ...'
  end
  # verify the required parameter 'attribute_category' is set
  if @api_client.config.client_side_validation && attribute_category.nil?
    fail ArgumentError, "Missing the required parameter 'attribute_category' when calling ContactsApi.delete_attribute"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category)
    fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global"
  end
  # verify the required parameter 'attribute_name' is set
  if @api_client.config.client_side_validation && attribute_name.nil?
    fail ArgumentError, "Missing the required parameter 'attribute_name' when calling ContactsApi.delete_attribute"
  end
  # resource path
  local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.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: ContactsApi#delete_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_contact(identifier, opts = {}) ⇒ nil

Delete a contact

Parameters:

  • identifier

    Email (urlencoded) OR ID of the contact

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

    the optional parameters

Returns:

  • (nil)


419
420
421
422
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 419

def delete_contact(identifier, opts = {})
  delete_contact_with_http_info(identifier, opts)
  nil
end

#delete_contact_with_http_info(identifier, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a contact

Parameters:

  • identifier

    Email (urlencoded) OR ID of the contact

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 428

def delete_contact_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.delete_contact ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling ContactsApi.delete_contact"
  end
  # resource path
  local_var_path = '/contacts/{identifier}'.sub('{' + 'identifier' + '}', identifier.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: ContactsApi#delete_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_folder(folder_id, opts = {}) ⇒ nil

Delete a folder (and all its lists)

Parameters:

  • folder_id

    Id of the folder

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

    the optional parameters

Returns:

  • (nil)


470
471
472
473
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 470

def delete_folder(folder_id, opts = {})
  delete_folder_with_http_info(folder_id, opts)
  nil
end

#delete_folder_with_http_info(folder_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a folder (and all its lists)

Parameters:

  • folder_id

    Id of the folder

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 479

def delete_folder_with_http_info(folder_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.delete_folder ...'
  end
  # verify the required parameter 'folder_id' is set
  if @api_client.config.client_side_validation && folder_id.nil?
    fail ArgumentError, "Missing the required parameter 'folder_id' when calling ContactsApi.delete_folder"
  end
  # resource path
  local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', folder_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: ContactsApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_list(list_id, opts = {}) ⇒ nil

Delete a list

Parameters:

  • list_id

    Id of the list

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

    the optional parameters

Returns:

  • (nil)


521
522
523
524
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 521

def delete_list(list_id, opts = {})
  delete_list_with_http_info(list_id, opts)
  nil
end

#delete_list_with_http_info(list_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a list

Parameters:

  • list_id

    Id of the list

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 530

def delete_list_with_http_info(list_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.delete_list ...'
  end
  # verify the required parameter 'list_id' is set
  if @api_client.config.client_side_validation && list_id.nil?
    fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.delete_list"
  end
  # resource path
  local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_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: ContactsApi#delete_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_attributes(opts = {}) ⇒ GetAttributes

List all attributes

Parameters:

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

    the optional parameters

Returns:



571
572
573
574
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 571

def get_attributes(opts = {})
  data, _status_code, _headers = get_attributes_with_http_info(opts)
  data
end

#get_attributes_with_http_info(opts = {}) ⇒ Array<(GetAttributes, Fixnum, Hash)>

List all attributes

Parameters:

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

    the optional parameters

Returns:

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

    GetAttributes data, response status code and response headers



579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 579

def get_attributes_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.get_attributes ...'
  end
  # resource path
  local_var_path = '/contacts/attributes'

  # 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 => 'GetAttributes')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#get_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_contact_info(identifier, opts = {}) ⇒ GetExtendedContactDetails

Get a contact’s details

Parameters:

  • identifier

    Email (urlencoded) OR ID of the contact OR its SMS attribute value

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

    the optional parameters

Returns:



618
619
620
621
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 618

def get_contact_info(identifier, opts = {})
  data, _status_code, _headers = get_contact_info_with_http_info(identifier, opts)
  data
end

#get_contact_info_with_http_info(identifier, opts = {}) ⇒ Array<(GetExtendedContactDetails, Fixnum, Hash)>

Get a contact&#39;s details

Parameters:

  • identifier

    Email (urlencoded) OR ID of the contact OR its SMS attribute value

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

    the optional parameters

Returns:

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

    GetExtendedContactDetails data, response status code and response headers



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

def get_contact_info_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.get_contact_info ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling ContactsApi.get_contact_info"
  end
  # resource path
  local_var_path = '/contacts/{identifier}'.sub('{' + 'identifier' + '}', identifier.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 => 'GetExtendedContactDetails')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#get_contact_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_contact_stats(identifier, opts = {}) ⇒ GetContactCampaignStats

Get email campaigns’ statistics for a contact

Parameters:

  • identifier

    Email (urlencoded) OR ID of the contact

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

    the optional parameters

Options Hash (opts):

  • :start_date (Date)

    Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate

  • :end_date (Date)

    Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate

Returns:



672
673
674
675
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 672

def get_contact_stats(identifier, opts = {})
  data, _status_code, _headers = get_contact_stats_with_http_info(identifier, opts)
  data
end

#get_contact_stats_with_http_info(identifier, opts = {}) ⇒ Array<(GetContactCampaignStats, Fixnum, Hash)>

Get email campaigns&#39; statistics for a contact

Parameters:

  • identifier

    Email (urlencoded) OR ID of the contact

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

    the optional parameters

Options Hash (opts):

  • :start_date (Date)

    Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate

  • :end_date (Date)

    Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate

Returns:

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

    GetContactCampaignStats data, response status code and response headers



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

def get_contact_stats_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.get_contact_stats ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling ContactsApi.get_contact_stats"
  end
  # resource path
  local_var_path = '/contacts/{identifier}/campaignStats'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].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 => 'GetContactCampaignStats')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#get_contact_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_contacts(opts = {}) ⇒ GetContacts

Get all the contacts

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page (default to 50)

  • :offset (Integer)

    Index of the first document of the page (default to 0)

  • :modified_since (DateTime)

    Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.

Returns:



730
731
732
733
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 730

def get_contacts(opts = {})
  data, _status_code, _headers = get_contacts_with_http_info(opts)
  data
end

#get_contacts_from_list(list_id, opts = {}) ⇒ GetContacts

Get contacts in a list

Parameters:

  • list_id

    Id of the list

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

    the optional parameters

Options Hash (opts):

  • :modified_since (DateTime)

    Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.

  • :limit (Integer)

    Number of documents per page (default to 50)

  • :offset (Integer)

    Index of the first document of the page (default to 0)

Returns:



790
791
792
793
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 790

def get_contacts_from_list(list_id, opts = {})
  data, _status_code, _headers = get_contacts_from_list_with_http_info(list_id, opts)
  data
end

#get_contacts_from_list_with_http_info(list_id, opts = {}) ⇒ Array<(GetContacts, Fixnum, Hash)>

Get contacts in a list

Parameters:

  • list_id

    Id of the list

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

    the optional parameters

Options Hash (opts):

  • :modified_since (DateTime)

    Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.

  • :limit (Integer)

    Number of documents per page

  • :offset (Integer)

    Index of the first document of the page

Returns:

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

    GetContacts data, response status code and response headers



802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 802

def get_contacts_from_list_with_http_info(list_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.get_contacts_from_list ...'
  end
  # verify the required parameter 'list_id' is set
  if @api_client.config.client_side_validation && list_id.nil?
    fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.get_contacts_from_list"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactsApi.get_contacts_from_list, must be smaller than or equal to 500.'
  end

  # resource path
  local_var_path = '/contacts/lists/{listId}/contacts'.sub('{' + 'listId' + '}', list_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].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 => 'GetContacts')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#get_contacts_from_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_contacts_with_http_info(opts = {}) ⇒ Array<(GetContacts, Fixnum, Hash)>

Get all the contacts

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page

  • :offset (Integer)

    Index of the first document of the page

  • :modified_since (DateTime)

    Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.

Returns:

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

    GetContacts data, response status code and response headers



741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 741

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

  # resource path
  local_var_path = '/contacts'

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].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 => 'GetContacts')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#get_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_folder(folder_id, opts = {}) ⇒ GetFolder

Returns a folder’s details

Parameters:

  • folder_id

    id of the folder

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

    the optional parameters

Returns:



852
853
854
855
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 852

def get_folder(folder_id, opts = {})
  data, _status_code, _headers = get_folder_with_http_info(folder_id, opts)
  data
end

#get_folder_lists(folder_id, opts = {}) ⇒ GetFolderLists

Get lists in a folder

Parameters:

  • folder_id

    Id of the folder

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page (default to 10)

  • :offset (Integer)

    Index of the first document of the page (default to 0)

Returns:



906
907
908
909
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 906

def get_folder_lists(folder_id, opts = {})
  data, _status_code, _headers = get_folder_lists_with_http_info(folder_id, opts)
  data
end

#get_folder_lists_with_http_info(folder_id, opts = {}) ⇒ Array<(GetFolderLists, Fixnum, Hash)>

Get lists in a folder

Parameters:

  • folder_id

    Id of the folder

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page

  • :offset (Integer)

    Index of the first document of the page

Returns:

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

    GetFolderLists data, response status code and response headers



917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 917

def get_folder_lists_with_http_info(folder_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.get_folder_lists ...'
  end
  # verify the required parameter 'folder_id' is set
  if @api_client.config.client_side_validation && folder_id.nil?
    fail ArgumentError, "Missing the required parameter 'folder_id' when calling ContactsApi.get_folder_lists"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 50
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactsApi.get_folder_lists, must be smaller than or equal to 50.'
  end

  # resource path
  local_var_path = '/contacts/folders/{folderId}/lists'.sub('{' + 'folderId' + '}', folder_id.to_s)

  # query parameters
  query_params = {}
  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 => 'GetFolderLists')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#get_folder_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_folder_with_http_info(folder_id, opts = {}) ⇒ Array<(GetFolder, Fixnum, Hash)>

Returns a folder&#39;s details

Parameters:

  • folder_id

    id of the folder

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

    the optional parameters

Returns:

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

    GetFolder data, response status code and response headers



861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 861

def get_folder_with_http_info(folder_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.get_folder ...'
  end
  # verify the required parameter 'folder_id' is set
  if @api_client.config.client_side_validation && folder_id.nil?
    fail ArgumentError, "Missing the required parameter 'folder_id' when calling ContactsApi.get_folder"
  end
  # resource path
  local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', folder_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 => 'GetFolder')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#get_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_folders(limit, offset, opts = {}) ⇒ GetFolders

Get all folders

Parameters:

  • limit

    Number of documents per page

  • offset

    Index of the first document of the page

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

    the optional parameters

Returns:



967
968
969
970
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 967

def get_folders(limit, offset, opts = {})
  data, _status_code, _headers = get_folders_with_http_info(limit, offset, opts)
  data
end

#get_folders_with_http_info(limit, offset, opts = {}) ⇒ Array<(GetFolders, Fixnum, Hash)>

Get all folders

Parameters:

  • limit

    Number of documents per page

  • offset

    Index of the first document of the page

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

    the optional parameters

Returns:

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

    GetFolders data, response status code and response headers



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

def get_folders_with_http_info(limit, offset, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.get_folders ...'
  end
  # verify the required parameter 'limit' is set
  if @api_client.config.client_side_validation && limit.nil?
    fail ArgumentError, "Missing the required parameter 'limit' when calling ContactsApi.get_folders"
  end
  if @api_client.config.client_side_validation && limit > 50
    fail ArgumentError, 'invalid value for "limit" when calling ContactsApi.get_folders, must be smaller than or equal to 50.'
  end

  # verify the required parameter 'offset' is set
  if @api_client.config.client_side_validation && offset.nil?
    fail ArgumentError, "Missing the required parameter 'offset' when calling ContactsApi.get_folders"
  end
  # resource path
  local_var_path = '/contacts/folders'

  # query parameters
  query_params = {}
  query_params[:'limit'] = limit
  query_params[:'offset'] = offset

  # 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 => 'GetFolders')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#get_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_list(list_id, opts = {}) ⇒ GetExtendedList

Get a list’s details

Parameters:

  • list_id

    Id of the list

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

    the optional parameters

Returns:



1030
1031
1032
1033
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1030

def get_list(list_id, opts = {})
  data, _status_code, _headers = get_list_with_http_info(list_id, opts)
  data
end

#get_list_with_http_info(list_id, opts = {}) ⇒ Array<(GetExtendedList, Fixnum, Hash)>

Get a list&#39;s details

Parameters:

  • list_id

    Id of the list

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

    the optional parameters

Returns:

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

    GetExtendedList data, response status code and response headers



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
1071
1072
1073
1074
1075
1076
1077
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1039

def get_list_with_http_info(list_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.get_list ...'
  end
  # verify the required parameter 'list_id' is set
  if @api_client.config.client_side_validation && list_id.nil?
    fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.get_list"
  end
  # resource path
  local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_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 => 'GetExtendedList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#get_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_lists(opts = {}) ⇒ GetLists

Get all the lists

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page (default to 10)

  • :offset (Integer)

    Index of the first document of the page (default to 0)

Returns:



1083
1084
1085
1086
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1083

def get_lists(opts = {})
  data, _status_code, _headers = get_lists_with_http_info(opts)
  data
end

#get_lists_with_http_info(opts = {}) ⇒ Array<(GetLists, Fixnum, Hash)>

Get all the lists

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of documents per page

  • :offset (Integer)

    Index of the first document of the page

Returns:

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

    GetLists data, response status code and response headers



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

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

  # resource path
  local_var_path = '/contacts/lists'

  # query parameters
  query_params = {}
  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 => 'GetLists')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#get_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#import_contacts(request_contact_import, opts = {}) ⇒ CreatedProcessId

Import contacts It returns the background process ID which on completion calls the notify URL that you have set in the input.

Parameters:

Returns:



1139
1140
1141
1142
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1139

def import_contacts(request_contact_import, opts = {})
  data, _status_code, _headers = import_contacts_with_http_info(request_contact_import, opts)
  data
end

#import_contacts_with_http_info(request_contact_import, opts = {}) ⇒ Array<(CreatedProcessId, Fixnum, Hash)>

Import contacts It returns the background process ID which on completion calls the notify URL that you have set in the input.

Parameters:

Returns:

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

    CreatedProcessId data, response status code and response headers



1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1149

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

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

#remove_contact_from_list(list_id, contact_emails, opts = {}) ⇒ PostContactInfo

Delete a contact from a list

Parameters:

  • list_id

    Id of the list

  • contact_emails

    Emails addresses OR IDs of the contacts

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

    the optional parameters

Returns:



1193
1194
1195
1196
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1193

def remove_contact_from_list(list_id, contact_emails, opts = {})
  data, _status_code, _headers = remove_contact_from_list_with_http_info(list_id, contact_emails, opts)
  data
end

#remove_contact_from_list_with_http_info(list_id, contact_emails, opts = {}) ⇒ Array<(PostContactInfo, Fixnum, Hash)>

Delete a contact from a list

Parameters:

  • list_id

    Id of the list

  • contact_emails

    Emails addresses OR IDs of the contacts

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

    the optional parameters

Returns:

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

    PostContactInfo data, response status code and response headers



1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1203

def remove_contact_from_list_with_http_info(list_id, contact_emails, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.remove_contact_from_list ...'
  end
  # verify the required parameter 'list_id' is set
  if @api_client.config.client_side_validation && list_id.nil?
    fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.remove_contact_from_list"
  end
  # verify the required parameter 'contact_emails' is set
  if @api_client.config.client_side_validation && contact_emails.nil?
    fail ArgumentError, "Missing the required parameter 'contact_emails' when calling ContactsApi.remove_contact_from_list"
  end
  # resource path
  local_var_path = '/contacts/lists/{listId}/contacts/remove'.sub('{' + 'listId' + '}', list_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(contact_emails)
  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 => 'PostContactInfo')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#remove_contact_from_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#request_contact_export(request_contact_export, opts = {}) ⇒ CreatedProcessId

Export contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv.

Parameters:

  • request_contact_export

    Values to request a contact export

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

    the optional parameters

Returns:



1251
1252
1253
1254
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1251

def request_contact_export(request_contact_export, opts = {})
  data, _status_code, _headers = request_contact_export_with_http_info(request_contact_export, opts)
  data
end

#request_contact_export_with_http_info(request_contact_export, opts = {}) ⇒ Array<(CreatedProcessId, Fixnum, Hash)>

Export contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv.

Parameters:

  • request_contact_export

    Values to request a contact export

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

    the optional parameters

Returns:

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

    CreatedProcessId data, response status code and response headers



1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1261

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

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

#update_attribute(attribute_category, attribute_name, update_attribute, opts = {}) ⇒ nil

Update contact attribute

Parameters:

  • attribute_category

    Category of the attribute

  • attribute_name

    Name of the existing attribute

  • update_attribute

    Values to update an attribute

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

    the optional parameters

Returns:

  • (nil)


1306
1307
1308
1309
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1306

def update_attribute(attribute_category, attribute_name, update_attribute, opts = {})
  update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts)
  nil
end

#update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update contact attribute

Parameters:

  • attribute_category

    Category of the attribute

  • attribute_name

    Name of the existing attribute

  • update_attribute

    Values to update an attribute

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1317

def update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.update_attribute ...'
  end
  # verify the required parameter 'attribute_category' is set
  if @api_client.config.client_side_validation && attribute_category.nil?
    fail ArgumentError, "Missing the required parameter 'attribute_category' when calling ContactsApi.update_attribute"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['category', 'calculated', 'global'].include?(attribute_category)
    fail ArgumentError, "invalid value for 'attribute_category', must be one of category, calculated, global"
  end
  # verify the required parameter 'attribute_name' is set
  if @api_client.config.client_side_validation && attribute_name.nil?
    fail ArgumentError, "Missing the required parameter 'attribute_name' when calling ContactsApi.update_attribute"
  end
  # verify the required parameter 'update_attribute' is set
  if @api_client.config.client_side_validation && update_attribute.nil?
    fail ArgumentError, "Missing the required parameter 'update_attribute' when calling ContactsApi.update_attribute"
  end
  # resource path
  local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.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_attribute)
  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: ContactsApi#update_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_contact(identifier, update_contact, opts = {}) ⇒ nil

Update a contact

Parameters:

  • identifier

    Email (urlencoded) OR ID of the contact

  • update_contact

    Values to update a contact

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

    the optional parameters

Returns:

  • (nil)


1372
1373
1374
1375
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1372

def update_contact(identifier, update_contact, opts = {})
  update_contact_with_http_info(identifier, update_contact, opts)
  nil
end

#update_contact_with_http_info(identifier, update_contact, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update a contact

Parameters:

  • identifier

    Email (urlencoded) OR ID of the contact

  • update_contact

    Values to update a contact

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1382

def update_contact_with_http_info(identifier, update_contact, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.update_contact ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling ContactsApi.update_contact"
  end
  # verify the required parameter 'update_contact' is set
  if @api_client.config.client_side_validation && update_contact.nil?
    fail ArgumentError, "Missing the required parameter 'update_contact' when calling ContactsApi.update_contact"
  end
  # resource path
  local_var_path = '/contacts/{identifier}'.sub('{' + 'identifier' + '}', identifier.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_contact)
  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: ContactsApi#update_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_folder(folder_id, update_folder, opts = {}) ⇒ nil

Update a folder

Parameters:

  • folder_id

    Id of the folder

  • update_folder

    Name of the folder

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

    the optional parameters

Returns:

  • (nil)


1429
1430
1431
1432
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1429

def update_folder(folder_id, update_folder, opts = {})
  update_folder_with_http_info(folder_id, update_folder, opts)
  nil
end

#update_folder_with_http_info(folder_id, update_folder, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update a folder

Parameters:

  • folder_id

    Id of the folder

  • update_folder

    Name of the folder

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1439

def update_folder_with_http_info(folder_id, update_folder, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.update_folder ...'
  end
  # verify the required parameter 'folder_id' is set
  if @api_client.config.client_side_validation && folder_id.nil?
    fail ArgumentError, "Missing the required parameter 'folder_id' when calling ContactsApi.update_folder"
  end
  # verify the required parameter 'update_folder' is set
  if @api_client.config.client_side_validation && update_folder.nil?
    fail ArgumentError, "Missing the required parameter 'update_folder' when calling ContactsApi.update_folder"
  end
  # resource path
  local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', folder_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_folder)
  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: ContactsApi#update_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_list(list_id, update_list, opts = {}) ⇒ nil

Update a list

Parameters:

  • list_id

    Id of the list

  • update_list

    Values to update a list

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

    the optional parameters

Returns:

  • (nil)


1486
1487
1488
1489
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1486

def update_list(list_id, update_list, opts = {})
  update_list_with_http_info(list_id, update_list, opts)
  nil
end

#update_list_with_http_info(list_id, update_list, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update a list

Parameters:

  • list_id

    Id of the list

  • update_list

    Values to update a list

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
# File 'lib/sib-api-v3-sdk/api/contacts_api.rb', line 1496

def update_list_with_http_info(list_id, update_list, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.update_list ...'
  end
  # verify the required parameter 'list_id' is set
  if @api_client.config.client_side_validation && list_id.nil?
    fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.update_list"
  end
  # verify the required parameter 'update_list' is set
  if @api_client.config.client_side_validation && update_list.nil?
    fail ArgumentError, "Missing the required parameter 'update_list' when calling ContactsApi.update_list"
  end
  # resource path
  local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_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_list)
  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: ContactsApi#update_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end