Google APIs Client Library for Go
GitHub : https://github.com/google/google-api-go-client/
Enable to access google APIs
- Gmail API
- BigQuery API
- Calendar API
etc...
Slide 4
Slide 4 text
yyoshiki41/go-gmail-drafts
GitHub : https://github.com/yyoshiki41/go-gmail-drafts
Create a new draft using the Gmail API.
Slide 5
Slide 5 text
Why not Google Apps Script ?
Apps Script is not enough...
Can't create drafts. (only get drafts)
So use Google APIs Client Library !
Other languages libraries :
https://developers.google.com/discovery/libraries
All Libraries are open-sourced !
Slide 6
Slide 6 text
Preparation
̍. Google Developer Console ͔Βɺ৽نϓϩδΣΫτΛ࡞
͢Δɻ
̎. ϓϩδΣΫτͷ Gmail API Λ༗ޮʹ͢Δɻ
How to
̍. go get
$ go get github.com/yyoshiki41/go-gmail-drafts
$ cd $GOPATH/src/github.com/yyoshiki41/go-gmail-drafts
̎. μϯϩʔυͨ͠jsonϑΝΠϧΛઃஔɻ
$ mv ~/Downloads/clientid.json config/clientsecret.json
Slide 10
Slide 10 text
̏. ॳճ࣮ߦ࣌OAuth௨͠ɺΞΫηετʔΫϯΛऔಘ͢Δɻ
$ go run savetoken/main.go
ϒϥβ͕ࣗಈͰ։͖ɺgoogleΞΧϯτͷೝূΛ͠·͢ɻ
࣍ʹɺGmailͰͷΞΫγϣϯΛڐՄ͠·͢ɻ