Skip to content

Instantly share code, notes, and snippets.

@iaintshine
Created September 16, 2015 18:46
Show Gist options
  • Save iaintshine/1f0a5dcf9d1bb68b1e3f to your computer and use it in GitHub Desktop.
Save iaintshine/1f0a5dcf9d1bb68b1e3f to your computer and use it in GitHub Desktop.
BaseCRM Ruby gem - sample code that shows how to filter by custom field value
require 'bundler'
Bundler.setup
require 'logger'
require 'basecrm'
access_token = "BASECRM_ACCESS_TOKEN"
client = BaseCRM::Client.new(access_token: access_token,
verbose: true,
logger: Logger.new(STDOUT))
result = client.deals.where({
custom_fields: {
filterable_custom_field: "test"
}
})
puts result
result = client.deals.where({
"custom_fields[filterable_custom_field]" => "test"
})
puts result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment