Integrate Salesforce To Google Drive
Integrate Salesforce To Google Drive
Kajal Yadav
To use Google Drive as an external data source, create an authentication provider for it in Salesforce.
The process begins with creating a related project in the Google Developers console.
4. In the project dashboard, click the menu icon in the upper left, and then click APIs & Services.
6. In the search results, click Google Drive API and Enable API.
9. In the Credentials tab, click Add credentials and select OAuth client ID.
In Setup, enter Auth. Providers in the Quick Find box, then select Auth. Providers. Click New.
For Provider Type, select OpenID Connect, and then set the following options:
Name — Enter the name you want to appear in Salesforce.
URL Suffix — Enter the suffix at the end of the URL path. For example, in the
path, https://login.salesforce.com/services/authcallback/00Dx00000000001/MyGooglePro
vider, the suffix is “MyGoogleProvider”
Consumer Key — Enter the client ID you copied when creating the Google project.
Consumer Secret — Enter the client secret you copied when creating the Google project.
https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=
force
5. After saving it will redirect to the google login page, login with your account.
6. Next, we will get a screen asking for permission to allow access to Google Drive
7. Click on Allow, next we will see a confirmation dialog, click Allow again.
Step 4: Now we will make a callout and get the Attachment in our Google Drive
Account.
Code
Trigger:
Apex Class:
https://drive.google.com/file/d/1fUYL44JBTtI9vnZr9upay2bio4oYnNm_/view?usp=sharing