restforce to your
Gemfile, then run
bundle install (or install it manually with
gem 'restforce', '~> 2.4.0'
# Don't commit your authentication details with your code - use environment variables <3 export SALESFORCE_USERNAME="username" export SALESFORCE_PASSWORD="password" export SALESFORCE_SECURITY_TOKEN="security token" export SALESFORCE_CLIENT_ID="client id" export SALESFORCE_CLIENT_SECRET="client secret"
client = Restforce.new
3. Query Salesforce like an absolute pro.
my_leads = client.query("SELECT Id, Source FROM Lead where OwnerId = 'INSERT_USER_ID_HERE'") # => #<Restforce::Collection >
SALESFORCE_API_VERSIONenvironment variable. (changelog)
300is returned due to an external ID matching multiple records for an upsert operation. (changelog)
Restforce::ServerErrorwhen Salesforce is experiencing problems, and improves the handling of the response body in errors. (changelog)
If you have any questions, contact Tim Rogers, the maintainer.
Want help using Restforce, with contributing, or have another question?