SlideShare a Scribd company logo
1 of 29
Download to read offline
Adapting our API 

for multiple platforms
BY ROUVEN WEßLING
Like a CMS… without the bad bits.
Contentful is a content management developer
platform with an API at its core.
How do you consume
news?
At Contentful we had to adapt our APIs
to suite a wide variety of platforms and
use cases. How did we do it?
In the UK newspaper
circulation fell 43%
between 2001 and 2014.
In the US 10% of
subscribers read online.
NEWSPAPER
The old fashioned way.
As of 2016, just 20% of
US adults read print
paper news. Just 5% of 18
to 29-year-olds.
85% of US adults
consume news on digital
devices.
13% consume news only
on desktops/laptops.
42% of adults using both
mobile and desktop
prefer the desktop.
WEB
70% of US adults aged
18-29 prefer or only use
mobile devices.
88% of mobile internet
time is spent in apps.
25% of US smartphone
owners prefer apps; 25%
the mobile web.
MOBILE
All the cool kids do it.
Amazon has sold over 5
million Echos in the US.
CNN got 36.5 million
unique readers from
Apple News in
September 2016.
Sky Sports gets around 1
million daily viewers on
Snapchat Discover.
NEW PLATFORMS
Are you ready for them?
TODAY CONTENT
HAS TO BE MULT-PLATFORM
Consumption behavior is changing.
Companies who can’t adapt will be left behind.
Modular

Built to make content reusable
and channel agnostic.
Microservice
API-driven design allows
powerful integration

with third parties.
Cloud service

Focus on the user experience;
not running the backend
The CMS that enables
developers to serve all platforms.
10
How does that
affect our APIs?
Limitations
Enable developers to present content on all connected platforms.*
The devices might lose its internet
connection at any time.
Offline
Mobile devices might be on a slow or
metered connection.
Bandwidth
Some platforms require the content to
be sent to them.
Push
Embedded platforms have limited
processing power.
Performance
*As long as they support HTTP and JSON
12
Offline
Mobile devices might lose their internet connection at
any time.
SYNC API
• Download all content to the
device
• Store a token that marks the last
content that has been synced
• Next sync; get only changed
content
#!/bin/sh
curl 'https://cdn.contentful.com/spaces/cfexampleapi/sync?
access_token=b4c0n73n7fu1&initial=true'
SYNC API
• Download all content to the
device
• Store a token that marks the last
content that has been synced
• Next sync; get only changed
content
{
"sys": {
"type": "Array"
},
"items": [
{
"sys": {},
"fields": {
"name": {
"en-US": "London"
},
"center": {
"en-US": {
"lon": -0.12548719999995228,
"lat": 51.508515
}
}
}
}
],
"nextSyncUrl": "https://cdn.contentful.com/spaces/cfexampleapi/sync?
sync_token=w5ZGw6JFwqZmVcKsE8Kow4grw45QdybCnV_Cg8OASMKpwo1UY8K8bsKFwqJrw7DDhcKnM2
RDOVbDt1E-wo7CnDjChMKKGsK1wrzCrBzCqMOpZAwOOcOvCcOAwqHDv0XCiMKaOcOxZA8BJUzDr8K-
wo1lNx7DnHE"
}
Push
Unlike the web and mobile apps, some content
platforms require the publisher to provide the content
to them.
www.contentful.com
WEBHOOKS
• Don’t call us; we’ll call you
• Select the events necessary
• Payload contains the entire body
17
Bandwidth
Mobile networks are super fast - but not everywhere.
Enable users to get to content before they get bored.
Images API
• Resize images server side so they are as small as possible.
• When constrained by bandwidth, resize further or reduce the quality.
LOCALES
• Most people never change the
websites/apps language
• Optimize for the common case:
only load for the users current
locale
#!/bin/sh
curl 'https://cdn.contentful.com/spaces/cfexampleapi/entries/nyancat?
access_token=b4c0n73n7fu1&locale=en-US'
curl 'https://cdn.contentful.com/spaces/cfexampleapi/entries/nyancat?
access_token=b4c0n73n7fu1&locale=tlh'
LOCALES
• Most people never change the
websites/apps language
• Optimize for the common case:
only load for the users current
locale
{
"sys": {
"id": "nyancat",
"locale": "en-US"
},
"fields": {
"name": "Nyan Cat",
"bestFriend": {
"sys": {
"type": "Link",
"linkType": "Entry",
"id": "happycat"
}
},
"birthday": "2011-04-04T22:00:00+00:00",
"lives": 1337,
}
}
LOCALES
• Most people never change the
websites/apps language
• Optimize for the common case:
only load for the users current
locale
{
"sys": {
"id": "nyancat",
"locale": "tlh"
},
"fields": {
"name": "Nyan vIghro'",
"bestFriend": {
"sys": {
"type": "Link",
"linkType": "Entry",
"id": "happycat"
}
},
"birthday": "2011-04-04T22:00:00+00:00",
"lives": 1337,
}
}
Performance
Embedded platforms are very different from the
computer we all use.
ADJUST PAYLOAD
• JSON is very lightweight
• Less JSON parses faster than
more JSON
• Only worth it on severely
constrained devices
#!/bin/sh
curl 'https://cdn.contentful.com/spaces/cfexampleapi/entries?
access_token=b4c0n73n7fu1&content_type=cat&select=sys.id,fields.name'
ADJUST PAYLOAD
• JSON is very lightweight
• Less JSON parses faster than
more JSON
• Only worth it on severely
constrained devices
{
"sys": {
"type": "Array"
},
"total": 3,
"skip": 0,
"limit": 100,
"items": [
{
"fields": {
"name": "Nyan Cat"
},
"sys": {
"id": "nyancat"
}
},
{
"fields": {
"name": "Garfield"
},
"sys": {
"id": "garfield"
}
}
]
}
RESOLVE

