-
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
Basic Understanding on Salesforce Integration | The Ultimate Guide
Salesforce integration refers to the process of connecting Salesforce, a popular customer relationship management (CRM) software, with other third-party applications or systems to streamline business…
Salesforce Summer'24 Highlights | All You Need to Know
Salesforce’s Summer ‘24 update is here, and its features are like a breath of fresh air. Let’s go over some of the cool features that…
Salesforce Apex Winter Release 21 - All You Need To Know
1. Before Apex Winter Release 21 batch limit for big objects using deleteImmediate() is 2,000 records at a time. Now we can delete up to…
Popular Salesforce Videos
Salesforce App Builder Certification Questions Explained
CRM tools serve as the base for managing small and large-scale businesses, and Salesforce is among the best CRM tools in the industry. Therefore, Salesforce…
5 Mind-Blowing New Salesforce Marketing Cloud Releases
The Statist worldwide marking survey reports- “Almost 4 billion world population is digitally active, and 2.14 of them are shopping online.” In this entire scenario,…
Salesforce Lightning Development | Make Your Business Lightning-Ready With Algoworks!
Description - From creating Lightning-ready Salesforce AppExchange apps to making Salesforce instances Lightning-ready, we have mastered Lightning. Contact us for salesforce lightning development services! https://www.algoworks.com/salesforce/…