authorization - Access Gmail data of another account using app script -
i creating 1 app script creating application. application simple, 1 user authenticate script , script collects inbox , other statistics of gmail user. working fine below query:
function getquery(e){ //working perfect inbox , draft messages var inc = 400; var start = 0; var totalmessage = 0; { var thread = gmailapp.search(e,start, inc); var messages = gmailapp.getmessagesforthreads(thread); totalmessage += messages.length; start += inc; } while (thread.length == inc); return totalmessage; } everything works fine when user runs application, not sure, possible that, admin(or developer) of script can run script access of user gmail data (surely have gave authorization). need know, possible that, xyz@gmail.com developer , abc@gmail.com has authorised script run, xyz@gmail.com can run query data abc@gmail.com account?
it possible need rewrite. instead of using native authentication , gmail appscript apis need allxyhe oauth2 , gmail apis using rest api. takes work , knowledge of how oauth flow works (which broad answer here).
Comments
Post a Comment