REFERENCES
• Avoid API requests by fetching
linked resources
• Control over the level of depth
#!/bin/sh
curl 'https://cdn.contentful.com/spaces/cfexampleapi/entries?
access_token=b4c0n73n7fu1&content_type=cat&fields.color=rainbow&include=1'
RESOLVE

REFERENCES
• Avoid API requests by fetching
linked resources
• Control over the level of depth
{
"items": [{
"fields": {
"name": "Nyan Cat",
"color": "rainbow",
"bestFriend": {
"sys": {
"type": "Link",
"id": "happycat"
}
}
}
}],
"includes": [{
"fields": {
"name": "Happy Cat",
"color": "gray",
"bestFriend": {
"sys": {
"type": "Link",
"id": "nyancat"
}
}
}
}]
}
COMPLEX QUERIES
• Avoid API requests with
complex queries
• Search on referenced content
#!/bin/sh
curl ‘https://cdn.contentful.com/spaces/cfexampleapi/entries?
access_token=b4c0n73n7fu1&content_type=cat&limit=1&include=0&

fields.bestFriend.sys.contentType.sys.id=cat&fields.bestFriend.fields.color=rainbow'
COMPLEX QUERIES
• Avoid API requests with
complex queries
• Search on referenced content
{
"sys": {
"type": "Array"
},
"total": 1,
"skip": 0,
"limit": 1,
"items": [
{
"sys": {
"id": "happycat",
"locale": "en-US"
},
"fields": {
"name": "Happy Cat",
"color": "gray",
"bestFriend": {
"sys": {
"type": "Link",
"linkType": "Entry",
"id": "nyancat"
}
},
"lives": 1
}
}
]
}
ROUVEN WEßLING
Twitter: @RouvenWessling
Email: rouven@contentful.com

More Related Content

Viewers also liked

Twitter Api Mashup
Twitter Api MashupTwitter Api Mashup
Twitter Api Mashup정혁 권
 
Storyboard title sequence (1)
Storyboard title sequence (1)Storyboard title sequence (1)
Storyboard title sequence (1)Annika Laws-Walsh
 
