Method: Pipekit::Request#search_by_field
- Defined in:
- lib/pipekit/request.rb
#search_by_field(field:, value:) ⇒ Object
Public: Pipedrive /searchField API call.
type - Type of the field:
:person - person fields
:deal - deal fields
field - The name of the field.
If it's the custom field the id of the field should be stored in `config/pipedrive.yml`.
value - The value of the field.
Examples
search_by_field(field: :cohort, value: 119)
search_by_field(field: :github_username, value: "octocat")
Returns an array of Response objects or throws a ResourceNotFoundError if it couldn’t find anything.
This also uses the “request_all_pages” config option when set to do multiple requests, getting around Pipedrive’s pagination
37 38 39 40 41 |
# File 'lib/pipekit/request.rb', line 37 def search_by_field(field:, value:) query = search_by_field_query(field, value) get_request("/searchResults/field", query).response end |