-
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
What are Record-triggered Flows in Salesforce? | The Ultimate Guide
One of Salesforce's most potent features is Record-Triggered Flows (RTFs). You may automate procedures and lessen human labor by using RTFs to design flows that…
Managed Services: A Better Way to Administer Salesforce Deployments
Consistent support and ongoing innovation are keys to a profitable Salesforce CRM. But keeping ongoing support for Salesforce requires a substantial portion of your investment…
How to Upload File using the Button with the Guest User?
Step 1: Install these packages: FlowActionsBasePack FlowScreenComponentsBasePack File Upload Improved Step 2: Create a Screen Flow Create a screen element in the screen flow. Create…
Popular Salesforce Videos
Salesforce Certification Registration, Check and Verify Certification Status, Trailblazer.me Profile
All About Salesforce Certification:- Schedule your Salesforce Certification Exam Link Your Salesforce Certifications to Your Trailblazer.me Profile Check & Verify Your Salesforce Certification & Maintenance…
Lightning Component Development - 01 - Basic of Lightning Framework, Component Bundle, App Builder
What is covered in this session? * What is Lightning Component Framework? * Lightning Component Across Salesforce Ecosystem * When to use lightning component? * Where…
What is a Salesforce Admin?
Salesforce administrators are the gatekeepers of their employer's sales and marketing data. They create each user account and determine the proper level of access based…