Class: Pipedrive::PersonsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/pipedrive-openapi-client/api/persons_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PersonsApi

Returns a new instance of PersonsApi.



19
20
21
# File 'lib/pipedrive-openapi-client/api/persons_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/pipedrive-openapi-client/api/persons_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#persons_delete(opts = {}) ⇒ nil

Delete multiple persons in bulk Marks multiple persons as deleted.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :ids (String)

    Comma-separated IDs that will be deleted

Returns:

  • (nil)


27
28
29
30
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 27

def persons_delete(opts = {})
  persons_delete_with_http_info(opts)
  nil
end

#persons_delete_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete multiple persons in bulk Marks multiple persons as deleted.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :ids (String)

    Comma-separated IDs that will be deleted

Returns:

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

    nil, 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
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 37

def persons_delete_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_delete ...'
  end
  # resource path
  local_var_path = '/persons'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = opts[:'ids'] if !opts[:'ids'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_find_get(term, opts = {}) ⇒ nil

Find persons by name <strong>This endpoint is deprecated. Please use <a href="developers.pipedrive.com/docs/api/v1/#!/Persons/get_persons_search">/v1/persons/search</a> or <a href="developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch</a> instead</strong>.
Searches all persons by their name.

Parameters:

  • term (String)

    Search term to look for

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

    the optional parameters

Options Hash (opts):

  • :org_id (Integer)

    ID of the organization person is associated with.

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

  • :search_by_email (NumberBoolean)

    When enabled, term will only be matched against email addresses of people. Default: false

Returns:

  • (nil)


88
89
90
91
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 88

def persons_find_get(term, opts = {})
  persons_find_get_with_http_info(term, opts)
  nil
end

#persons_find_get_with_http_info(term, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Find persons by name &lt;strong&gt;This endpoint is deprecated. Please use &lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/Persons/get_persons_search&quot;&gt;/v1/persons/search&lt;/a&gt; or &lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch&quot;&gt;/v1/itemSearch&lt;/a&gt; instead&lt;/strong&gt;. &lt;br&gt; Searches all persons by their name.

Parameters:

  • term (String)

    Search term to look for

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

    the optional parameters

Options Hash (opts):

  • :org_id (Integer)

    ID of the organization person is associated with.

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

  • :search_by_email (NumberBoolean)

    When enabled, term will only be matched against email addresses of people. Default: false

Returns:

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

    nil, 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
148
149
150
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 102

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'term'] = term
  query_params[:'org_id'] = opts[:'org_id'] if !opts[:'org_id'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'search_by_email'] = opts[:'search_by_email'] if !opts[:'search_by_email'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_get(opts = {}) ⇒ nil

Get all persons Returns all persons

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :user_id (Integer)

    If supplied, only persons owned by the given user will be returned.

  • :filter_id (Integer)

    ID of the filter to use.

  • :first_char (String)

    If supplied, only persons whose name starts with the specified letter will be returned (case insensitive).

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

  • :sort (String)

    Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys).

Returns:

  • (nil)


162
163
164
165
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 162

def persons_get(opts = {})
  persons_get_with_http_info(opts)
  nil
end

#persons_get_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Get all persons Returns all persons

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :user_id (Integer)

    If supplied, only persons owned by the given user will be returned.

  • :filter_id (Integer)

    ID of the filter to use.

  • :first_char (String)

    If supplied, only persons whose name starts with the specified letter will be returned (case insensitive).

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

  • :sort (String)

    Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys).

Returns:

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

    nil, response status code and response headers



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
221
222
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 177

