views:

40

answers:

3

Hey all,

I'm pretty new to SalesForce and their Apex language. I've been reading some documentation and tried the integration between Google and SalesForce.

I'm wondering is it possible to emulate an auth token from google to SalesForce?

I'm trying to read a google spreadsheet and then fill up a SalesForce object automatically. The user login will always be the same/universal for this spreadsheet, so I have the credentials required to login. I am working off of the sample that requires a visualforce, and I'm wondering how would I automatically do the session id token that the google spreadsheet API requires.

Any ideas?

+1  A: 

The old-school, hard way would be to send a login() call to the API (available through SOAP messages). Salesforce API is well documented and plenty of examples are available (both in programming languages and for raw XML requests/responses).

But I have no idea what possibilities you have from Google side, if it's only JavaScript then you might not be able to send and retrieve AJAX-like calls to another domain...

Recently another option emerged and that is REST API (no SOAP needed). Looks more promising and easier in my opinion. Quick intro is available here and you'll find more documentation on the bottom of the page.

Last but not least - 2 interesting links: http://code.google.com/apis/gdata/articles/salesforce.html for some integration tutorial and built-in integration offered by Salesforce: http://www.salesforce.com/assets/pdf/datasheets/SalesforceGoogleApps.pdf

eyescream
Thanks for the quick reply, however, I was trying to get this to be done automatically in salesforce itself. Having a trigger run apex code after an object is created. So there's no need for the login() to get into salesforce. Which is why I want to know if it's possible to make it programmatically login to a certain google account (not necessarily the one currently logged into SalesForce).
Tyug
eyescream
Access a google app from salesforce. However, since this is hosted on salesforce, and will be ran as a trigger, I don't believe I need to login.Sure, whenever you have the time to chat, it'd be great. I'm on EST, and anytime from 9-11, 2-6 on weekdays is usually good.
Tyug
A: 

Are you trying to log into Google Apps from SFDC? There are options for Google Apps within Salesforce, go to Setup > Administration Setup > Google Apps > Settings. I've not used this and it requires some setup, but thought I'd point it out. Aside from that I can only blurt out OAuth (getting users to authenticate with Google from within Salesforce when trying to access Google Apps) and SSO (which I know can be used to authenticate from an external system, though not sure if it works the other way).

Gary B
The settings is just to point salesforce to the correct google app domain, which doesn't allow me to specify a user for general salesforce to google app connection. I don't want the users to use OAuth because it should be done programmatically, and this is going to be ran as apex code, and as a trigger with no need of user intervention
Tyug

related questions