-
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
Unlocking the Potential of Generative AI Without Creating Your Own Language Model (LLM)
Generative AI solutions with groundbreaking capabilities like content creation, text summarization, question answering, document translation, and task completion are in high demand. However, integrating large…
Career Planning in Salesforce (CRM) | What Makes Salesforce Career so Lucrative?
Salesforce is a customer relationship management (CRM) platform that provides a range of tools and technologies for sales, service, marketing, and collaboration. A career in…
All About Custom MetaData Types | The Salesforce Developer Guide
Custom metadata is packageable, adjustable, upgradeable, and deployable application metadata. To start with, you make a custom metadata type, which characterizes the type of application…
Popular Salesforce Videos
Customized Ideas Management on Salesforce Experience Cloud | IdeasPro by Grazitti
Learn how IdeasPro enables you to drive business growth by making the most of ideas on Salesforce communities, in this video.
See how fast and easy you can make intuitive Salesforce solutions to your users with Cauzali.
Instead of coding or very complex flows use Cauzali. Place your Cauzali model everywhere in Salesforce including in the middle of a Flow. Price between…
Create Your First Salesforce App in 30 Minutes
In this session, we will design, build and deploy a Salesforce App in 30 minutes using the low code and Salesforce modern developer tooling. Presenter…