API Days Australia - Automatic Testing of (RESTful) API Documentation
API Days Australia  - Automatic Testing of (RESTful) API DocumentationAPI Days Australia  - Automatic Testing of (RESTful) API Documentation
API Days Australia - Automatic Testing of (RESTful) API DocumentationRouven Weßling
 
Indice libro "SEO e SEM Guida Avanzata al Web Marketing" 4° Edizione
Indice libro "SEO e SEM Guida Avanzata al Web Marketing" 4° EdizioneIndice libro "SEO e SEM Guida Avanzata al Web Marketing" 4° Edizione
Indice libro "SEO e SEM Guida Avanzata al Web Marketing" 4° EdizioneLibro SEO
 
Open API 발표자료 - 김연수
Open API 발표자료 - 김연수Open API 발표자료 - 김연수
Open API 발표자료 - 김연수Yeon Soo Kim
 
Nordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationNordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationRouven Weßling
 
CIM Formación - Fitoterapia para los trastornos del sistema nervioso
CIM Formación - Fitoterapia para los trastornos del sistema nerviosoCIM Formación - Fitoterapia para los trastornos del sistema nervioso
CIM Formación - Fitoterapia para los trastornos del sistema nerviosoCIM Grupo de Formación
 

Viewers also liked (10)

Twitter Api Mashup
Twitter Api MashupTwitter Api Mashup
Twitter Api Mashup
 
Kendra Shot List
Kendra Shot ListKendra Shot List
Kendra Shot List
 
Storyboard title sequence (1)
Storyboard title sequence (1)Storyboard title sequence (1)
Storyboard title sequence (1)
 
Idioms and fixed expressions (i)
Idioms and fixed expressions (i)Idioms and fixed expressions (i)
Idioms and fixed expressions (i)
 
Phrasal verbs and Idioms Quiz FCE
Phrasal verbs and Idioms Quiz FCEPhrasal verbs and Idioms Quiz FCE
Phrasal verbs and Idioms Quiz FCE
 
API Days Australia - Automatic Testing of (RESTful) API Documentation
API Days Australia  - Automatic Testing of (RESTful) API DocumentationAPI Days Australia  - Automatic Testing of (RESTful) API Documentation
API Days Australia - Automatic Testing of (RESTful) API Documentation
 
Indice libro "SEO e SEM Guida Avanzata al Web Marketing" 4° Edizione
Indice libro "SEO e SEM Guida Avanzata al Web Marketing" 4° EdizioneIndice libro "SEO e SEM Guida Avanzata al Web Marketing" 4° Edizione
Indice libro "SEO e SEM Guida Avanzata al Web Marketing" 4° Edizione
 
Open API 발표자료 - 김연수
Open API 발표자료 - 김연수Open API 발표자료 - 김연수
Open API 발표자료 - 김연수
 
Nordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationNordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API Documentation
 
CIM Formación - Fitoterapia para los trastornos del sistema nervioso
CIM Formación - Fitoterapia para los trastornos del sistema nerviosoCIM Formación - Fitoterapia para los trastornos del sistema nervioso
CIM Formación - Fitoterapia para los trastornos del sistema nervioso
 

Similar to Adapting our API for multiple platforms

Philly ete-2011
Philly ete-2011Philly ete-2011
Philly ete-2011davyjones
 
Introduction to (web) APIs - definitions, examples, concepts and trends
Introduction to (web) APIs - definitions, examples, concepts and trendsIntroduction to (web) APIs - definitions, examples, concepts and trends
Introduction to (web) APIs - definitions, examples, concepts and trendsOlaf Janssen
 
Digital natives: freedom and hackability in a mobile future
Digital natives: freedom and hackability in a mobile futureDigital natives: freedom and hackability in a mobile future
Digital natives: freedom and hackability in a mobile futureTristan Nitot
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Todaydavyjones
 
