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

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
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.
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
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.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Recently uploaded (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
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...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
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 ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

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 } } ] }