-
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
A Primer to Salesforce Einstein
Salesforce Einstein is not just the cool, new artificial intelligence analytical system from Salesforce. Salesforce Einstein is the cool, new and effective artificial intelligence from…
Data Migration and Transformation: Ensuring a Smooth Salesforce Implementation
Data migration and transformation play a fundamental role in ensuring a smooth transition to a new system during a Salesforce implementation service. These essential components…
What is Salesforce Net Zero Cloud?
Barely a day goes by without there being something in the news about climate change, sustainability or carbon footprints. It is a major focus for…
Popular Salesforce Videos
Unlocking Success with the Salesforce AppExchange
AppExchange is the world's leading business app marketplace, which empowers businesses to extend the functionality of Salesforce across every department and industry. AppExchange apps are…
Entrepreneurship in the Salesforce Ecosystem
The Salesforce Women’s Entrepreneur Group is a group of women who have founded and own businesses in the Salesforce ecosystem. Our goal is to inspire,…
How to Become Salesforce Developer | Salesforce For Beginners
In this how-to become Salesforce developer video, you will be learning what is Salesforce, the fundamentals of Salesforce, how to become a Salesforce developer, how…