0

I am using the Ruby Gem "databascdotcom" to integrate Salesforce in a Rails app and all works fine until i try it with sandbox account type "Configuration Only".

The following code work fine when i used with salesforce product account. Here is my code

def SalesForceFeed
   @oppID = params[:oppid]

    client = Databasedotcom::Client.new client.client_id #=> foo client.client_secret #=> bar
    client.authenticate :username => "foo@bar.com", :password => "ThePasswordTheSecurityToken" #=> "the-oauth-token"
    client.materialize("Opportunity")
    begin
         @client=SalesForce::Connection.new.client
         @opp = Opportunity.find_by_Id(@oppID)
    rescue Exception=>e
end 

But when i try to use it with salesforce sandbox account with username like "foo@bar.com.sandbox" I m getting following error "expired access/refresh token"

Any ideas?

Anil D
  • 1,989
  • 6
  • 29
  • 60

1 Answers1

0

Got the issue.

Just need to add

host= "test.salesforce.com"

Thanks All

Anil D
  • 1,989
  • 6
  • 29
  • 60