1

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"

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Bhushan Lodha
  • 6,824
  • 7
  • 62
  • 100
  • 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 Jan 30 '12 at 09:11
  • yaah. i corrected the instance it is working now. – Bhushan Lodha Jan 31 '12 at 06:27
  • @BhushanLodha Hey Bhushan, Can you give some clarification on http://stackoverflow.com/questions/8945857/salesforce-error-invalid-cross-reference-id – RAJ Apr 12 '13 at 09:58

1 Answers1

1

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

yatish mehta
  • 905
  • 1
  • 10
  • 25