• DHIVYA SENTHIL KUMAR
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Trying to create an empty Google Sheet under a particular folder in Google Drive. 

HttpRequest req3 = new HttpRequest(); 
req3.setMethod('POST'); 
req3.setEndpoint('https://sheets.googleapis.com/drive/v4/spreadsheets');
req3.setHeader('Authorization', 'Bearer '+access_token);
req3.setHeader('content-type', 'application/json');
String body3 = '{"name":"name1","title":" '+sheet+'  ","mimeType": "application/vnd.google-apps.spreadsheet"}';
req3.setTimeout(60*1000);   
req3.setBody(body3);  
Http http3 = new Http();  
HttpResponse res3 = http3.send(req3);  
System.debug('===== Response==='+ res3.getBody());