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
Better API Clients
Search
API Strategy & Practice Conference
April 24, 2015
Technology
110
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Better API Clients
API Strategy & Practice Conference
April 24, 2015
More Decks by API Strategy & Practice Conference
See All by API Strategy & Practice Conference
APIStrat 2016 | The end of polling: why and how to transform a REST API into a Data Streaming API (Audrey Neveu)
apistrat
12
330
APIStrat 2016 | OpenAPI Trek: Beyond API Documentation (Arnaud Lauret)
apistrat
5
240
APIStrat 2016 | Flying Dreams: Real-Time Communication from the Edge of Space (Jonathan Barton, Neha Abrol)
apistrat
1
170
APIStrat 2016 | On-prem support? That was so 1982 (Charlie Ozinga)
apistrat
0
140
APIStrat 2016 | Effortless microservices in production with Kubernetes (Ken Wronkiewicz)
apistrat
0
180
Song by Tony Blank
apistrat
0
210
API Lifecycle Manager by Steve Fonseca
apistrat
2
280
APIs In The Enterprise: How Walgreens Formed It's Digital Business by Drew Schweinfurth
apistrat
1
410
Developers Are Difficult by Andrew Noonan
apistrat
0
150
Other Decks in Technology
See All in Technology
AGENTS.mdとSkillsで始めるAIエージェント活用
sonoda_mj
2
150
Claude Code の Sandbox 機能を Anthropic Sandbox Runtime(srt) で試そう!/lets-play-anthropic-sandbox-runtime
tomoki10
1
410
Rancherの紹介&Update情報(RancherJP Online Meetup #09)
yoshiyuki_kono
0
140
AmazonRoute 53ではじめてのドメイン取得!HTTPS化までの道のりを整理してみた
usanchuu
3
120
Databricks における 生成AIガバナンスの実践
taka_aki
1
360
価格.comをAI駆動で全面刷新する ー 30年分の技術的負債を返し、次の30年の土台をつくる ー / AI Engineering Summit Tokyo 2026
tkyowa
53
58k
Kubernetesにおける学習基盤とLLMOpsの概要
ry
1
170
なぜ Platform Engineering の土台に Kubernetes を選ぶのか
r4ynode
1
430
TypeScript Compiler APIとPHP-Parserを活用し、TypeScriptとPHPで型を共有する
shuta13
1
380
Platform Engineering as a Product: Criteria for Improvement and Multi-Tenant Design
kumorn5s
0
530
GoとSIMDとWasmの今。
askua
3
520
protovalidate-es を導入してみた
bengo4com
0
160
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
400
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
320
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
960
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
340
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
840
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
300
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Bash Introduction
62gerente
615
210k
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