Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Designing mobile friendly APIs
Search
Milan Cermak
February 13, 2014
Technology
0
110
Designing mobile friendly APIs
Slides from the talk I gave at 1st HTTP API group meetup in Berlin.
Milan Cermak
February 13, 2014
Tweet
Share
More Decks by Milan Cermak
See All by Milan Cermak
Building a CI/CD pipeline on AWS
milancermak
0
5.7k
HTTP API & Python
milancermak
3
270
Programování pro iOS z pohledu pythonistu
milancermak
0
270
Prečo povedať nie SQL
milancermak
1
130
Other Decks in Technology
See All in Technology
『バイトル』CTOが語る! AIネイティブ世代と切り拓くモノづくり組織
dip_tech
PRO
1
130
能登半島災害現場エンジニアクロストーク 【JAWS FESTA 2025 in 金沢】
ditccsugii
0
900
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.2k
HR Force における DWH の併用事例 ~ サービス基盤としての BigQuery / 分析基盤としての Snowflake ~@Cross Data Platforms Meetup #2「BigQueryと愉快な仲間たち」
ryo_suzuki
0
240
AI-Readyを目指した非構造化データのメダリオンアーキテクチャ
r_miura
0
100
これがLambdaレス時代のChatOpsだ!実例で学ぶAmazon Q Developerカスタムアクション活用法
iwamot
PRO
8
1.1k
AWS Control Tower に学ぶ! IAM Identity Center 権限設計の第一歩 / IAM Identity Center with Control Tower
y___u
1
200
AIツールでどこまでデザインを忠実に実装できるのか
oikon48
6
3.5k
サイバーエージェント流クラウドコスト削減施策「みんなで金塊堀太郎」
kurochan
4
2.1k
Geospatialの世界最前線を探る [2025年版]
dayjournal
1
240
業務効率化をさらに加速させる、ノーコードツールとStep Functionsのハイブリッド化
smt7174
2
150
初めてのDatabricks Apps開発
taka_aki
1
160
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
44
7.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Being A Developer After 40
akosma
91
590k
4 Signs Your Business is Dying
shpigford
185
22k
How STYLIGHT went responsive
nonsquared
100
5.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
49
51k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Producing Creativity
orderedlist
PRO
347
40k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
Raft: Consensus for Rubyists
vanstee
140
7.1k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
Transcript
Mobile friendly APIs Milan Cermak HTTP API Meetup Group Berlin
Feb 13, 2014
General rules
be religious about documentation
when in doubt RFC 2616
Designing for mobile
Optimize for size and speed
• Bytes matter • Power consumption: • 3G > wifi
> 2G • On cellular, only 2 concurrent networking requests
Content-Encoding: gzip
ETag If-Match If-None-Match
Make the API flexible
Make the API flexible • fields parameter
GET /people/1! {“id”: 1,! “name”: “Milan Cermak”,! “age”: 27,! “hobbies”:
[“programming”, “ice cream”],! ...! }
GET /people/1?fields=name,age! {“name”: “Milan Cermak”,! “age”: 27}
Minimal vs. full approach ! • Send only the minimal
possible representation, let the users specify what they want via fields! • Send the full available representation of the resource
Make the API flexible • zoom parameter
GET /hobbies/programming! {“people”: [“1”, “2”, “3”, “5”, “8”, “11”],! “popularity”:
0.75,! ...! }
GET /hobbies/programming?zoom=people! {“people”: [! {“id”: 1,! “name”: “Milan Cermak”,! “age”:
27! ...! },! ...]! }
Batched requests
Batched requests • i.e. Facebook Graph API • A solution
until widespread adoption of HTTP2 • Not really RESTful, but really useful
POST /api/batch! {[! {“method”: “GET”! “relative_url”: “people/1”! },! {“method”: “GET”,!
“relative_url”: “hobbies/dogs”! }! ]}
Batched requests • Server-side implementation can be tricky: • Error
handling • HTTP headers • Parallel execution vs. POST/PUT/DELETE
Thank you