Class: Norbelys::PeopleApi

Inherits:
Object
  • Object
show all
Defined in:
lib/norbelys/api/people_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PeopleApi

Returns a new instance of PeopleApi.



19
20
21
# File 'lib/norbelys/api/people_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/norbelys/api/people_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#people_archive(id, opts = {}) ⇒ Person

Archive a person

Parameters:

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

    the optional parameters

Returns:



26
27
28
29
# File 'lib/norbelys/api/people_api.rb', line 26

def people_archive(id, opts = {})
  data, _status_code, _headers = people_archive_with_http_info(id, opts)
  data
end

#people_archive_with_http_info(id, opts = {}) ⇒ Array<(Person, Integer, Hash)>

Archive a person

Parameters:

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

    the optional parameters

Returns:

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

    Person data, response status code and response headers



35
36
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
80
81
# File 'lib/norbelys/api/people_api.rb', line 35

def people_archive_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PeopleApi.people_archive ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PeopleApi.people_archive"
  end
  # resource path
  local_var_path = '/people/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"PeopleApi.people_archive",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#people_archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#people_audience_summary(scope, opts = {}) ⇒ AudienceSummary

Get audience summary Summarize the whole workspace, one group, or one segment: exact people total, lifecycle mix, recent engagement, average score, and a 12-week audience-arrival series.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :group_id (String)
  • :segment_id (String)

Returns:



90
91
92
93
# File 'lib/norbelys/api/people_api.rb', line 90

def people_audience_summary(scope, opts = {})
  data, _status_code, _headers = people_audience_summary_with_http_info(scope, opts)
  data
end

#people_audience_summary_with_http_info(scope, opts = {}) ⇒ Array<(AudienceSummary, Integer, Hash)>

Get audience summary Summarize the whole workspace, one group, or one segment: exact people total, lifecycle mix, recent engagement, average score, and a 12-week audience-arrival series.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :group_id (String)
  • :segment_id (String)

Returns:

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

    AudienceSummary data, response status code and response headers



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
147
# File 'lib/norbelys/api/people_api.rb', line 102

def people_audience_summary_with_http_info(scope, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PeopleApi.people_audience_summary ...'
  end
  # resource path
  local_var_path = '/people/audience-summary'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'scope'] = scope
  query_params[:'groupId'] = opts[:'group_id'] if !opts[:'group_id'].nil?
  query_params[:'segmentId'] = opts[:'segment_id'] if !opts[:'segment_id'].nil?

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"PeopleApi.people_audience_summary",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#people_audience_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#people_bulk_create(people_bulk_create_params, opts = {}) ⇒ PeopleBulkCreateResult

Bulk create people (verifies + suppresses in the background; optional group / campaign)

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:



154
155
156
157
# File 'lib/norbelys/api/people_api.rb', line 154

def people_bulk_create(people_bulk_create_params, opts = {})
  data, _status_code, _headers = people_bulk_create_with_http_info(people_bulk_create_params, opts)
  data
end

#people_bulk_create_with_http_info(people_bulk_create_params, opts = {}) ⇒ Array<(PeopleBulkCreateResult, Integer, Hash)>

Bulk create people (verifies + suppresses in the background; optional group / campaign)

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:

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

    PeopleBulkCreateResult data, response status code and response headers



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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/norbelys/api/people_api.rb', line 164

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

  # resource path
  local_var_path = '/people/bulk'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"PeopleApi.people_bulk_create",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#people_bulk_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#people_create(person_create_params, opts = {}) ⇒ Person

Create a person Add one person (a lead) to the CRM. email is required; anything beyond the system fields rides in customFields keyed by code. To insert many at once, use bulkCreate instead.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:



228
229
230
231
# File 'lib/norbelys/api/people_api.rb', line 228

def people_create(person_create_params, opts = {})
  data, _status_code, _headers = people_create_with_http_info(person_create_params, opts)
  data
end