Next Generation Portals : How OpenSocial Standard Adds Social to the Mix?
Next Generation Portals : How OpenSocial Standard Adds Social to the Mix? Next Generation Portals : How OpenSocial Standard Adds Social to the Mix?
Next Generation Portals : How OpenSocial Standard Adds Social to the Mix? Tugdual Grall
 
Michael Yoch (NPR) - The NPR API: Powering "Radio" in a Multiplatform World
Michael Yoch (NPR) - The NPR API: Powering "Radio" in a Multiplatform WorldMichael Yoch (NPR) - The NPR API: Powering "Radio" in a Multiplatform World
Michael Yoch (NPR) - The NPR API: Powering "Radio" in a Multiplatform WorldRadiocamp 2011
 
Programing for the iPhone
Programing for the iPhonePrograming for the iPhone
Programing for the iPhoneMike Qaissaunee
 
BarCamp KL H20 Open Social Hackathon
BarCamp KL H20 Open Social HackathonBarCamp KL H20 Open Social Hackathon
BarCamp KL H20 Open Social Hackathonmarvin337
 
The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API PlatformJohannes Ridderstedt
 
Andriy Vandakurov about "Frontend. Global domination"
Andriy Vandakurov about  "Frontend. Global domination" Andriy Vandakurov about  "Frontend. Global domination"
Andriy Vandakurov about "Frontend. Global domination" Pivorak MeetUp
 
Web Based Mobile Linux World
Web Based Mobile Linux WorldWeb Based Mobile Linux World
Web Based Mobile Linux WorldOytun Eren Sengul
 
Offline of web applications
Offline of web applicationsOffline of web applications
Offline of web applicationsFDConf
 
Offline for web - Frontend Dev Conf Minsk 2014
Offline for web - Frontend Dev Conf Minsk 2014Offline for web - Frontend Dev Conf Minsk 2014
Offline for web - Frontend Dev Conf Minsk 2014Jan Jongboom
 
A Real-World Implementation of Linked Data
A Real-World Implementation of Linked DataA Real-World Implementation of Linked Data
A Real-World Implementation of Linked DataDimitri van Hees
 
Designing Content for Multiple Devices
Designing Content for Multiple DevicesDesigning Content for Multiple Devices
Designing Content for Multiple DevicesBrandon Carson
 
Barcamphanoi Opensocial Application Development
Barcamphanoi Opensocial Application DevelopmentBarcamphanoi Opensocial Application Development
Barcamphanoi Opensocial Application DevelopmentHoat Le
 

Similar to Adapting our API for multiple platforms (20)

Philly ete-2011
Philly ete-2011Philly ete-2011
Philly ete-2011
 
Introduction to (web) APIs - definitions, examples, concepts and trends
Introduction to (web) APIs - definitions, examples, concepts and trendsIntroduction to (web) APIs - definitions, examples, concepts and trends
Introduction to (web) APIs - definitions, examples, concepts and trends
 
Digital natives: freedom and hackability in a mobile future
Digital natives: freedom and hackability in a mobile futureDigital natives: freedom and hackability in a mobile future
Digital natives: freedom and hackability in a mobile future
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
 
Simple mobile Websites
Simple mobile WebsitesSimple mobile Websites
Simple mobile Websites
 
Next Generation Portals : How OpenSocial Standard Adds Social to the Mix?
Next Generation Portals : How OpenSocial Standard Adds Social to the Mix? Next Generation Portals : How OpenSocial Standard Adds Social to the Mix?
Next Generation Portals : How OpenSocial Standard Adds Social to the Mix?
 
Michael Yoch (NPR) - The NPR API: Powering "Radio" in a Multiplatform World
Michael Yoch (NPR) - The NPR API: Powering "Radio" in a Multiplatform WorldMichael Yoch (NPR) - The NPR API: Powering "Radio" in a Multiplatform World
Michael Yoch (NPR) - The NPR API: Powering "Radio" in a Multiplatform World
 
Programing for the iPhone
Programing for the iPhonePrograming for the iPhone
Programing for the iPhone
 
