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
60
Claude Code 超入門 バイブコーディングでつくる自分用ニュースまとめ
unsoluble_sugar
0
62
ゆるいエンジニアリングコミュニティはいいぞ
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.5k
VCCでVRChatにVRMアバターをアップロードする方法完全に理解した
unsoluble_sugar
0
780
技術選定完全に理解した
unsoluble_sugar
0
640
「未経験からエンジニア」でやり抜いた時の昔話
unsoluble_sugar
0
3k
Other Decks in Programming
See All in Programming
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
400
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
300
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
190
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.2k
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
220
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
670
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5k
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
220
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
510
Building an Out-of-Order CPU
latte72
1
800
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
350
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
530
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
Docker and Python
trallard
47
4.2k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
Exploring anti-patterns in Rails
aemeredith
4
510
Un-Boring Meetings
codingconduct
0
430
My Coaching Mixtape
mlcsv
0
320
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
340
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.8k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
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 ͷੈք