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
Web API 完全に理解した 〜黎明編〜
Search
unsoluble_sugar
January 30, 2020
Programming
7.3k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Web API 完全に理解した 〜黎明編〜
「完全に理解した人達の「Web技術」Talk #1」の発表スライドです。
https://easy2.connpass.com/event/161840/
unsoluble_sugar
January 30, 2020
More Decks by unsoluble_sugar
See All by unsoluble_sugar
uLoopMCP × Claude Code, Trying AI-Driven Unity Game Development
unsoluble_sugar
0
64
Claude Code 超入門 バイブコーディングでつくる自分用ニュースまとめ
unsoluble_sugar
0
65
ゆるいエンジニアリングコミュニティはいいぞ
unsoluble_sugar
0
160
Godot Engineについて調べてみた
unsoluble_sugar
0
1k
ドキュメント翻訳から始めるOSS推し活
unsoluble_sugar
0
3.1k
VC ClientでRVC完全に理解した / rvc-with-vcclient-completely-understood
unsoluble_sugar
0
2.6k
VCCでVRChatにVRMアバターをアップロードする方法完全に理解した
unsoluble_sugar
0
810
技術選定完全に理解した
unsoluble_sugar
0
660
「未経験からエンジニア」でやり抜いた時の昔話
unsoluble_sugar
0
3k
Other Decks in Programming
See All in Programming
GraphQL の onError と Nullability のこれから
quramy
0
160
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
130
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
160
🇪🇸 React Alicante 2026 (Workshop)
ythecombinator
PRO
0
100
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
290
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
350
No More NoSuchMethodError
exoego
1
110
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
600
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.2k
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
1
170
Featured
See All Featured
Claude Code のすすめ
schroneko
67
230k
How to build a perfect <img>
jonoalderson
1
6.1k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
GraphQLとの向き合い方2022年版
quramy
50
15k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Paper Plane
katiecoart
PRO
5
54k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Transcript
Web API શʹཧղͨ͠ ʙᴈ໌ฤʙ
@unsoluble_sugar TOPGATE, Inc. Leader/Engineer
Web API શʹཧղͯ͠·͔͢ʁ
ฉ͍ͨ͜ͱ͋Δ શʹཧղͨ͠ ԿΘ͔Βͳ͍ νϣοτσΩϧ
ฉ͍ͨ͜ͱ͋Δ શʹཧղͨ͠ ԿΘ͔Βͳ͍ νϣοτσΩϧ
֓ཁ • ର ฉ͍ͨ͜ͱ͋Δਓ • શʹཧղͨ͠ঢ়ଶʹͳΔͨΊͷೖฤ • ࡉ͔͍આ໌ল͖·͢ • ෆ෦ॻ੶WebͷใͰิͯ͠Ͷ
Web APIͱʁ
Web APIͱ • APIͱʮApplication Programming Interfaceʯͷུ • ֎෦͔ΒػೳΛར༻͢ΔͨΊͷΈ • HTTPϓϩτίϧΛ༻͍ͯɺωοτϫʔΫӽ͠ʹػೳΛݺͼग़͢
APIͷ͜ͱΛʮWeb APIʯͱݺͿ
ͲΜͳαʔϏεͰΘΕͯΔͷʁ
Web API͕ΘΕ͍ͯΔαʔϏε • GoogleɺAmazonɺTwitterɺFacebookɺetc… • ੈͷதʹWeb APIΛલఏͱͨ͠αʔϏε͕ᷓΕ͍ͯΔ χϡʔεɺఱؾɺਤɺSNSɺγϣοϐϯάɺήʔϜɺΤϯλϝͳͲͳͲ • αʔό௨৴Λߦ͏εϚϗΞϓϦͰར༻
• ެ։/ඇެ։ͷWeb API͕ଘࡏ
۩ମతʹʁ
Twitter APIͷ߹ • TwitterWeb APIΛఏڙ͍ͯ͠Δ • ։ൃऀWeb APIΛར༻ͯ͠Twitterͷ༷ʑͳػೳ͕͑Δ • ଟ͘ͷαʔυύʔςΟΫϥΠΞϯτ͕։ൃ͞Εൃల
• ࠷ۙ༻੍ݶ͕ݫ͍͠…
APIϦϑΝϨϯε https://developer.twitter.com/en/docs/api-reference-index
༷ৄࡉ͕ެ։͞Ε͍ͯΔ ։ൃऀAPIΛͬͯಠࣗͷΞϓϦWebαʔϏεΛ࡞Δ͜ͱ͕Ͱ͖Δ
࣮ࡍͷAPIͷಈ͖ʁ
ϢʔβʔλΠϜϥΠϯऔಘ HTTPϝιου GET Ϩεϙϯεܗࣜ JSON υϝΠϯ https://api.twitter.com ΤϯυϙΠϯτ /1.1/statuses/user_timeline.json ύϥϝʔλ
screen_name, count, include_rts, etc… ೝূ Bearer Token
APIϦΫΤετΛ͛Δͱ… $ curl "https://api.twitter.com/1.1/statuses/user_timeline.json? screen_name=unsoluble_sugar&count=10" -H "Authorization: Bearer <ACCESS_TOKEN>" |
jqɹ
λΠϜϥΠϯͷใ͕JSONͰऔಘͰ͖Δ { "created_at": "Sun Jan 19 12:33:32 +0000 2020", "id":
1218874129316638700, "id_str": "1218874129316638720", "text": "ϦΫΤετϔομʔͷAuthorizationͬͯɺຊޠͰදݱ͢Δͱʮೝূํࣜʯͱ͔Ͱྑ͍ͷ͔͠Β", }, "source": "<a href=\"https://about.twitter.com/products/tweetdeck\" rel=\"nofollow\">TweetDeck</a>", "user": { "id": 149069183, "id_str": "149069183", "name": "Ө", "screen_name": "unsoluble_sugar", "location": "ೋ࣍ݩ", "description": "Tech Hunterදɻશจݕࡧ/εϚϗήʔϜ/νϟοτbot/IoTͱ͔ͬͯΔࡶଟͳΤϯδχΞɻ࠷ۙPM݉ɻFlutter/GCP/FirebaseษڧதɻΨδΣΦλͰΞχ ΦλͰήʔΦλɻྦྷܭ1000ສPVͷݸਓϒϩάӡӦɻ2ࣇͷύύɻຊ୨ɿhttps://t.co/kGyfPuFvIO", "url": "https://t.co/h7Iq47ug5Z", "entities": { "url": { "urls": [ { "url": "https://t.co/h7Iq47ug5Z", "expanded_url": "https://unsolublesugar.com", "display_url": "unsolublesugar.com", …
ϨεϙϯεσʔλΛղੳͯ͠ը໘ʹө • πΠʔτใ textɿΫι͍ created_atɿSun Jan 19 12:33:32 +0000 2020
sourceɿTweetDeck • Ϣʔβʔใ user.profile_image_urlɿhttp://pbs.twimg.com/profile_images/1109649870594293766/AQHwKd6N_normal.jpg user.nameɿӨ user.screen_nameɿunsoluble_sugar
༷ʑͳใ͕APIͰऔಘͰ͖Δ • ϗʔϜλΠϜϥΠϯͷऔಘ GET statuses/home_timeline • ݸผπΠʔτͷऔಘ GET statuses/show/:id •
Ϧετͷऔಘ GET lists/list • ϑΥϩϫʔใҰཡͷऔಘ GET followers/list
GETҎ֎σʔλͷੜɺߋ৽ɺআ • πΠʔτͷߘ POST statuses/update • ը૾ͷΞοϓϩʔυ POST media/upload •
DMͷআ DELETE direct_messages/events/destroy • DMͷΣϧΧϜϝοηʔδมߋʢ͜Μͳػೳ͋ͬͨΜ͔…ʣ PUT direct_messages/welcome_messages/update
TwitterWeb APIͰग़དྷ͍ͯΔ
Web API
શʹཧղͨ͠ʁ
• HTTPϔομʔɺϘσΟʢϦΫΤετɾϨεϙϯεʣ • HTTPϝιου • ΤϯυϙΠϯτ • ΫΤϦετϦϯάʢURLύϥϝʔλʔʣ • URLΤϯίʔσΟϯά
• ϑΟϧλɺιʔτɺݕࡧɺϖʔδωʔγϣϯ • ೝূɺೝՄʢBasic, OAuth2, OpenID Connectʣ • ηογϣϯཧ • σʔλܕ • ग़ྗܗࣜʢJSON, XML, HTMLʣ • ΤϥʔϋϯυϦϯά • εςʔλείʔυʢ200, 404, 502ʣ • APIαʔόɺWebαʔό • όʔδϣϯཧ • ઃܭʢRESTfulʣ • ηΩϡϦςΟ
None
ࢀߟॻ੶ • WebΛࢧ͑Δٕज़ ᴷ HTTPɺURIɺHTMLɺͦͯ͠REST ࢁຊཅฏɹஶʢWEB+DB PRESS plusʣ 20104݄ ൃߦ
• Web API: The Good Parts ਫ و໌ɹஶʢΦϥΠϦʔδϟύϯʣ 201411݄ ൃߦ
Α͏ͦ͜ Web API ͷੈք