-
Getting trouble to send document to google drive File/Folder in Salesforce
Hi,
My requirement, I have Visualforce page where
1- I can attach a document and send to my google drive.
2- I can get all the folder from the google drive and show in VF page.
1st one I did successfully but in case of the 2nd point I am getting 'Forbidden' error.
Something I missed please guide me-
http objHttp = new http();
Google_Auth_Detail__c tmpGD = [select id,Access_Token__c,Authorization_Code__c,Client_Id__c,Secret_Code__c,Expire_In__c,Refresh_Token__c,Scope__c,Token_Type__c from Google_Auth_Detail__c limit 1];
Http http = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('GET');
//req.setEndpoint('https://www.googleapis.com/drive/v2/files');
req.setEndpoint('https://www.googleapis.com/drive/v3/files/0B_QE5jslfxO6clpiRWRnOXpFR00?alt=media');
req.setHeader('Authorization',tmpGD.Access_Token__c );
//HttpResponse resp = http.send(req);
HttpResponse res;
res = objHttp.send(req);
system.debug(res.getStatusCode()+'......'+res.getStatus()+'....res.........'+res.getBody());This is my method to get from google drive.
Log In to reply.
Popular Salesforce Blogs
![salesforce integration](https://images.forcetalks.com/wp-content/uploads/2020/04/21162607/salesforce-integration.png)
The Most Common Types of Salesforce Integrations
The combination happens when separate individuals or things are united, similar to the coordination of understudies from the entirety of the area's primary schools at…
![](https://images.forcetalks.com/wp-content/uploads/2022/08/10052347/sa_16601088154%20Phases%20of%20Salesforce%20Classic%20to%20Lightning%20Migration-1024x512.png)
4 Phases of Salesforce Classic to Lightning Migration
Salesforce Classic to Lightning Migration offers you access to better UI, new features, and more opportunities to scale. When Salesforce Lightning was launched in 2015,…
![salesforce consultant](https://images.forcetalks.com/wp-content/uploads/2020/04/22163105/salesforce-consultant.jpg)
How Can Hiring A Salesforce Consultant Increase Your Business ROI?
What does Return on Investment mean? Return on Investment (ROI) is a measurement of performance that helps in calculating the efficiency of an investment. With…
Popular Salesforce Videos
Creating a Rollup Using DLRS | Salesforce Tutorial
In certain situations, an object does not support a roll-up, or the relationship is not permitted. Learn how to make it possible by using the…
Salesforce Consumer Goods Cloud Demo
Salesforce Consumer Goods Cloud is an intelligent, seamless B2B CRM solution specifically designed for the consumer goods industry. Watch this video to learn more.
What is Salesforce Hyperforce?
In this video, you will take a look at Salesforce Hyperforce, Salesforce's new re-architecting of the Salesforce platform. 00:00 Introduction 00:28 What is Salesforce Hyperforce?…