简体   繁体   中英

How to run google apps script externally from java application

Is it possible to connect to google and run a google apps script from a desktop java application?

I found this info:

https://developers.google.com/appengine/docs/java/urlfetch/usingjavanet?hl=en#Simple_Requests_With_URLs

It says that you can connect to google app engine from java application via HTTP or HTTPS using java.net.URLConnection, the page has some examples, but none to connect to google apps script.

The reason I need to connect to google app script is because I have a firewall on my company so I can't connect to gmail via smpp or IMAP, so I want to send gmail mails from a google script.

Thank you very much.

Yes you can. Look at how to publish an apps script in gas help. Publish it as anonymous and return a contentService. Then urlFetch it from java passing the necessary url params.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM