[英]salesforce sandbox integration in rails, error expired access
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". 我正在使用Ruby Gem“ databascdotcom”将Salesforce集成到Rails应用程序中,并且一切正常,直到我使用沙箱帐户类型“仅配置”尝试它为止。
The following code work fine when i used with salesforce product account. 当我与Salesforce产品帐户一起使用时,以下代码可以正常工作。 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" 但是,当我尝试将其与具有用户名“ foo@bar.com.sandbox”的salesforce沙箱帐户一起使用时,出现以下错误“访问/刷新令牌过期”
Any ideas? 有任何想法吗?
Got the issue. 有问题。
Just need to add 只需添加
host= "test.salesforce.com" 主机= “test.salesforce.com”
Thanks All 谢谢大家
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.