def persons_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_get ...'
  end
  # resource path
  local_var_path = '/persons'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'filter_id'] = opts[:'filter_id'] if !opts[:'filter_id'].nil?
  query_params[:'first_char'] = opts[:'first_char'] if !opts[:'first_char'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_id_activities_get(id, opts = {}) ⇒ nil

List activities associated with a person Lists activities associated with a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

  • :done (NumberBoolean)

    Whether the activity is done or not. 0 &#x3D; Not done, 1 &#x3D; Done. If omitted returns both Done and Not done activities.

  • :exclude (String)

    A comma-separated string of activity IDs to exclude from result

Returns:

  • (nil)


233
234
235
236
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 233

def persons_id_activities_get(id, opts = {})
  persons_id_activities_get_with_http_info(id, opts)
  nil
end

#persons_id_activities_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

List activities associated with a person Lists activities associated with a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

  • :done (NumberBoolean)

    Whether the activity is done or not. 0 &#x3D; Not done, 1 &#x3D; Done. If omitted returns both Done and Not done activities.

  • :exclude (String)

    A comma-separated string of activity IDs to exclude from result

Returns:

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

    nil, response status code and response headers



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
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 247

def persons_id_activities_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_activities_get ...'
  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 PersonsApi.persons_id_activities_get"
  end
  # resource path
  local_var_path = '/persons/{id}/activities'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'done'] = opts[:'done'] if !opts[:'done'].nil?
  query_params[:'exclude'] = opts[:'exclude'] if !opts[:'exclude'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_id_deals_get(id, opts = {}) ⇒ nil

List deals associated with a person Lists deals associated with a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

  • :status (String)

    Only fetch deals with specific status. If omitted, all not deleted deals are fetched. (default to ‘all_not_deleted’)

  • :sort (String)

    Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys).

Returns:

  • (nil)


305
306
307
308
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 305

def persons_id_deals_get(id, opts = {})
  persons_id_deals_get_with_http_info(id, opts)
  nil
end

#persons_id_deals_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

List deals associated with a person Lists deals associated with a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

  • :status (String)

    Only fetch deals with specific status. If omitted, all not deleted deals are fetched.

  • :sort (String)

    Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys).

Returns:

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

    nil, response status code and response headers



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
366
367
368
369
370
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 319

def persons_id_deals_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_deals_get ...'
  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 PersonsApi.persons_id_deals_get"
  end
  allowable_values = ["open", "won", "lost", "deleted", "all_not_deleted"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/persons/{id}/deals'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_id_delete(id, opts = {}) ⇒ nil

Delete a person Marks a person as deleted.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Returns:

  • (nil)


377
378
379
380
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 377

def persons_id_delete(id, opts = {})
  persons_id_delete_with_http_info(id, opts)
  nil
end

#persons_id_delete_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a person Marks a person as deleted.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 387

def persons_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_delete ...'
  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 PersonsApi.persons_id_delete"
  end
  # resource path
  local_var_path = '/persons/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_id_files_get(id, opts = {}) ⇒ nil

List files attached to a person Lists files associated with a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

  • :include_deleted_files (NumberBoolean)

    When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work.

  • :sort (String)

    Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment.

Returns:

  • (nil)


441
442
443
444
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 441

def persons_id_files_get(id, opts = {})
  persons_id_files_get_with_http_info(id, opts)
  nil
end

#persons_id_files_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

List files attached to a person Lists files associated with a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

  • :include_deleted_files (NumberBoolean)

    When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work.

  • :sort (String)

    Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment.

Returns:

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

    nil, response status code and response headers



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
497
498
499
500
501
502
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 455

def persons_id_files_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_files_get ...'
  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 PersonsApi.persons_id_files_get"
  end
  # resource path
  local_var_path = '/persons/{id}/files'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'include_deleted_files'] = opts[:'include_deleted_files'] if !opts[:'include_deleted_files'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_id_flow_get(id, opts = {}) ⇒ nil

List updates about a person Lists updates about a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

  • :all_changes (String)

    Whether to show custom field updates or not. 1 &#x3D; Include custom field changes. If omitted returns changes without custom field updates.

  • :items (String)

    A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document)

Returns:

  • (nil)


513
514
515
516
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 513

def persons_id_flow_get(id, opts = {})
  persons_id_flow_get_with_http_info(id, opts)
  nil
end

#persons_id_flow_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