#people_create_with_http_info(person_create_params, opts = {}) ⇒ Array<(Person, Integer, Hash)>

Create a person Add one person (a lead) to the CRM. `email` is required; anything beyond the system fields rides in `customFields` keyed by code. To insert many at once, use bulkCreate instead.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:

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

    Person data, response status code and response headers



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

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

  # resource path
  local_var_path = '/people'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"PeopleApi.people_create",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#people_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#people_erase(id, opts = {}) ⇒ PersonErased

Erase a person (GDPR) Permanently scrub this person's PII and redact their inbound messages — the ONE true hard delete (distinct from archive/DELETE, which only soft-archives and keeps the data). Irreversible; use for a GDPR erasure request.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:



303
304
305
306
# File 'lib/norbelys/api/people_api.rb', line 303

def people_erase(id, opts = {})
  data, _status_code, _headers = people_erase_with_http_info(id, opts)
  data
end

#people_erase_with_http_info(id, opts = {}) ⇒ Array<(PersonErased, Integer, Hash)>

Erase a person (GDPR) Permanently scrub this person's PII and redact their inbound messages — the ONE true hard delete (distinct from archive/DELETE, which only soft-archives and keeps the data). Irreversible; use for a GDPR erasure request.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Opt-in idempotency for a safely retried write: reuse the same key to replay the original result for 24h instead of re-executing. Recommended on every POST.

Returns:

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

    PersonErased data, response status code and response headers



314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/norbelys/api/people_api.rb', line 314

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

  # resource path
  local_var_path = '/people/{id}/erase'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"PeopleApi.people_erase",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#people_erase\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#people_find(id, opts = {}) ⇒ PersonDetail

Get a person Read one person. Pass expand[]=timeline for their merged sent/received messages, expand[]=enrollments for campaign memberships, expand[]=groups for their static lists, and/or expand[]=segments for dynamic audiences they currently match.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:



373
374
375
376
# File 'lib/norbelys/api/people_api.rb', line 373

def people_find(id, opts = {})
  data, _status_code, _headers = people_find_with_http_info(id, opts)
  data
end

#people_find_with_http_info(id, opts = {}) ⇒ Array<(PersonDetail, Integer, Hash)>

Get a person Read one person. Pass `expand=timeline` for their merged sent/received messages, `expand=enrollments` for campaign memberships, `expand=groups` for their static lists, and/or `expand=segments` for dynamic audiences they currently match.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:

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

    PersonDetail data, response status code and response headers



384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/norbelys/api/people_api.rb', line 384

