how to use blogger api v3 with google script

[email protected] Sun, 14 Jan 2018 07:30:35 -0800 (PST)
Newsgroups gmane.comp.web.blogger.api
Message-ID <[email protected]>

Hi there !

I built a google script which allows people to upload files to my google 
drive and insert new message to my blogger blog. It works correctly!

But I want to replace MailApp.sendEmail  with blogger API V3.

My BLOGGER API key is : AIzaSyBuKkNHRYDcIsvNu4TYeHsesqPrstCu5H0

My client Id is:  
992437778064-8356af16lqqa2csd526r2quuomplrk92.apps.googleusercontent.com

My blogger ID is: 4927559589819135388

How to do this?

Thanks!

 

/* ----------------------my google script function *form.gs* 
-------------------------------- */

 

function doGet(e) {

  return 
HtmlService.createHtmlOutputFromFile('forms.html').setTitle("xxxxxxxxx")   

        
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);        

}

function uploadFileToGoogleDrive(data, file, name, select) {

   try {     

    var dropbox = "xxxxxxx";

    var folder, folders = DriveApp.getFoldersByName(dropbox);

      

    if (folders.hasNext()) {

      folder = folders.next();

    } else {

      folder = DriveApp.createFolder(dropbox);

    }    

       var contentType = data.substring(5,data.indexOf(';')),

        bytes = 
Utilities.base64Decode(data.substr(data.indexOf('base64,')+7)),                   


        blob = Utilities.newBlob(bytes, contentType, file),

        file = folder.createFile(blob);      

        var fileName = file.getName();

        var longUrl = "https://docs.google.com/uc?export=download&id=" + 
file.getId();

        var test = file.getSize();

        var datecr = file.getDateCreated();

        var today = Utilities.formatDate(new Date(), 
Session.getScriptTimeZone(), "dd/MM/yyyy à HH:mm:ss");        

        file.setDescription("xxxxxxxx );

        file.setName(fileName );    

  

/* -------------------SEND EMAIL TO 
blogger--------------------------------*/

    MailApp.sendEmail({

     to: "[email protected],",

     subject: "xxxxxx" ,

     htmlBody: "xxxxxxx",

    });

  /* ----------------------RETURN A CONFIRMATION 
MESSAGE-------------------------------- */

 var confirm = "well done xxxxxx ";

return confirm;          

} catch (f) {

    return f.toString();

  }    

}    

-- 
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bloggerdev.
For more options, visit https://groups.google.com/d/optout.