List updates about a person Lists updates about a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

  • :all_changes (String)

    Whether to show custom field updates or not. 1 &#x3D; Include custom field changes. If omitted returns changes without custom field updates.

  • :items (String)

    A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document)

Returns:

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

    nil, response status code and response headers



527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 527

def persons_id_flow_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_flow_get ...'
  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 PersonsApi.persons_id_flow_get"
  end
  # resource path
  local_var_path = '/persons/{id}/flow'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'all_changes'] = opts[:'all_changes'] if !opts[:'all_changes'].nil?
  query_params[:'items'] = opts[:'items'] if !opts[:'items'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_id_followers_follower_id_delete(id, follower_id, opts = {}) ⇒ nil

Deletes a follower from a person. Delete a follower from a person

Parameters:

  • id (Integer)

    ID of a person

  • follower_id (Integer)

    ID of the follower

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

    the optional parameters

Returns:

  • (nil)


582
583
584
585
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 582

def persons_id_followers_follower_id_delete(id, follower_id, opts = {})
  persons_id_followers_follower_id_delete_with_http_info(id, follower_id, opts)
  nil
end

#persons_id_followers_follower_id_delete_with_http_info(id, follower_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Deletes a follower from a person. Delete a follower from a person

Parameters:

  • id (Integer)

    ID of a person

  • follower_id (Integer)

    ID of the follower

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 593

def persons_id_followers_follower_id_delete_with_http_info(id, follower_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_followers_follower_id_delete ...'
  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 PersonsApi.persons_id_followers_follower_id_delete"
  end
  # verify the required parameter 'follower_id' is set
  if @api_client.config.client_side_validation && follower_id.nil?
    fail ArgumentError, "Missing the required parameter 'follower_id' when calling PersonsApi.persons_id_followers_follower_id_delete"
  end
  # resource path
  local_var_path = '/persons/{id}/followers/{follower_id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'follower_id' + '}', CGI.escape(follower_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key']

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

#persons_id_followers_get(id, opts = {}) ⇒ nil

List followers of a person Lists the followers of a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Returns:

  • (nil)


647
648
649
650
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 647

def persons_id_followers_get(id, opts = {})
  persons_id_followers_get_with_http_info(id, opts)
  nil
end

#persons_id_followers_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

List followers of a person Lists the followers of a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 657

def persons_id_followers_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_followers_get ...'
  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 PersonsApi.persons_id_followers_get"
  end
  # resource path
  local_var_path = '/persons/{id}/followers'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_id_followers_post(id, user_id, opts = {}) ⇒ nil

Add a follower to a person Adds a follower to a person.

Parameters:

  • id (Integer)

    ID of a person

  • user_id (Integer)

    ID of the user

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

    the optional parameters

Returns:

  • (nil)


708
709
710
711
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 708

def persons_id_followers_post(id, user_id, opts = {})
  persons_id_followers_post_with_http_info(id, user_id, opts)
  nil
end

#persons_id_followers_post_with_http_info(id, user_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Add a follower to a person Adds a follower to a person.

Parameters:

  • id (Integer)

    ID of a person

  • user_id (Integer)

    ID of the user

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 719