def people_find_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PeopleApi.people_find ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PeopleApi.people_find"
  end
  allowable_values = ["timeline", "enrollments", "groups", "segments"]
  if @api_client.config.client_side_validation && opts[:'expand'] && !opts[:'expand'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"expand\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/people/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :csv) if !opts[:'expand'].nil?

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"PeopleApi.people_find",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#people_find\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#people_get_bulk(id, opts = {}) ⇒ PersonImportStats

Get a bulk import's verify stats (sendable / suppressed / pending)

Parameters:

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

    the optional parameters

Returns:



441
442
443
444
# File 'lib/norbelys/api/people_api.rb', line 441

def people_get_bulk(id, opts = {})
  data, _status_code, _headers = people_get_bulk_with_http_info(id, opts)
  data
end

#people_get_bulk_with_http_info(id, opts = {}) ⇒ Array<(PersonImportStats, Integer, Hash)>

Get a bulk import's verify stats (sendable / suppressed / pending)

Parameters:

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

    the optional parameters

Returns:

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

    PersonImportStats data, response status code and response headers



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
488
489
490
491
492
493
494
495
496
# File 'lib/norbelys/api/people_api.rb', line 450

def people_get_bulk_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PeopleApi.people_get_bulk ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PeopleApi.people_get_bulk"
  end
  # resource path
  local_var_path = '/people/bulk/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"PeopleApi.people_get_bulk",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#people_get_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#people_list(opts = {}) ⇒ PersonList

List people List the org's people (its CRM leads); total is the full match count. Filter by status, source, group, or segment, or pass a live filter rule tree to preview a draft segment. Cursor callers remain newest-first; page-based callers can sort by creation, name, email, last activity, or engagement score.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)
  • :include_archived (Boolean)
  • :dir (String)
  • :filter (AudienceFilter)
  • :group_id (String)
  • :limit (Integer)
  • :page (Integer)
  • :search (String)
  • :segment_id (String)
  • :sort (String)
  • :source (Array<String>)
  • :status (Array<String>)

Returns:



514
515
516
517
# File 'lib/norbelys/api/people_api.rb', line 514

def people_list(opts = {})
  data, _status_code, _headers = people_list_with_http_info(opts)
  data
end

#people_list_with_http_info(opts = {}) ⇒ Array<(PersonList, Integer, Hash)>

List people List the org's people (its CRM leads); `total` is the full match count. Filter by status, source, group, or segment, or pass a live `filter` rule tree to preview a draft segment. Cursor callers remain newest-first; page-based callers can sort by creation, name, email, last activity, or engagement score.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)
  • :include_archived (Boolean)
  • :dir (String)
  • :filter (AudienceFilter)
  • :group_id (String)
  • :limit (Integer)
  • :page (Integer)
  • :search (String)
  • :segment_id (String)
  • :sort (String)
  • :source (Array<String>)
  • :status (Array<String>)

Returns:

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

    PersonList data, response status code and response headers



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
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
# File 'lib/norbelys/api/people_api.rb', line 535

def people_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PeopleApi.people_list ...'
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'dir'] && !allowable_values.include?(opts[:'dir'])
    fail ArgumentError, "invalid value for \"dir\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PeopleApi.people_list, must be smaller than or equal to 500.'
  end

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

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

  allowable_values = ["created_at", "email", "last_activity_at", "name", "score"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["csv_import", "manual", "api", "form", "inbound", "integration"]
  if @api_client.config.client_side_validation && opts[:'source'] && !opts[:'source'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"source\", must include one of #{allowable_values}"
  end
  allowable_values = ["active", "replied", "bounced", "unsubscribed", "finished"]
  if @api_client.config.client_side_validation && opts[:'status'] && !opts[:'status'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"status\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/people'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil?
  query_params[:'dir'] = opts[:'dir'] if !opts[:'dir'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'groupId'] = opts[:'group_id'] if !opts[:'group_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'segmentId'] = opts[:'segment_id'] if !opts[:'segment_id'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'source'] = @api_client.build_collection_param(opts[:'source'], :csv) if !opts[:'source'].nil?
  query_params[:'status'] = @api_client.build_collection_param(opts[:'status'], :csv) if !opts[:'status'].nil?

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

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

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

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

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

  new_options = opts.merge(
    :operation => :"PeopleApi.people_list",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#people_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#people_update(id, opts = {}) ⇒ PersonDetail

Update a person Patch a person's editable fields; only the fields you send change. Note that customFields replaces the entire custom-field bag — send the full set, not a partial delta.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



625
626
627
628
# File 'lib/norbelys/api/people_api.rb', line 625

def people_update(id, opts = {})
  data, _status_code, _headers = people_update_with_http_info(id, opts)
  data
end

#people_update_with_http_info(id, opts = {}) ⇒ Array<(PersonDetail, Integer, Hash)>

Update a person Patch a person's editable fields; only the fields you send change. Note that `customFields` replaces the entire custom-field bag — send the full set, not a partial delta.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    PersonDetail data, response status code and response headers



636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# File 'lib/norbelys/api/people_api.rb', line 636

def people_update_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PeopleApi.people_update ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PeopleApi.people_update"
  end
  # resource path
  local_var_path = '/people/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

  new_options = opts.merge(
    :operation => :"PeopleApi.people_update",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PeopleApi#people_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end