You need to sign in to do that
Don't have an account?
Haroon Ahmad
Integration with Google Apps Script
Hi,
I need to write some records from a Google spreadsheet to Salesforce.
The approach I'm taking is restful API and Google Apps Script. So I plan to expose the methods on the Salesforce side.
The Google App script will call the restful method on salesforce, which will take some parameters from the Google App Script.
My main doubt is around authentication from Google App Script to Salesforce.
I've read about oAuth as a way to authenticate. Is that the best way to do that? Are there some other easier options?
I'm trying to figure out the best way to connect to (oAuth vs Session ID).
Thanks a lot for your help!
-Haroon
I was able to make this example work. It is by Arun Nagarajan, a google engineer.
It uses salesforce rest api, oAuth, and google apps script.
https://github.com/entaq/GoogleAppsScript/tree/master/Salesforce.com
http://www.youtube.com/watch?v=9SEAmNDtlcA
If you have any questions please let me know.
All Answers
I've tried to get a SessionID using the following direction in the documentation.
But I keep getting the error: {"error":"invalid_grant","error_description":"authentication failure"}
Hi,
The best way to authenticate with Google AppScript with salesforce is OAuth 2.0. It provides both online and offline access to salesforce.
To acheive this just authenticate by sending request as:
https://accounts.google.com/o/oauth2/auth?scope=[AppScript Scope]&redirect_uri=[Call back url defined]&response_type=code&display=popup&client_id=75xxxxxx961-7lsxxxxxxxx3utj87rcm3rke8etkulh.apps.googleusercontent.com
In return it will provide authorization code as parameter to the url which can be used to get access token and/or access token from refresh token. For more info read here:
https://developers.google.com/accounts/docs/OAuth2WebServer
http://help.salesforce.com/help/doc/en/remoteaccess_oauth_refresh_token_flow.htm#request_access_token
For any doubt reply or mark it as solved if it solved your problem.
Thanks.
I was able to make this example work. It is by Arun Nagarajan, a google engineer.
It uses salesforce rest api, oAuth, and google apps script.
https://github.com/entaq/GoogleAppsScript/tree/master/Salesforce.com
http://www.youtube.com/watch?v=9SEAmNDtlcA
If you have any questions please let me know.