You need to sign in to do that
Don't have an account?
Varankaushish
Ruby on Rails REST API Error
While getting response back from SFDC, im getting following error message.
OAuth2::HTTPError in OauthController#callback
Received HTTP 400 during request.
I'm using REST API & Rails 3, Apache as reverse proxy & OAuth2 on window machine.
Help
Thanks
Varun
Have you checked out the following recipe:
http://developer.force.com/cookbook/recipe/interact-with-the-forcecom-rest-api-from-ruby
All Answers
A http resp. Code of 400 indicates a bad request. I suspect you have an error in your http get syntax. Can you paste in the GET request you are making? Im assuming you have already authenticated correctly?
Yes, you are correct, I'm done with authentication part. Here's the get request.
I don't believe the JSON payload of an access token contains a 'me' attribute:
{"id":"abc","issued_at":"1296500081178","refresh_token":"mytoken",
"instance_url":"https://prerelna1.pre.salesforce.com","signature":"abc","access_token":"myaccesstoken"}
Hi Varankaushish,
I'm trying to develop a Rails solution using the Ruby OAuth gem; looks like you're doing the same thing. I'm having problems setting up the request token code, and it seems you've gotten further through the process. Can you post your code that does this? For example, I currently have:
Have you checked out the following recipe:
http://developer.force.com/cookbook/recipe/interact-with-the-forcecom-rest-api-from-ruby
No, I hadn't seen that, and it seems to have answered all my questions. Thanks very much!
Aaron.
While that recipe did help immensely, I'm now hung up on making the actual request, just like the topic of this post. I've responded to a similar thread that is now more recent -- http://boards.developerforce.com/t5/Perl-PHP-Python-Ruby-Development/Ruby-and-OAuth/td-p/242279 -- which contains the details of my issue.