1
votes

I am using salesforce rest api to access the salesforce account from my rails app using databasedotcom gem.I created a remote access app and got the key and the id. I was able to authenticate the user and get the auth_token, instance_url and all that. But, when i send request at

@client.materialize("Account")

I get Session expired or invalid error

I have developer salesforce account.

please Can anybody help me with this ???

i'm authenticating the user with following request.......

@client.authenticate :token => token, :instance_url => "http://na1.salesforce.com"

1
Are you sure you're putting in the right value for token? It should be a long string beginning with 00D. Also, make sure the instance is correct -- only asking because na1 happens to be the instance used in the doc example so wanted to make sure it wasn't just copied and pasted. - ryanbrainard
yaah. i corrected the instance it is working now. - Bhushan Lodha
@BhushanLodha Hey Bhushan, Can you give some clarification on stackoverflow.com/questions/8945857/… - RAJ

1 Answers

1
votes

Change the instance_url to the instance url that is given.You can get your instance_url from the Oauth2 response. along with the access token it also has the instance_url