BarCamp KL H20 Open Social Hackathon
BarCamp KL H20 Open Social HackathonBarCamp KL H20 Open Social Hackathon
BarCamp KL H20 Open Social Hackathon
 
The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API Platform
 
Andriy Vandakurov about "Frontend. Global domination"
Andriy Vandakurov about  "Frontend. Global domination" Andriy Vandakurov about  "Frontend. Global domination"
Andriy Vandakurov about "Frontend. Global domination"
 
Pivorak.javascript.global domination
Pivorak.javascript.global dominationPivorak.javascript.global domination
Pivorak.javascript.global domination
 
Web Based Mobile Linux World
Web Based Mobile Linux WorldWeb Based Mobile Linux World
Web Based Mobile Linux World
 
Trends in front end engineering_handouts
Trends in front end engineering_handoutsTrends in front end engineering_handouts
Trends in front end engineering_handouts
 
Offline of web applications
Offline of web applicationsOffline of web applications
Offline of web applications
 
Offline for web - Frontend Dev Conf Minsk 2014
Offline for web - Frontend Dev Conf Minsk 2014Offline for web - Frontend Dev Conf Minsk 2014
Offline for web - Frontend Dev Conf Minsk 2014
 
A Real-World Implementation of Linked Data
A Real-World Implementation of Linked DataA Real-World Implementation of Linked Data
A Real-World Implementation of Linked Data
 
Designing Content for Multiple Devices
Designing Content for Multiple DevicesDesigning Content for Multiple Devices
Designing Content for Multiple Devices
 
Internet
InternetInternet
Internet
 
Barcamphanoi Opensocial Application Development
Barcamphanoi Opensocial Application DevelopmentBarcamphanoi Opensocial Application Development
Barcamphanoi Opensocial Application Development
 

More from Rouven Weßling

API Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationAPI Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationRouven Weßling
 
API World 2016 - API Mashup - Combining for Fun and Profit
API World 2016 - API Mashup - Combining for Fun and ProfitAPI World 2016 - API Mashup - Combining for Fun and Profit
API World 2016 - API Mashup - Combining for Fun and ProfitRouven Weßling
 
vienna.js - Automatic testing of (RESTful) API documentation
vienna.js - Automatic testing of (RESTful) API documentationvienna.js - Automatic testing of (RESTful) API documentation
vienna.js - Automatic testing of (RESTful) API documentationRouven Weßling
 
vienna.html - Turn your Blog into Facebook Instant Articles + Contentful Intro
vienna.html - Turn your Blog into Facebook Instant Articles + Contentful Introvienna.html - Turn your Blog into Facebook Instant Articles + Contentful Intro
vienna.html - Turn your Blog into Facebook Instant Articles + Contentful IntroRouven Weßling
 
Static Analysis of PHP Code – IPC Berlin 2016
Static Analysis of PHP Code – IPC Berlin 2016Static Analysis of PHP Code – IPC Berlin 2016
Static Analysis of PHP Code – IPC Berlin 2016Rouven Weßling
 
What is the Joomla Framework and why do we need it?
What is the Joomla Framework and why do we need it?What is the Joomla Framework and why do we need it?
What is the Joomla Framework and why do we need it?Rouven Weßling
 

More from Rouven Weßling (7)

API Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API DocumentationAPI Days Paris - Automatic Testing of (RESTful) API Documentation
API Days Paris - Automatic Testing of (RESTful) API Documentation
 
API World 2016 - API Mashup - Combining for Fun and Profit
API World 2016 - API Mashup - Combining for Fun and ProfitAPI World 2016 - API Mashup - Combining for Fun and Profit
API World 2016 - API Mashup - Combining for Fun and Profit
 
vienna.js - Automatic testing of (RESTful) API documentation
vienna.js - Automatic testing of (RESTful) API documentationvienna.js - Automatic testing of (RESTful) API documentation
vienna.js - Automatic testing of (RESTful) API documentation
 
