class Pipedrive::LeadsApi
Attributes
Public Class Methods
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Get all lead labels Returns details of all Lead Labels. This endpoint does not support pagination and all Labels are always returned. @param [Hash] opts the optional parameters @return [InlineResponse2006]
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 26 def lead_labels_get(opts = {}) data, _status_code, _headers = lead_labels_get_with_http_info(opts) data end
Get all lead labels Returns details of all Lead Labels. This endpoint does not support pagination and all Labels are always returned. @param [Hash] opts the optional parameters @return [Array<(InlineResponse2006
, Integer, Hash)>] InlineResponse2006
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 35 def lead_labels_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LeadsApi.lead_labels_get ...' end # resource path local_var_path = '/leadLabels' # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2006' # 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: LeadsApi#lead_labels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a lead label Deletes a specific Lead Label @param id [String] The ID of the Lead Label @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 83 def lead_labels_id_delete(id, opts = {}) lead_labels_id_delete_with_http_info(id, opts) nil end
Delete a lead label Deletes a specific Lead Label @param id [String] The ID of the Lead Label @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 93 def lead_labels_id_delete_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LeadsApi.lead_labels_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 LeadsApi.lead_labels_id_delete" end # resource path local_var_path = '/leadLabels/{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: LeadsApi#lead_labels_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get one lead label Returns details of a specific Lead Label @param id [String] The ID of the Lead Label @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 143 def lead_labels_id_get(id, opts = {}) lead_labels_id_get_with_http_info(id, opts) nil end
Get one lead label Returns details of a specific Lead Label @param id [String] The ID of the Lead Label @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 153 def lead_labels_id_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LeadsApi.lead_labels_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 LeadsApi.lead_labels_id_get" end # resource path local_var_path = '/leadLabels/{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']) # 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: LeadsApi#lead_labels_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update a lead label Updates one or more properties of a Lead Label. Only properties included in the request will be updated. @param id [String] The ID of the Lead Label @param [Hash] opts the optional parameters @option opts [InlineObject17] :inline_object17 @return [nil]
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 206 def lead_labels_id_patch(id, opts = {}) lead_labels_id_patch_with_http_info(id, opts) nil end
Update a lead label Updates one or more properties of a Lead Label. Only properties included in the request will be updated. @param id [String] The ID of the Lead Label @param [Hash] opts the optional parameters @option opts [InlineObject17] :inline_object17 @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 217 def lead_labels_id_patch_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LeadsApi.lead_labels_id_patch ...' 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 LeadsApi.lead_labels_id_patch" end # resource path local_var_path = '/leadLabels/{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[:'inline_object17']) # 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(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: LeadsApi#lead_labels_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add a lead label Creates a Lead Label @param [Hash] opts the optional parameters @option opts [InlineObject16] :inline_object16 @return [InlineResponse2007]
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 269 def lead_labels_post(opts = {}) data, _status_code, _headers = lead_labels_post_with_http_info(opts) data end
Add a lead label Creates a Lead Label @param [Hash] opts the optional parameters @option opts [InlineObject16] :inline_object16 @return [Array<(InlineResponse2007
, Integer, Hash)>] InlineResponse2007
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 279 def lead_labels_post_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LeadsApi.lead_labels_post ...' end # resource path local_var_path = '/leadLabels' # 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']) # 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[:'inline_object16']) # return_type return_type = opts[:return_type] || 'InlineResponse2007' # 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: LeadsApi#lead_labels_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get all lead sources Returns all Lead Sources. Please note that the list of Lead Sources is fixed, it cannot be modified. All Leads created through the Public Pipedrive
API will have a Lead Source `API` assigned. @param [Hash] opts the optional parameters @return [InlineResponse2008]
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 328 def lead_sources_get(opts = {}) data, _status_code, _headers = lead_sources_get_with_http_info(opts) data end
Get all lead sources Returns all Lead Sources. Please note that the list of Lead Sources is fixed, it cannot be modified. All Leads created through the Public Pipedrive
API will have a Lead Source `API` assigned. @param [Hash] opts the optional parameters @return [Array<(InlineResponse2008
, Integer, Hash)>] InlineResponse2008
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 337 def lead_sources_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LeadsApi.lead_sources_get ...' end # resource path local_var_path = '/leadSources' # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2008' # 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: LeadsApi#lead_sources_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get all leads Returns multiple Leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. @param [Hash] opts the optional parameters @option opts [Integer] :limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. @option opts [Integer] :start For pagination, the position that represents the first result for the page @option opts [String] :archived_status Filtering based on archived status of a Lead. If not provided, `All` is used. @return [InlineResponse2004]
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 387 def leads_get(opts = {}) data, _status_code, _headers = leads_get_with_http_info(opts) data end
Get all leads Returns multiple Leads. Leads are sorted by the time they were created, from oldest to newest. Pagination can be controlled using `limit` and `start` query parameters. @param [Hash] opts the optional parameters @option opts [Integer] :limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. @option opts [Integer] :start For pagination, the position that represents the first result for the page @option opts [String] :archived_status Filtering based on archived status of a Lead. If not provided, `All` is used. @return [Array<(InlineResponse2004
, Integer, Hash)>] InlineResponse2004
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 399 def leads_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LeadsApi.leads_get ...' end allowable_values = ["archived", "not_archived", "all"] if @api_client.config.client_side_validation && opts[:'archived_status'] && !allowable_values.include?(opts[:'archived_status']) fail ArgumentError, "invalid value for \"archived_status\", must be one of #{allowable_values}" end # resource path local_var_path = '/leads' # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'archived_status'] = opts[:'archived_status'] if !opts[:'archived_status'].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] || 'InlineResponse2004' # 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: LeadsApi#leads_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a lead Deletes a specific Lead @param id [String] The ID of the Lead @param [Hash] opts the optional parameters @return [InlineResponse2005]
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 454 def leads_id_delete(id, opts = {}) data, _status_code, _headers = leads_id_delete_with_http_info(id, opts) data end
Delete a lead Deletes a specific Lead @param id [String] The ID of the Lead @param [Hash] opts the optional parameters @return [Array<(InlineResponse2005
, Integer, Hash)>] InlineResponse2005
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 464 def leads_id_delete_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LeadsApi.leads_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 LeadsApi.leads_id_delete" end # resource path local_var_path = '/leads/{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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2005' # 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: LeadsApi#leads_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get one lead Returns details of a specific Lead @param id [String] The ID of the Lead @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 516 def leads_id_get(id, opts = {}) leads_id_get_with_http_info(id, opts) nil end
Get one lead Returns details of a specific Lead @param id [String] The ID of the Lead @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 526 def leads_id_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LeadsApi.leads_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 LeadsApi.leads_id_get" end # resource path local_var_path = '/leads/{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']) # 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: LeadsApi#leads_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update a lead Updates one or more properties of a Lead. Only properties included in the request will be updated. Send `null` to unset a property (applicable for example for `value`, `person_id` or `organization_id`). @param id [String] The ID of the Lead @param [Hash] opts the optional parameters @option opts [InlineObject15] :inline_object15 @return [nil]
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 579 def leads_id_patch(id, opts = {}) leads_id_patch_with_http_info(id, opts) nil end
Update a lead Updates one or more properties of a Lead. Only properties included in the request will be updated. Send `null` to unset a property (applicable for example for `value`, `person_id` or `organization_id`). @param id [String] The ID of the Lead @param [Hash] opts the optional parameters @option opts [InlineObject15] :inline_object15 @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 590 def leads_id_patch_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LeadsApi.leads_id_patch ...' 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 LeadsApi.leads_id_patch" end # resource path local_var_path = '/leads/{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[:'inline_object15']) # 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(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: LeadsApi#leads_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add a lead Creates a Lead. A Lead always has to be linked to a Person or an Organization or both. All Leads created through the Public Pipedrive
API will have a Lead Source `API` assigned. @param [Hash] opts the optional parameters @option opts [InlineObject14] :inline_object14 @return [InlineResponse201]
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 642 def leads_post(opts = {}) data, _status_code, _headers = leads_post_with_http_info(opts) data end
Add a lead Creates a Lead. A Lead always has to be linked to a Person or an Organization or both. All Leads created through the Public Pipedrive
API will have a Lead Source `API` assigned. @param [Hash] opts the optional parameters @option opts [InlineObject14] :inline_object14 @return [Array<(InlineResponse201
, Integer, Hash)>] InlineResponse201
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/leads_api.rb, line 652 def leads_post_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LeadsApi.leads_post ...' end # resource path local_var_path = '/leads' # 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']) # 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[:'inline_object14']) # return_type return_type = opts[:return_type] || 'InlineResponse201' # 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: LeadsApi#leads_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end