class Pipedrive::SearchResultsApi
Attributes
Public Class Methods
# File lib/pipedrive-openapi-client/api/search_results_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Perform a search using a specific field value <strong>This endpoint is deprecated. Please use <a href="/v1/itemSearch/fielddevelopers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch_field">/v1/itemSearch/field> instead</strong>.
Performs a search from a specific field's values. Results can be either the distinct values of the field (useful for searching autocomplete field values), or actual items IDs (deals, persons, organizations or products). @param term [String] Search term to look for, minimum 2 characters. @param field_type [String] Type of the field to perform the search from. @param field_key [String] Key of the field to search from. Field key can be obtained by fetching the list of fields using any of fields API GET methods (dealFields, personFields, ..). @param [Hash] opts the optional parameters @option opts [NumberBoolean] :exact_match When enabled, only full exact matches against the given term are returned. By default, term can be present anywhere in the resulting field values to be considered a match. The minimum 2 character limit for the term is discarded when exact_match is enabled. @option opts [String] :return_field_key Name of the field in search results from which the search was performed. When omitted, 'value' will be used. You may want to set this parameter to match the field_key. @option opts [NumberBoolean] :return_item_ids Whether to return matching items IDs in search results. When omitted or set to 0, only distinct values of the searched field are returned. When enabled, the return_field_key parameter is ignored and the results include the searched field as its own key. @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @return [nil]
# File lib/pipedrive-openapi-client/api/search_results_api.rb, line 34 def search_results_field_get(term, field_type, field_key, opts = {}) search_results_field_get_with_http_info(term, field_type, field_key, opts) nil end
Perform a search using a specific field value <strong>This endpoint is deprecated. Please use <a href="developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch_field">/v1/itemSearch/field</a> instead</strong>. <br> Performs a search from a specific field's values. Results can be either the distinct values of the field (useful for searching autocomplete field values), or actual items IDs (deals, persons, organizations or products). @param term [String] Search term to look for, minimum 2 characters. @param field_type [String] Type of the field to perform the search from. @param field_key [String] Key of the field to search from. Field key can be obtained by fetching the list of fields using any of fields API GET methods (dealFields, personFields, ..). @param [Hash] opts the optional parameters @option opts [NumberBoolean] :exact_match When enabled, only full exact matches against the given term are returned. By default, term can be present anywhere in the resulting field values to be considered a match. The minimum 2 character limit for the term is discarded when exact_match is enabled. @option opts [String] :return_field_key Name of the field in search results from which the search was performed. When omitted, 'value' will be used. You may want to set this parameter to match the field_key. @option opts [NumberBoolean] :return_item_ids Whether to return matching items IDs in search results. When omitted or set to 0, only distinct values of the searched field are returned. When enabled, the return_field_key parameter is ignored and the results include the searched field as its own key. @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/search_results_api.rb, line 51 def search_results_field_get_with_http_info(term, field_type, field_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SearchResultsApi.search_results_field_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 SearchResultsApi.search_results_field_get" end # verify the required parameter 'field_type' is set if @api_client.config.client_side_validation && field_type.nil? fail ArgumentError, "Missing the required parameter 'field_type' when calling SearchResultsApi.search_results_field_get" end # verify enum value allowable_values = ["dealField", "personField", "organizationField", "productField"] if @api_client.config.client_side_validation && !allowable_values.include?(field_type) fail ArgumentError, "invalid value for \"field_type\", must be one of #{allowable_values}" end # verify the required parameter 'field_key' is set if @api_client.config.client_side_validation && field_key.nil? fail ArgumentError, "Missing the required parameter 'field_key' when calling SearchResultsApi.search_results_field_get" end # resource path local_var_path = '/searchResults/field' # query parameters query_params = opts[:query_params] || {} query_params[:'term'] = term query_params[:'field_type'] = field_type query_params[:'field_key'] = field_key query_params[:'exact_match'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? query_params[:'return_field_key'] = opts[:'return_field_key'] if !opts[:'return_field_key'].nil? query_params[:'return_item_ids'] = opts[:'return_item_ids'] if !opts[:'return_item_ids'].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] || {} # 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: SearchResultsApi#search_results_field_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Perform a search <strong>This endpoint is deprecated. Please use <a href="/v1/itemSearchdevelopers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch> instead</strong>.
Performs a search across the account and returns SearchResults. @param term [String] Search term to look for, minimum 2 characters. @param [Hash] opts the optional parameters @option opts [String] :item_type Search for items of exact type. If omitted, all types of items are searched. @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :exact_match When enabled, only full exact matches against the given term are returned. The minimum 2 character limit for the term is discarded when exact_match is enabled. It will only work if search term is 30 characters or less. @return [nil]
# File lib/pipedrive-openapi-client/api/search_results_api.rb, line 126 def search_results_get(term, opts = {}) search_results_get_with_http_info(term, opts) nil end
Perform a search <strong>This endpoint is deprecated. Please use <a href="developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch</a> instead</strong>. <br> Performs a search across the account and returns SearchResults. @param term [String] Search term to look for, minimum 2 characters. @param [Hash] opts the optional parameters @option opts [String] :item_type Search for items of exact type. If omitted, all types of items are searched. @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :exact_match When enabled, only full exact matches against the given term are returned. The minimum 2 character limit for the term is discarded when exact_match is enabled. It will only work if search term is 30 characters or less. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/search_results_api.rb, line 140 def search_results_get_with_http_info(term, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SearchResultsApi.search_results_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 SearchResultsApi.search_results_get" end allowable_values = ["deal", "person", "organization", "product", "file"] if @api_client.config.client_side_validation && opts[:'item_type'] && !allowable_values.include?(opts[:'item_type']) fail ArgumentError, "invalid value for \"item_type\", must be one of #{allowable_values}" end # resource path local_var_path = '/searchResults' # query parameters query_params = opts[:query_params] || {} query_params[:'term'] = term query_params[:'item_type'] = opts[:'item_type'] if !opts[:'item_type'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'exact_match'] = opts[:'exact_match'] if !opts[:'exact_match'].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: SearchResultsApi#search_results_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end