class Pipedrive::PipelinesApi
Attributes
Public Class Methods
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Get all pipelines Returns data about all pipelines @param [Hash] opts the optional parameters @return [GetAllPipelines]
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 26 def pipelines_get(opts = {}) data, _status_code, _headers = pipelines_get_with_http_info(opts) data end
Get all pipelines Returns data about all pipelines @param [Hash] opts the optional parameters @return [Array<(GetAllPipelines
, Integer, Hash)>] GetAllPipelines
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 35 def pipelines_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_get ...' end # resource path local_var_path = '/pipelines' # 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] || 'GetAllPipelines' # 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: PipelinesApi#pipelines_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get deals conversion rates in pipeline Returns all stage-to-stage conversion and pipeline-to-close rates for given time period. @param id [Integer] ID of the pipeline @param start_date [Date] Start of the period. Date in format of YYYY-MM-DD. @param end_date [Date] End of the period. Date in format of YYYY-MM-DD. @param [Hash] opts the optional parameters @option opts [Integer] :user_id ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. @return [GetDealsConversionRatesInPipeline]
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 86 def pipelines_id_conversion_statistics_get(id, start_date, end_date, opts = {}) data, _status_code, _headers = pipelines_id_conversion_statistics_get_with_http_info(id, start_date, end_date, opts) data end
Get deals conversion rates in pipeline Returns all stage-to-stage conversion and pipeline-to-close rates for given time period. @param id [Integer] ID of the pipeline @param start_date [Date] Start of the period. Date in format of YYYY-MM-DD. @param end_date [Date] End of the period. Date in format of YYYY-MM-DD. @param [Hash] opts the optional parameters @option opts [Integer] :user_id ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. @return [Array<(GetDealsConversionRatesInPipeline
, Integer, Hash)>] GetDealsConversionRatesInPipeline
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 99 def pipelines_id_conversion_statistics_get_with_http_info(id, start_date, end_date, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_id_conversion_statistics_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 PipelinesApi.pipelines_id_conversion_statistics_get" end # verify the required parameter 'start_date' is set if @api_client.config.client_side_validation && start_date.nil? fail ArgumentError, "Missing the required parameter 'start_date' when calling PipelinesApi.pipelines_id_conversion_statistics_get" end # verify the required parameter 'end_date' is set if @api_client.config.client_side_validation && end_date.nil? fail ArgumentError, "Missing the required parameter 'end_date' when calling PipelinesApi.pipelines_id_conversion_statistics_get" end # resource path local_var_path = '/pipelines/{id}/conversion_statistics'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'start_date'] = start_date query_params[:'end_date'] = end_date query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].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] || 'GetDealsConversionRatesInPipeline' # 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: PipelinesApi#pipelines_id_conversion_statistics_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get deals in a pipeline Lists deals in a specific pipeline across all its stages @param id [Integer] ID of the pipeline @param [Hash] opts the optional parameters @option opts [Integer] :filter_id If supplied, only deals matching the given filter will be returned. @option opts [Integer] :user_id If supplied, filter_id will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. @option opts [NumberBoolean] :everyone If supplied, filter_id and user_id will not be considered – instead, deals owned by everyone will be returned. @option opts [Integer] :stage_id If supplied, only deals within the given stage will be returned. @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :get_summary Whether to include summary of the pipeline in the additional_data or not. @option opts [String] :totals_convert_currency 3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned inside deals_summary inside additional_data which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to 'default_currency' in which case users default currency is used. Only works when get_summary parameter flag is enabled. @return [GetStageDeals]
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 170 def pipelines_id_deals_get(id, opts = {}) data, _status_code, _headers = pipelines_id_deals_get_with_http_info(id, opts) data end
Get deals in a pipeline Lists deals in a specific pipeline across all its stages @param id [Integer] ID of the pipeline @param [Hash] opts the optional parameters @option opts [Integer] :filter_id If supplied, only deals matching the given filter will be returned. @option opts [Integer] :user_id If supplied, filter_id will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. @option opts [NumberBoolean] :everyone If supplied, filter_id and user_id will not be considered – instead, deals owned by everyone will be returned. @option opts [Integer] :stage_id If supplied, only deals within the given stage will be returned. @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :get_summary Whether to include summary of the pipeline in the additional_data or not. @option opts [String] :totals_convert_currency 3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned inside deals_summary inside additional_data which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to 'default_currency' in which case users default currency is used. Only works when get_summary parameter flag is enabled. @return [Array<(GetStageDeals
, Integer, Hash)>] GetStageDeals
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 188 def pipelines_id_deals_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_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 PipelinesApi.pipelines_id_deals_get" end # resource path local_var_path = '/pipelines/{id}/deals'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'filter_id'] = opts[:'filter_id'] if !opts[:'filter_id'].nil? query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].nil? query_params[:'everyone'] = opts[:'everyone'] if !opts[:'everyone'].nil? query_params[:'stage_id'] = opts[:'stage_id'] if !opts[:'stage_id'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'get_summary'] = opts[:'get_summary'] if !opts[:'get_summary'].nil? query_params[:'totals_convert_currency'] = opts[:'totals_convert_currency'] if !opts[:'totals_convert_currency'].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] || 'GetStageDeals' # 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: PipelinesApi#pipelines_id_deals_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a pipeline Marks a pipeline as deleted. @param id [Integer] ID of the pipeline @param [Hash] opts the optional parameters @return [InlineResponse2009]
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 248 def pipelines_id_delete(id, opts = {}) data, _status_code, _headers = pipelines_id_delete_with_http_info(id, opts) data end
Delete a pipeline Marks a pipeline as deleted. @param id [Integer] ID of the pipeline @param [Hash] opts the optional parameters @return [Array<(InlineResponse2009
, Integer, Hash)>] InlineResponse2009
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 258 def pipelines_id_delete_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_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 PipelinesApi.pipelines_id_delete" end # resource path local_var_path = '/pipelines/{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] || 'InlineResponse2009' # 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: PipelinesApi#pipelines_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get one pipeline Returns data about a specific pipeline. Also returns the summary of the deals in this pipeline across its stages. @param id [Integer] ID of the pipeline @param [Hash] opts the optional parameters @option opts [String] :totals_convert_currency 3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned in deals_summary which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to 'default_currency' in which case users default currency is used. @return [GetOnePipeline]
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 311 def pipelines_id_get(id, opts = {}) data, _status_code, _headers = pipelines_id_get_with_http_info(id, opts) data end
Get one pipeline Returns data about a specific pipeline. Also returns the summary of the deals in this pipeline across its stages. @param id [Integer] ID of the pipeline @param [Hash] opts the optional parameters @option opts [String] :totals_convert_currency 3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned in deals_summary which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to 'default_currency' in which case users default currency is used. @return [Array<(GetOnePipeline
, Integer, Hash)>] GetOnePipeline
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 322 def pipelines_id_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_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 PipelinesApi.pipelines_id_get" end # resource path local_var_path = '/pipelines/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'totals_convert_currency'] = opts[:'totals_convert_currency'] if !opts[:'totals_convert_currency'].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] || 'GetOnePipeline' # 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: PipelinesApi#pipelines_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get deals movements in pipeline Returns statistics for deals movements for given time period. @param id [Integer] ID of the pipeline @param start_date [Date] Start of the period. Date in format of YYYY-MM-DD. @param end_date [Date] End of the period. Date in format of YYYY-MM-DD. @param [Hash] opts the optional parameters @option opts [Integer] :user_id ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used. @return [GetDealsMovementsInPipeline]
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 378 def pipelines_id_movement_statistics_get(id, start_date, end_date, opts = {}) data, _status_code, _headers = pipelines_id_movement_statistics_get_with_http_info(id, start_date, end_date, opts) data end
Get deals movements in pipeline Returns statistics for deals movements for given time period. @param id [Integer] ID of the pipeline @param start_date [Date] Start of the period. Date in format of YYYY-MM-DD. @param end_date [Date] End of the period. Date in format of YYYY-MM-DD. @param [Hash] opts the optional parameters @option opts [Integer] :user_id ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used. @return [Array<(GetDealsMovementsInPipeline
, Integer, Hash)>] GetDealsMovementsInPipeline
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 391 def pipelines_id_movement_statistics_get_with_http_info(id, start_date, end_date, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_id_movement_statistics_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 PipelinesApi.pipelines_id_movement_statistics_get" end # verify the required parameter 'start_date' is set if @api_client.config.client_side_validation && start_date.nil? fail ArgumentError, "Missing the required parameter 'start_date' when calling PipelinesApi.pipelines_id_movement_statistics_get" end # verify the required parameter 'end_date' is set if @api_client.config.client_side_validation && end_date.nil? fail ArgumentError, "Missing the required parameter 'end_date' when calling PipelinesApi.pipelines_id_movement_statistics_get" end # resource path local_var_path = '/pipelines/{id}/movement_statistics'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'start_date'] = start_date query_params[:'end_date'] = end_date query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].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] || 'GetDealsMovementsInPipeline' # 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: PipelinesApi#pipelines_id_movement_statistics_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Edit a pipeline Updates pipeline properties @param id [Integer] ID of the pipeline @param [Hash] opts the optional parameters @option opts [String] :name The name of the Pipeline
@option opts [NumberBoolean] :deal_probability @option opts [Integer] :order_nr Defines the order of Pipelines. First order (order_nr=0) is the default Pipeline
. @option opts [NumberBoolean] :active @return [EditPipeline]
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 458 def pipelines_id_put(id, opts = {}) data, _status_code, _headers = pipelines_id_put_with_http_info(id, opts) data end
Edit a pipeline Updates pipeline properties @param id [Integer] ID of the pipeline @param [Hash] opts the optional parameters @option opts [String] :name The name of the Pipeline
@option opts [NumberBoolean] :deal_probability @option opts [Integer] :order_nr Defines the order of Pipelines. First order (order_nr=0) is the default Pipeline
. @option opts [NumberBoolean] :active @return [Array<(EditPipeline
, Integer, Hash)>] EditPipeline
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 472 def pipelines_id_put_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_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 PipelinesApi.pipelines_id_put" end # resource path local_var_path = '/pipelines/{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']) # 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['name'] = opts[:'name'] if !opts[:'name'].nil? form_params['deal_probability'] = opts[:'deal_probability'] if !opts[:'deal_probability'].nil? form_params['order_nr'] = opts[:'order_nr'] if !opts[:'order_nr'].nil? form_params['active'] = opts[:'active'] if !opts[:'active'].nil? # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'EditPipeline' # 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: PipelinesApi#pipelines_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add a new pipeline Adds a new pipeline @param [Hash] opts the optional parameters @option opts [String] :name The name of the Pipeline
@option opts [NumberBoolean] :deal_probability @option opts [Integer] :order_nr Defines the order of Pipelines. First order (order_nr=0) is the default Pipeline
. @option opts [NumberBoolean] :active @return [AddNewPipeline]
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 533 def pipelines_post(opts = {}) data, _status_code, _headers = pipelines_post_with_http_info(opts) data end
Add a new pipeline Adds a new pipeline @param [Hash] opts the optional parameters @option opts [String] :name The name of the Pipeline
@option opts [NumberBoolean] :deal_probability @option opts [Integer] :order_nr Defines the order of Pipelines. First order (order_nr=0) is the default Pipeline
. @option opts [NumberBoolean] :active @return [Array<(AddNewPipeline
, Integer, Hash)>] AddNewPipeline
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/pipelines_api.rb, line 546 def pipelines_post_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PipelinesApi.pipelines_post ...' end # resource path local_var_path = '/pipelines' # 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/x-www-form-urlencoded']) # form parameters form_params = opts[:form_params] || {} form_params['name'] = opts[:'name'] if !opts[:'name'].nil? form_params['deal_probability'] = opts[:'deal_probability'] if !opts[:'deal_probability'].nil? form_params['order_nr'] = opts[:'order_nr'] if !opts[:'order_nr'].nil? form_params['active'] = opts[:'active'] if !opts[:'active'].nil? # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'AddNewPipeline' # 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: PipelinesApi#pipelines_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end