Salesforce API integration with Rails app
Salesforce is known to be a Customer Relationship Management (CRM) platform and it provides cloud-based applications for Sales, Service & Marketing. This article intends to develop a clearer understanding on the Salesforce API and how you can sync data between Salesforce and your Rails application.
The following steps are required to be followed to integrate Salesforce API with your Rails application:
Use Rails gem “restforce” — https://github.com/ejholmes/restforce
Installation
Add gem ‘restforce’, ‘~> 2.5.3’ into your Gemfile
Run ‘bundle install’ or ‘gem install restforce’
Configuration
In your application.yml, set the following env variables –
SALESFORCE_USERNAME: “username”
SALESFORCE_PASSWORD: “password”
SALESFORCE_SECURITY_TOKEN: “security token”
SALESFORCE_CLIENT_ID: “client id”
SALESFORCE_CLIENT_SECRET: “client secret”
SALESFORCE_HOST: “host domain name”
SALESFORCE_API_VERSION=”38.0″
Try to connect to salesforce run “sf = Restforce.new”
https://www.railscarma.com/blog/technical-articles/salesforce-api-integration-rails-app/