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
Build better API clients
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Boris Bügling
April 24, 2015
Programming
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Build better API clients
Some thoughts on building better API clients, talk given at APIDays Berlin 2015.
Boris Bügling
April 24, 2015
More Decks by Boris Bügling
See All by Boris Bügling
Testing ⌚️ Apps and Other Extensions
neonichu
1
4.7k
Cross-platform Swift
neonichu
4
18k
Building better API clients in Swift
neonichu
1
360
Cross-platform Swift
neonichu
3
960
Swift Package Manager
neonichu
2
380
Swift Package Manager
neonichu
0
86
📺
neonichu
0
2.1k
Cross-Platform Swift
neonichu
0
140
Swift Package Manager
neonichu
6
4.5k
Other Decks in Programming
See All in Programming
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
140
Jetpack Compose メカニズム
skydoves
0
120
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.5k
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
130
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
220
業務時間外もAIに働いてもらう話
colorful12
3
10k
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
200
What We Talk About When We Talk About XP
m_seki
2
530
Building an Out-of-Order CPU
latte72
1
750
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
160
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
290
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
160
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Design in an AI World
tapps
1
310
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
300
Prompt Engineering for Job Search
mfonobong
0
450
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
The Invisible Side of Design
smashingmag
301
52k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.9k
Chasing Engaging Ingredients in Design
codingconduct
0
310
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
880
Transcript
BETTER API CLIENTS APIDAYS BERLIN, APRIL 2015 BORIS BÜGLING -
@NEONACHO
COCOAPODS
CONTENTFUL
None
None
None
source: http://appreviewtimes.com
Mobile apps need to be more reliable than the web.
None
Let's build better API clients to help building better apps
OPEN SOURCE
None
DOCUMENTATION
/** The server address to use for accessing any resources.
Default value: "cdn.contentful.com" */ @property (nonatomic) NSString* server; /** Configure a custom user-agent to be used in the HTTP request headers */ @property (nonatomic) NSString* userAgent;
None
COCOAPODS-DOCSTATS $ pod lib docstats 398 tokens, 100.0% documented
TESTING
let expectation = expectationWithDescription("...") waitForExpectationsWithTimeout(10) { (error) in // ...
} expectation.fulfill()
API BLUEPRINT # GET /message + Response 200 (text/plain) Hello
World!
CCLREQUESTREPLAY NSURL *blueprintURL = [[NSBundle mainBundle] URLForResource:@"fitnessfirst" withExtension:@"apib"]; CCLRequestReplayManager *replayManager
= [CCLRequestReplayManager managerFromBlueprintURL:blueprintURL error:nil]; [replayManager replay];
None
COCOAPODS-COVERAGE pod lib coverage
DISTRIBUTION
"Download the SDK from our webpage."
None
pod 'ContentfulDeliveryAPI'
COCOAPODS-PACKAGER pod package ContentfulDeliveryAPI.podspec
None
spec.dependency 'AFNetworking', '>= 2.5.2'
SO, WE'RE DONE, RIGHT?
ANTICIPATING CHANGE IS ONE OF THE CENTRAL THEMES OF REST.
Example: creating a poll
<html> <body> <h1>Poll</h1> <ul> <li><a href="/questions/new" rel="create">Make a new question</a></li>
</ul> </body> </html>
▸ Offers us to create a question ▸ We can
fill in the form we get ▸ Submit the form
We can do the same in our apps with Hypermedia
FORMATS ▸ HAL (application/hal+json) ▸ Siren (application/vnd.siren+json)
SIREN LINK { "entities": [ { "links": [ { "rel":
["self"], "href": "questions/1/choices/1" } ], "rel": ["choices"], "properties": { "choice": "Swift", "votes": 22 } } ] }
SIREN ACTION { "actions": { "create": { "href": "/questions", "method":
"POST", "fields": [ { "name": "question" }, { "name": "choices" } ], "type": "application/x-www-form-urlencoded" } } }
WE CAN NOW CHANGE IMPLEMENTATION DETAILS ON THE FLY
CHANGE URIS OF RESOURCES e.g. /polls/{id} to /questions/{id}
CHANGE HTTP METHODS e.g. PUT to POST
CHANGE THE CONTENT-TYPE
CHANGE FIELDS USED IN FORMS
REPRESENTOR
PRESENCE OF A TRANSITON if let transition = representor.transitions["create"] {
} else { // ... }
ATTRIBUTES OF A TRANSITION if let transition = representor.transitions["create"] {
transition.method transition.uri transition.suggestedContentType }
PERFORMING A TRANSITION request(transition, attributes: [ "question": "Favourite programming language?",
"choices": [ "Swift", "Ruby", "COBOL" ] ])
None
WHAT HAVE WE LEARNED? ▸ Publish source code! ▸ Document!
▸ Test! ▸ Be robust against change!
THANK YOU!
@NeoNacho
[email protected]
https://github.com/neonichu http://buegling.com/talks http://www.contentful.com