Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
go-gmail-drafts
Search
Yoshiki Nakagawa
January 22, 2016
Technology
830
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
go-gmail-drafts
Yoshiki Nakagawa
January 22, 2016
More Decks by Yoshiki Nakagawa
See All by Yoshiki Nakagawa
Amazon Bedrock で作る未来の開発サイクルと オペレーション戦略 / AWS Summit Japan 2025
yyoshiki41
0
1.4k
MCP Documentation Server @AI Coding Meetup #1
yyoshiki41
2
4.3k
Go API クライアントの実装 〜Go Conference に載せれなかったTIPS〜
yyoshiki41
0
790
マルチテナントのアプリケーション実装 〜実践編〜
yyoshiki41
5
3.2k
Canary Deployments
yyoshiki41
0
600
Tests API
yyoshiki41
0
88
Graceful Upgrade for Go App
yyoshiki41
0
150
Other Decks in Technology
See All in Technology
なぜ東京にいる私が、新潟の技術コミュニティを運営するのか by 八雲慎之助
yakumo
0
220
AIエージェント統制はAPIから——押さえるべき5つの要素
nagix
0
120
【dbts2026】AIエージェントの 判断と探索を変える、 データベース エンジニアリング― 既存DBの処理と依存関係から作る、オペレーショナルオントロジー ―
shisyu_gaku
0
100
200人の配信コメント、 全部Jevが仕分けます 〜 マサカリガードを作ってみた 〜
katayamatg
1
530
続・ソフトウェアアーキテクトのための意思決定術: Decision Readiness, Revisited — When AI Changes the Economics of Software Architecture
snoozer05
PRO
5
1.3k
AWS構成から考えるWebセキュリティ ― WordPressの構築経験から考える公開範囲と更新運用【JAWS FESTA 2026 in AKITA】
cscengineer
PRO
0
100
慶應義塾大学 AI実践05 論文執筆の仕組み化
keio_smilab
PRO
6
3.6k
セキュリティ専任チームなしで攻撃を先回りするSREが実践したSIEM on Amazon OpenSearch Service
cscengineer
PRO
0
120
アクセラレーターで実現するServiceNow活用の高速化 / ServiceNow World Forum 2026
visional_engineering_and_design
0
130
(swiftc) NonCopyableとライフタイム修飾子
teamhimeh
0
170
AI Agent 時代のデータ基盤: ClickHouse で実現する 超高速分析とコスト削減の両立
jozono
0
140
Building Audio Plugin Ecosystem for Android in 2026
atsushieno
2
140
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
55
8.4k
Building Adaptive Systems
keathley
44
3.3k
How GitHub (no longer) Works
holman
316
150k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
500
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
450
Joys of Absence: A Defence of Solitary Play
codingconduct
1
570
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.9k
We Are The Robots
honzajavorek
0
430
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Building Applications with DynamoDB
mza
96
7.3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Transcript
ΦʔϓϯιʔεϥΠϒϥϦݚڀձ #3 Jan / 22 / 2016 Yoshiki Nakagawa eureka,
Inc.
AboutMe @yyoshiki41 Yoshiki Nakagawa Infrastructure Engineer, pairs Division Tech •
Golang • Middleware, RDBMS • AWS
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...
yyoshiki41/go-gmail-drafts GitHub : https://github.com/yyoshiki41/go-gmail-drafts Create a new draft using the
Gmail API.
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 !
Preparation ̍. Google Developer Console ͔Βɺ৽نϓϩδΣΫτΛ࡞ ͢Δɻ ̎. ϓϩδΣΫτͷ Gmail
API Λ༗ޮʹ͢Δɻ
̏. ೝূใΛઃఆ͢Δɻ ̐. ඞཁͳೝূใΛΫϦοΫɻ
̑. OAuth ΫϥΠΞϯτͷઃఆɻ OAuthೝূΛྃͤ͞ɺJSONϑΝΠϧΛμϯϩʔυ͠·͢ɻ ޙͰ͍·͢ʂ
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
̏. ॳճ࣮ߦ࣌OAuth௨͠ɺΞΫηετʔΫϯΛऔಘ͢Δɻ $ go run savetoken/main.go ϒϥβ͕ࣗಈͰ։͖ɺgoogleΞΧϯτͷೝূΛ͠·͢ɻ ࣍ʹɺGmailͰͷΞΫγϣϯΛڐՄ͠·͢ɻ
̑ɽςΩετϘοΫεʹදࣔ͞ΕͨcodeΛίϐʔ͢Δɻ λʔϛφϧʹͬͯɺtokenϑΝΠϧΛੜɻ ίϐʔͨ͠ίʔυΛషΓ͚Δɻ
̑. Լॻ͖ςϯϓϨΛ࡞ɻ { "to": "
[email protected]
", "subject": "Daily Reports", "message": "Hello!\nThis
is a draft." }
̒. go runͰ࣮ߦɻ $ go run main.go
ऴΘΓʹ go buildͰόΠφϦԽͯ͠ɺ cronʹొ͢ΕຖԼॻ͖࡞ʹ͑·͢ʂ