This gem provides a simple way to download report data from It works well with any ruby applications, include such as Ruby on Rails.

You can access using only your salesforce login id (=email) and password. A security token is no need.

Data will be saved in CSV format.



Add this line to your application's Gemfile:

gem 'salesforce_http_client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install salesforce_http_client

Configuring SalesforceHttpClient

Add configurations to set your login_id/password. You must check your instance to get the right domain for your account. For example:, where '' is the instance domain.

require 'fileutils'
require 'httpclient'

SalesforceHttpClient.configure do |config|
  config.salesforce_login_id = 'my_login_id_or_email'
  config.salesforce_password = 'my_password'
  # this parameter must be set if you are not using the default ( instance domain of this gem.
  config.salesforce_instance_domain = ''

If you're using Rails, create an initializer for this:


Downloading report from

First, you need find the salesforce ID for your report. For example:, where '000000000000ABC' is the salesforce ID.

Then, pass the salesforce ID and a file path to SalesforceHttpClient::Client#download_report(salesforce_id, report_save_path) method.

salesforce_id = '000000000000ABC'
report_save_path = "tmp/#{salesforce_id}.csv"

sf_client =
sf_client.download_report(salesforce_id, report_save_path)

After a few seconds, you will find your report data(csv format) at report_save_path.