def persons_id_followers_post_with_http_info(id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_followers_post ...'
  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 PersonsApi.persons_id_followers_post"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling PersonsApi.persons_id_followers_post"
  end
  # resource path
  local_var_path = '/persons/{id}/followers'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_id_get(id, opts = {}) ⇒ nil

Get details of a person Returns details of a person. Note that this also returns some additional fields which are not present when asking for all persons. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the ‘key’ value of personFields.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Returns:

  • (nil)


776
777
778
779
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 776

def persons_id_get(id, opts = {})
  persons_id_get_with_http_info(id, opts)
  nil
end

#persons_id_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Get details of a person Returns details of a person. Note that this also returns some additional fields which are not present when asking for all persons. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the &#39;key&#39; value of personFields.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 786

def persons_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_get ...'
  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 PersonsApi.persons_id_get"
  end
  # resource path
  local_var_path = '/persons/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_id_mail_messages_get(id, opts = {}) ⇒ nil

List mail messages associated with a person Lists mail messages associated with a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

Returns:

  • (nil)


838
839
840
841
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 838

def persons_id_mail_messages_get(id, opts = {})
  persons_id_mail_messages_get_with_http_info(id, opts)
  nil
end

#persons_id_mail_messages_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

List mail messages associated with a person Lists mail messages associated with a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

Returns:

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

    nil, response status code and response headers



850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 850

def persons_id_mail_messages_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_mail_messages_get ...'
  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 PersonsApi.persons_id_mail_messages_get"
  end
  # resource path
  local_var_path = '/persons/{id}/mailMessages'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_id_merge_put(id, merge_with_id, opts = {}) ⇒ nil

Merge two persons Merges a person with another person. For more information on how to merge two persons, see <a href="pipedrive.readme.io/docs/merging-two-persons" target="_blank" rel="noopener noreferrer">this tutorial</a>.

Parameters:

  • id (Integer)

    ID of a person

  • merge_with_id (Integer)

    The ID of the Person that will not be overwritten. This Person’s data will be prioritized in case of conflict with the other Person.

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

    the optional parameters

Returns:

  • (nil)


903
904
905
906
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 903

def persons_id_merge_put(id, merge_with_id, opts = {})
  persons_id_merge_put_with_http_info(id, merge_with_id, opts)
  nil
end

#persons_id_merge_put_with_http_info(id, merge_with_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Merge two persons Merges a person with another person. For more information on how to merge two persons, see &lt;a href&#x3D;&quot;pipedrive.readme.io/docs/merging-two-persons&quot; target&#x3D;&quot;_blank&quot; rel&#x3D;&quot;noopener noreferrer&quot;&gt;this tutorial&lt;/a&gt;.

Parameters:

  • id (Integer)

    ID of a person

  • merge_with_id (Integer)

    The ID of the Person that will not be overwritten. This Person’s data will be prioritized in case of conflict with the other Person.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

def persons_id_merge_put_with_http_info(id, merge_with_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_merge_put ...'
  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 PersonsApi.persons_id_merge_put"
  end
  # verify the required parameter 'merge_with_id' is set
  if @api_client.config.client_side_validation && merge_with_id.nil?
    fail ArgumentError, "Missing the required parameter 'merge_with_id' when calling PersonsApi.persons_id_merge_put"
  end
  # resource path
  local_var_path = '/persons/{id}/merge'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PersonsApi#persons_id_merge_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#persons_id_permitted_users_get(id, opts = {}) ⇒ nil

List permitted users List users permitted to access a person

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Returns:

  • (nil)


971
972
973
974
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 971

def persons_id_permitted_users_get(id, opts = {})
  persons_id_permitted_users_get_with_http_info(id, opts)
  nil
end

#persons_id_permitted_users_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

List permitted users List users permitted to access a person

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 981

def persons_id_permitted_users_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_permitted_users_get ...'
  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 PersonsApi.persons_id_permitted_users_get"
  end
  # resource path
  local_var_path = '/persons/{id}/permittedUsers'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key']

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

#persons_id_picture_delete(id, opts = {}) ⇒ nil

Delete person picture Delete person picture

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Returns:

  • (nil)


1031
1032
1033
1034
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 1031

def persons_id_picture_delete(id, opts = {})
  persons_id_picture_delete_with_http_info(id, opts)
  nil
end

#persons_id_picture_delete_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete person picture Delete person picture

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
1078
1079
1080
1081
1082
1083
1084
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 1041

def persons_id_picture_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_picture_delete ...'
  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 PersonsApi.persons_id_picture_delete"
  end
  # resource path
  local_var_path = '/persons/{id}/picture'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_id_picture_post(id, file, opts = {}) ⇒ nil

Add person picture Add a picture to a person. If a picture is already set, the old picture will be replaced. Added image (or the cropping parameters supplied with the request) should have an equal width and height and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized to 128 and 512 pixel wide squares.

Parameters:

  • id (Integer)

    ID of a person

  • file (File)

    One image supplied in the multipart/form-data encoding.

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

    the optional parameters

Options Hash (opts):

  • :crop_x (Integer)

    X coordinate to where start cropping form (in pixels)

  • :crop_y (Integer)

    Y coordinate to where start cropping form (in pixels)

  • :crop_width (Integer)

    Width of cropping area (in pixels)

  • :crop_height (Integer)

    Height of cropping area (in pixels)

Returns:

  • (nil)


1096
1097
1098
1099
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 1096

def persons_id_picture_post(id, file, opts = {})
  persons_id_picture_post_with_http_info(id, file, opts)
  nil
end

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

Add person picture Add a picture to a person. If a picture is already set, the old picture will be replaced. Added image (or the cropping parameters supplied with the request) should have an equal width and height and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized to 128 and 512 pixel wide squares.

Parameters:

  • id (Integer)

    ID of a person

  • file (File)

    One image supplied in the multipart/form-data encoding.

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

    the optional parameters

Options Hash (opts):

  • :crop_x (Integer)

    X coordinate to where start cropping form (in pixels)

  • :crop_y (Integer)

    Y coordinate to where start cropping form (in pixels)

  • :crop_width (Integer)

    Width of cropping area (in pixels)

  • :crop_height (Integer)

    Height of cropping area (in pixels)

Returns:

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

    nil, response status code and response headers



1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 1111

def persons_id_picture_post_with_http_info(id, file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_picture_post ...'
  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 PersonsApi.persons_id_picture_post"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling PersonsApi.persons_id_picture_post"
  end
  # resource path
  local_var_path = '/persons/{id}/picture'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['file'] = file
  form_params['crop_x'] = opts[:'crop_x'] if !opts[:'crop_x'].nil?
  form_params['crop_y'] = opts[:'crop_y'] if !opts[:'crop_y'].nil?
  form_params['crop_width'] = opts[:'crop_width'] if !opts[:'crop_width'].nil?
  form_params['crop_height'] = opts[:'crop_height'] if !opts[:'crop_height'].nil?

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_id_products_get(id, opts = {}) ⇒ nil

List products associated with a person Lists products associated with a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start (default to 0)

  • :limit (Integer)

    Items shown per page

Returns:

  • (nil)


1174
1175
1176
1177
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 1174

def persons_id_products_get(id, opts = {})
  persons_id_products_get_with_http_info(id, opts)
  nil
end

#persons_id_products_get_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

List products associated with a person Lists products associated with a person.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

  • :start (Integer)

    Pagination start

  • :limit (Integer)

    Items shown per page

Returns:

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

    nil, response status code and response headers



1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 1186

def persons_id_products_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_products_get ...'
  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 PersonsApi.persons_id_products_get"
  end
  # resource path
  local_var_path = '/persons/{id}/products'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key']

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

#persons_id_put(id, opts = {}) ⇒ nil

Update a person Updates the properties of a person. For more information on how to update a person, see <a href="pipedrive.readme.io/docs/updating-a-person" target="_blank" rel="noopener noreferrer">this tutorial</a>.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


1239
1240
1241
1242
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 1239

def persons_id_put(id, opts = {})
  persons_id_put_with_http_info(id, opts)
  nil
end

#persons_id_put_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update a person Updates the properties of a person. For more information on how to update a person, see &lt;a href&#x3D;&quot;pipedrive.readme.io/docs/updating-a-person&quot; target&#x3D;&quot;_blank&quot; rel&#x3D;&quot;noopener noreferrer&quot;&gt;this tutorial&lt;/a&gt;.

Parameters:

  • id (Integer)

    ID of a person

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

    the optional parameters

Options Hash (opts):

Returns:

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

    nil, response status code and response headers



1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 1250

def persons_id_put_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_id_put ...'
  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 PersonsApi.persons_id_put"
  end
  # resource path
  local_var_path = '/persons/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

  new_options = opts.merge(
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PersonsApi#persons_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#persons_post(opts = {}) ⇒ nil

Add a person Adds a new person. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the personFields and look for ‘key’ values.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


1302
1303
1304
1305
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 1302

def persons_post(opts = {})
  persons_post_with_http_info(opts)
  nil
end

#persons_post_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Add a person Adds a new person. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the personFields and look for &#39;key&#39; values.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    nil, response status code and response headers



1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 1312

def persons_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_post ...'
  end
  # resource path
  local_var_path = '/persons'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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

#persons_search_get(term, opts = {}) ⇒ BaseResponse

Search persons Searches all Persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of <a href="developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch</a> with a narrower OAuth scope. Found Persons can be filtered by Organization ID.

Parameters:

  • term (String)

    The search term to look for. Minimum 2 characters (or 1 if using exact_match).

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    A comma-separated string array. The fields to perform the search from. Defaults to all of them.

  • :exact_match (Boolean)

    When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.

  • :organization_id (Integer)

    Will filter Deals by the provided Organization ID. The upper limit of found Deals associated with the Organization is 2000.

  • :include_fields (String)

    Supports including optional fields in the results which are not provided by default.

  • :start (Integer)

    Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. (default to 0)

  • :limit (Integer)

    Items shown per page

Returns:



1366
1367
1368
1369
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 1366

def persons_search_get(term, opts = {})
  data, _status_code, _headers = persons_search_get_with_http_info(term, opts)
  data
end

#persons_search_get_with_http_info(term, opts = {}) ⇒ Array<(BaseResponse, Integer, Hash)>

Search persons Searches all Persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of &lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch&quot;&gt;/v1/itemSearch&lt;/a&gt; with a narrower OAuth scope. Found Persons can be filtered by Organization ID.

Parameters:

  • term (String)

    The search term to look for. Minimum 2 characters (or 1 if using exact_match).

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    A comma-separated string array. The fields to perform the search from. Defaults to all of them.

  • :exact_match (Boolean)

    When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.

  • :organization_id (Integer)

    Will filter Deals by the provided Organization ID. The upper limit of found Deals associated with the Organization is 2000.

  • :include_fields (String)

    Supports including optional fields in the results which are not provided by default.

  • :start (Integer)

    Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter.

  • :limit (Integer)

    Items shown per page

Returns:

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

    BaseResponse data, 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
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
# File 'lib/pipedrive-openapi-client/api/persons_api.rb', line 1382

def persons_search_get_with_http_info(term, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PersonsApi.persons_search_get ...'
  end
  # verify the required parameter 'term' is set
  if @api_client.config.client_side_validation && term.nil?
    fail ArgumentError, "Missing the required parameter 'term' when calling PersonsApi.persons_search_get"
  end
  allowable_values = ["custom_fields", "email", "notes", "phone", "name"]
  if @api_client.config.client_side_validation && opts[:'fields'] && !allowable_values.include?(opts[:'fields'])
    fail ArgumentError, "invalid value for \"fields\", must be one of #{allowable_values}"
  end
  allowable_values = ["true", "false"]
  if @api_client.config.client_side_validation && opts[:'exact_match'] && !allowable_values.include?(opts[:'exact_match'])
    fail ArgumentError, "invalid value for \"exact_match\", must be one of #{allowable_values}"
  end
  allowable_values = ["person.picture"]
  if @api_client.config.client_side_validation && opts[:'include_fields'] && !allowable_values.include?(opts[:'include_fields'])
    fail ArgumentError, "invalid value for \"include_fields\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/persons/search'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'term'] = term
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
  query_params[:'exact_match'] = opts[:'exact_match'] if !opts[:'exact_match'].nil?
  query_params[:'organization_id'] = opts[:'organization_id'] if !opts[:'organization_id'].nil?
  query_params[:'include_fields'] = opts[:'include_fields'] if !opts[:'include_fields'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'BaseResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key', 'oauth2']

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