vienna.html - Turn your Blog into Facebook Instant Articles + Contentful Intro
vienna.html - Turn your Blog into Facebook Instant Articles + Contentful Introvienna.html - Turn your Blog into Facebook Instant Articles + Contentful Intro
vienna.html - Turn your Blog into Facebook Instant Articles + Contentful Intro
 
Static Analysis of PHP Code – IPC Berlin 2016
Static Analysis of PHP Code – IPC Berlin 2016Static Analysis of PHP Code – IPC Berlin 2016
Static Analysis of PHP Code – IPC Berlin 2016
 
What is the Joomla Framework and why do we need it?
What is the Joomla Framework and why do we need it?What is the Joomla Framework and why do we need it?
What is the Joomla Framework and why do we need it?
 
Joomla Day DK 2012
Joomla Day DK 2012Joomla Day DK 2012
Joomla Day DK 2012
 

Recently uploaded

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 

Recently uploaded (20)

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 

Adapting our API for multiple platforms

  • 1. Adapting our API 
 for multiple platforms BY ROUVEN WEßLING
  • 2. Like a CMS… without the bad bits. Contentful is a content management developer platform with an API at its core.
  • 3. How do you consume news? At Contentful we had to adapt our APIs to suite a wide variety of platforms and use cases. How did we do it?
  • 4. In the UK newspaper circulation fell 43% between 2001 and 2014. In the US 10% of subscribers read online. NEWSPAPER The old fashioned way. As of 2016, just 20% of US adults read print paper news. Just 5% of 18 to 29-year-olds.
  • 5. 85% of US adults consume news on digital devices. 13% consume news only on desktops/laptops. 42% of adults using both mobile and desktop prefer the desktop. WEB
  • 6. 70% of US adults aged 18-29 prefer or only use mobile devices. 88% of mobile internet time is spent in apps. 25% of US smartphone owners prefer apps; 25% the mobile web. MOBILE All the cool kids do it.
  • 7. Amazon has sold over 5 million Echos in the US. CNN got 36.5 million unique readers from Apple News in September 2016. Sky Sports gets around 1 million daily viewers on Snapchat Discover. NEW PLATFORMS Are you ready for them?
  • 8. TODAY CONTENT HAS TO BE MULT-PLATFORM Consumption behavior is changing. Companies who can’t adapt will be left behind.
  • 9. Modular
 Built to make content reusable and channel agnostic. Microservice API-driven design allows powerful integration
 with third parties. Cloud service
 Focus on the user experience; not running the backend The CMS that enables developers to serve all platforms.
  • 11. Limitations Enable developers to present content on all connected platforms.* The devices might lose its internet connection at any time. Offline Mobile devices might be on a slow or metered connection. Bandwidth Some platforms require the content to be sent to them. Push Embedded platforms have limited processing power. Performance *As long as they support HTTP and JSON
  • 12. 12 Offline Mobile devices might lose their internet connection at any time.
  • 13. SYNC API • Download all content to the device • Store a token that marks the last content that has been synced • Next sync; get only changed content #!/bin/sh curl 'https://cdn.contentful.com/spaces/cfexampleapi/sync? access_token=b4c0n73n7fu1&initial=true'
  • 14. SYNC API • Download all content to the device • Store a token that marks the last content that has been synced • Next sync; get only changed content { "sys": { "type": "Array" }, "items": [ { "sys": {}, "fields": { "name": { "en-US": "London" }, "center": { "en-US": { "lon": -0.12548719999995228, "lat": 51.508515 } } } } ], "nextSyncUrl": "https://cdn.contentful.com/spaces/cfexampleapi/sync? sync_token=w5ZGw6JFwqZmVcKsE8Kow4grw45QdybCnV_Cg8OASMKpwo1UY8K8bsKFwqJrw7DDhcKnM2 RDOVbDt1E-wo7CnDjChMKKGsK1wrzCrBzCqMOpZAwOOcOvCcOAwqHDv0XCiMKaOcOxZA8BJUzDr8K- wo1lNx7DnHE" }
  • 15. Push Unlike the web and mobile apps, some content platforms require the publisher to provide the content to them.
  • 16. www.contentful.com WEBHOOKS • Don’t call us; we’ll call you • Select the events necessary • Payload contains the entire body
  • 17. 17 Bandwidth Mobile networks are super fast - but not everywhere. Enable users to get to content before they get bored.
  • 18. Images API • Resize images server side so they are as small as possible. • When constrained by bandwidth, resize further or reduce the quality.
  • 19. LOCALES • Most people never change the websites/apps language • Optimize for the common case: only load for the users current locale #!/bin/sh curl 'https://cdn.contentful.com/spaces/cfexampleapi/entries/nyancat? access_token=b4c0n73n7fu1&locale=en-US' curl 'https://cdn.contentful.com/spaces/cfexampleapi/entries/nyancat? access_token=b4c0n73n7fu1&locale=tlh'
  • 20. LOCALES • Most people never change the websites/apps language • Optimize for the common case: only load for the users current locale { "sys": { "id": "nyancat", "locale": "en-US" }, "fields": { "name": "Nyan Cat", "bestFriend": { "sys": { "type": "Link", "linkType": "Entry", "id": "happycat" } }, "birthday": "2011-04-04T22:00:00+00:00", "lives": 1337, } }
  • 21. LOCALES • Most people never change the websites/apps language • Optimize for the common case: only load for the users current locale { "sys": { "id": "nyancat", "locale": "tlh" }, "fields": { "name": "Nyan vIghro'", "bestFriend": { "sys": { "type": "Link", "linkType": "Entry", "id": "happycat" } }, "birthday": "2011-04-04T22:00:00+00:00", "lives": 1337, } }
  • 22. Performance Embedded platforms are very different from the computer we all use.
  • 23. ADJUST PAYLOAD • JSON is very lightweight • Less JSON parses faster than more JSON • Only worth it on severely constrained devices #!/bin/sh curl 'https://cdn.contentful.com/spaces/cfexampleapi/entries? access_token=b4c0n73n7fu1&content_type=cat&select=sys.id,fields.name'
  • 24. ADJUST PAYLOAD • JSON is very lightweight • Less JSON parses faster than more JSON • Only worth it on severely constrained devices { "sys": { "type": "Array" }, "total": 3, "skip": 0, "limit": 100, "items": [ { "fields": { "name": "Nyan Cat" }, "sys": { "id": "nyancat" } }, { "fields": { "name": "Garfield" }, "sys": { "id": "garfield" } } ] }
  • 25. RESOLVE
 REFERENCES • Avoid API requests by fetching linked resources • Control over the level of depth #!/bin/sh curl 'https://cdn.contentful.com/spaces/cfexampleapi/entries? access_token=b4c0n73n7fu1&content_type=cat&fields.color=rainbow&include=1'
  • 26. RESOLVE
 REFERENCES • Avoid API requests by fetching linked resources • Control over the level of depth { "items": [{ "fields": { "name": "Nyan Cat", "color": "rainbow", "bestFriend": { "sys": { "type": "Link", "id": "happycat" } } } }], "includes": [{ "fields": { "name": "Happy Cat", "color": "gray", "bestFriend": { "sys": { "type": "Link", "id": "nyancat" } } } }] }
  • 27. COMPLEX QUERIES • Avoid API requests with complex queries • Search on referenced content #!/bin/sh curl ‘https://cdn.contentful.com/spaces/cfexampleapi/entries? access_token=b4c0n73n7fu1&content_type=cat&limit=1&include=0&
 fields.bestFriend.sys.contentType.sys.id=cat&fields.bestFriend.fields.color=rainbow'
  • 28. COMPLEX QUERIES • Avoid API requests with complex queries • Search on referenced content { "sys": { "type": "Array" }, "total": 1, "skip": 0, "limit": 1, "items": [ { "sys": { "id": "happycat", "locale": "en-US" }, "fields": { "name": "Happy Cat", "color": "gray", "bestFriend": { "sys": { "type": "Link", "linkType": "Entry", "id": "nyancat" } }, "lives": 1 } } ] }