3

I am a newbie to Salesforce, currently developing an application which will be used by our clients. One feature of the application is, it should receive data from our remote server for each client and update/insert a record in Salesforce for that client. I am not sure how to go about doing this.

I looked into Salesforce REST API (http://www.salesforce.com/us/developer/docs/api_rest/api_rest.pdf) to POST data into Salesforce, but that required to provide client id, customer key and user id/password of Salesforce, which I think we will not able to get from our clients (?). Can anyone tell me how to go about achieving this?

Thanks in advance.

5
  • How did you finally implement this? I need to the same thing but don't know where to start and how to go about this. Oct 21, 2013 at 6:54
  • @stylojack_10 please see my answer below. Things might have been changed now, so, please check salesforce documentation if there are any other easier approach.
    – Chandra
    Oct 21, 2013 at 23:59
  • I did read your answer but I am really not very sure what it means. What's VFS? Oct 22, 2013 at 5:34
  • What I am looking for is being able to post the data without having to create a form or anything on Salesforce. I already have a Google form implemented in my website. What I want is any user who fills out the form should be shown as a lead in my Salesforce. Oct 22, 2013 at 5:37
  • VFS = Visualforce Page (extension of the file being .vfs). The solution I provided will work with exposing VFS page with a public URL and then u can post to that URL. This VFS page just has a controller attached to it and in this controller u read all the parameters passed from your server and process accordingly. Go to the twilio example link in my answer, which explains this approach. Hope this helps.
    – Chandra
    Oct 22, 2013 at 22:25

2 Answers 2

2

I did a bit more research on this (in Google). Apparently what many are doing is create an Apex Controller and attach it to a VFS page. Then what each client has to do in their salesforce instance is, create a public site and expose this VFS page. So, its easy to post to this URL. Ofcourse, we need to handle URL Tampering check, which is separate thing. An example of this can be found here -> http://www.clintslee.com/2011/02/08/salesforce-twilio-receiving-incoming-texts/

3
  • I Googled for the same thing and couldn't find such a great example. Thanks for posting your find! Nov 21, 2012 at 7:48
  • Is this still the best way to POST data? Jul 16, 2019 at 14:22
  • Yes, it's still the way, AFAIK Dec 21, 2020 at 15:57
1

Sounds like you want to look into the OAuth features of force.com:

2
  • Thanks. I had looked into this as well. Ideally, I would like to implement using OAuth 2.0 Web server, as this does not pass back and forth the sensitive information. But then, in my case, I need to invoke the salesforce API without user interaction, which means, implementing something like, OAuth 2.0 username and password, and this involves having user information at our end. Is my understanding rt?
    – Chandra
    Oct 8, 2011 at 9:54
  • Surely there's some initial interaction with the user, otherwise how did you get their username & password? If you do the web server flow you can store the access token and use it later, there's no user interaction required everytime you want to call the API, just an inital one.
    – superfell
    Oct 8, 2011 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.