SlideShare a Scribd company logo
3 things your app API is doing
WRONG
Robert MacLean  @rmaclean
Introduction
 I’m Robert
 that is all you get, I have 18 slides to get through
 Not covering the obvious (security, validate input, use REST etc…)
 Do this regardless if you plan for apps or not
Be agnostic
 REST won
 REST is about HTTP
 Stop pushing your C#, PHP or JavaScript views on the world
 Tip: SQLite data structures
Be agnostic – bad
example 1
[{
“title”: {
“en”: ”this is an awesome talk”
}
}]
[{
“title”: {
“fr”: ”Il s'agit d'un discours génial”
}
}]
Magically appearing properties.
Assumption of dynamic languages &
objects
Be agnostic – good
example 1 [{
“title”: {
“value”: ”this is an awesome talk”,
“lang”:”en”
}
}]Be consistent and state intent
Be agnostic – bad
example 2
[{
“data”: [
{
“user”:”paul smith”,
“id”:12,
“type”:”actor”
},
{
“title”:”theseus”,
“id”:232,
“type”:”game”
},
{
“delete”:1,
“id”:12,
“type”:”actor”
}]
}]
Arrays that contain different types
Be agnostic – good
example 2
[{
“actors”: [
{
“user”:”paul smith”,
“id”:12,
}],
“games”: [
{
“title”:”theseus”,
“id”:232,
}],
“deleted”: [
{
“id”:12,
“type”:”actor”
}]
}]
Separate arrays or totally separate
calls would be good.
Identify and respond
 Your API should allow the app to say what type of app it is
 Do not expect technical information
 Respond accordingly to the identity
Identify– bad example
[{“user”:”1234”}]
[{“user”:”1234”, “deviceId”:”76879902”}]
[{“user”:”1234”,
“deviceId”:”76879902”,”wresolution”:480,”hresolu
tion”:800}]
1. Assuming user without device
2. No device identification info
3. Asking for technical information
Identify – good example [{
“user”:”1234”,
“deviceId”:”76879902”,
”os”:”windows”,
”platform”:”phone”,
”resolution”:”medium”
}]
Using sets of identifiers which are not
fixed to hardware details
Respond – bad example
[{
“image”:{
“50x50”: “http://fqdn/image50x50.png”,
“400x400”: “http://fqdn/image400x400.png”,
}
}]
1. Fixed content regardless of device
2. Same respond data type
Respond – good example
[{
“image”:{
“thumbnail”: “http://fqdn/image50x50.png”,
“image”: “http://fqdn/image400x400.png”,
}
}]
<image thumbnail=“http://fqdn/image50x50.png”
image=“http://fqdn/image400x400.png” />
1. Provide data based on info
2. Different data types
Send more data
 Send data that isn’t shown
 Send data that has been computed already
 Send data in raw formats
Send more data – bad
example 1
[{
“videos”:[
“1”:”http://fqdn/video1.mp4”,
“2”:”http://fqdn/video2.mp4”,
]
}]
Out of band:
 Adverts can’t be skipped
 Advert is any clip less than 30sec
Send data that isn’t shown
Send data that has been computed
already
Send more data – good
example 1
[{
“videos”:[
{
“id”: “1”,
“url”: “http://fqdn/video1.mp4”,
“isAdvert”: “false”,
“hash”:”8736426348726387462123123123”
},
{
“id”: “2”,
“url”: “http://fqdn/video2.mp4”,
“isAdvert”: “true”,
“hash”:”8739487298734987329847298343”
}
]
}]
Send data that isn’t shown
Send data that has been computed
already
Send more data – bad
example 1
[{
“description”:”<h1>Jump by Van Halen</h1><div
class=‘artist’ id=‘1’>Van Halen</div><div
class=‘title’ id=‘9000’>Jump</div><div
class=‘content’>Jump is a song by the American
rock group Van Halen. It was released in
December 1983 as the lead single from their
album 1984. It is the only single the group
released in their career to reach number one on
the U.S. Billboard Hot 100.</div>
}]
Send the raw data
Send more data – good
example 1
[{
“title”:”Jump by Van Halen”,
“artist”:1,
“title”:9000,
“description”:”Jump is a song by the American
rock group Van Halen. It was released in
December 1983 as the lead single from their
album 1984. It is the only single the group
released in their career to reach number one on
the U.S. Billboard Hot 100.”
}]
Send the raw data.
Identify and respond works here too.
Thanks
 Be agnostic
 Identify and respond
 Send more data
@rmaclean
www.sadev.co.za

More Related Content

Similar to 3 things your app API is doing WRONG

Loopback presentation by tineco
Loopback presentation by tinecoLoopback presentation by tineco
Loopback presentation by tineco
Stéphane Guilly
 
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
James Gallagher
 
Speak The Web: The HTML5 Experiments
Speak The Web: The HTML5 ExperimentsSpeak The Web: The HTML5 Experiments
Speak The Web: The HTML5 Experiments
guestd427df
 
apidays LIVE Australia 2021 - API Horror Stories from an Unnamed Coworking Co...
apidays LIVE Australia 2021 - API Horror Stories from an Unnamed Coworking Co...apidays LIVE Australia 2021 - API Horror Stories from an Unnamed Coworking Co...
apidays LIVE Australia 2021 - API Horror Stories from an Unnamed Coworking Co...
apidays
 
Smx Milano 2014 Semantic SEO with Schema.org
Smx Milano 2014 Semantic SEO with Schema.orgSmx Milano 2014 Semantic SEO with Schema.org
Smx Milano 2014 Semantic SEO with Schema.org
Sante J. Achille
 
IBM Connections Activity Stream APIs - Lab Dec 2012
IBM Connections Activity Stream APIs - Lab Dec 2012IBM Connections Activity Stream APIs - Lab Dec 2012
IBM Connections Activity Stream APIs - Lab Dec 2012
Vincent Burckhardt
 
Petr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developeraPetr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developera
WebExpo
 
Walking Down the A11y Road - Lessons Learned from Working on Accessibility of...
Walking Down the A11y Road - Lessons Learned from Working on Accessibility of...Walking Down the A11y Road - Lessons Learned from Working on Accessibility of...
Walking Down the A11y Road - Lessons Learned from Working on Accessibility of...
Radina Matic
 
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
apidays
 
Introduction to threat_modeling
Introduction to threat_modelingIntroduction to threat_modeling
Introduction to threat_modeling
Prabath Siriwardena
 
Как не нужно писать Gherkin сценарии
Как не нужно писать Gherkin сценарииКак не нужно писать Gherkin сценарии
Как не нужно писать Gherkin сценарии
Andrii Dzynia
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
Devnology
 
Graphics & Animation with HTML5
Graphics & Animation with HTML5Graphics & Animation with HTML5
Graphics & Animation with HTML5
Knoldus Inc.
 
Mixpanel
MixpanelMixpanel
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
Bases de Datos NoSQL
Bases de Datos NoSQL Bases de Datos NoSQL
Bases de Datos NoSQL
Jonathan Pichardo
 
HTML5 and CSS3 Shizzle
HTML5 and CSS3 ShizzleHTML5 and CSS3 Shizzle
HTML5 and CSS3 Shizzle
Chris Mills
 
Being a tweaker modern web performance techniques
Being a tweaker   modern web performance techniquesBeing a tweaker   modern web performance techniques
Being a tweaker modern web performance techniquesChris Love
 
Developing Secure Software: Experiences From an International Software Vendor
Developing Secure Software: Experiences From an International Software VendorDeveloping Secure Software: Experiences From an International Software Vendor
Developing Secure Software: Experiences From an International Software Vendor
Achim D. Brucker
 

Similar to 3 things your app API is doing WRONG (20)

Loopback presentation by tineco
Loopback presentation by tinecoLoopback presentation by tineco
Loopback presentation by tineco
 
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
 
Speak The Web: The HTML5 Experiments
Speak The Web: The HTML5 ExperimentsSpeak The Web: The HTML5 Experiments
Speak The Web: The HTML5 Experiments
 
apidays LIVE Australia 2021 - API Horror Stories from an Unnamed Coworking Co...
apidays LIVE Australia 2021 - API Horror Stories from an Unnamed Coworking Co...apidays LIVE Australia 2021 - API Horror Stories from an Unnamed Coworking Co...
apidays LIVE Australia 2021 - API Horror Stories from an Unnamed Coworking Co...
 
Smx Milano 2014 Semantic SEO with Schema.org
Smx Milano 2014 Semantic SEO with Schema.orgSmx Milano 2014 Semantic SEO with Schema.org
Smx Milano 2014 Semantic SEO with Schema.org
 
IBM Connections Activity Stream APIs - Lab Dec 2012
IBM Connections Activity Stream APIs - Lab Dec 2012IBM Connections Activity Stream APIs - Lab Dec 2012
IBM Connections Activity Stream APIs - Lab Dec 2012
 
Petr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developeraPetr Dvořák: Mobilní webové služby pohledem iPhone developera
Petr Dvořák: Mobilní webové služby pohledem iPhone developera
 
- Webexpo 2010
- Webexpo 2010- Webexpo 2010
- Webexpo 2010
 
Walking Down the A11y Road - Lessons Learned from Working on Accessibility of...
Walking Down the A11y Road - Lessons Learned from Working on Accessibility of...Walking Down the A11y Road - Lessons Learned from Working on Accessibility of...
Walking Down the A11y Road - Lessons Learned from Working on Accessibility of...
 
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
 
Introduction to threat_modeling
Introduction to threat_modelingIntroduction to threat_modeling
Introduction to threat_modeling
 
Как не нужно писать Gherkin сценарии
Как не нужно писать Gherkin сценарииКак не нужно писать Gherkin сценарии
Как не нужно писать Gherkin сценарии
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
 
Graphics & Animation with HTML5
Graphics & Animation with HTML5Graphics & Animation with HTML5
Graphics & Animation with HTML5
 
Mixpanel
MixpanelMixpanel
Mixpanel
 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design
 
Bases de Datos NoSQL
Bases de Datos NoSQL Bases de Datos NoSQL
Bases de Datos NoSQL
 
HTML5 and CSS3 Shizzle
HTML5 and CSS3 ShizzleHTML5 and CSS3 Shizzle
HTML5 and CSS3 Shizzle
 
Being a tweaker modern web performance techniques
Being a tweaker   modern web performance techniquesBeing a tweaker   modern web performance techniques
Being a tweaker modern web performance techniques
 
Developing Secure Software: Experiences From an International Software Vendor
Developing Secure Software: Experiences From an International Software VendorDeveloping Secure Software: Experiences From an International Software Vendor
Developing Secure Software: Experiences From an International Software Vendor
 

More from Robert MacLean

14 things you need to be a successful software developer (v3)
14 things you need to be a successful software developer (v3)14 things you need to be a successful software developer (v3)
14 things you need to be a successful software developer (v3)
Robert MacLean
 
Git
GitGit
OWASP TOP 10
OWASP TOP 10OWASP TOP 10
OWASP TOP 10
Robert MacLean
 
Building a µservice with Kotlin, Micronaut & GCP
Building a µservice with Kotlin, Micronaut & GCPBuilding a µservice with Kotlin, Micronaut & GCP
Building a µservice with Kotlin, Micronaut & GCP
Robert MacLean
 
Looking at the Vue
Looking at the VueLooking at the Vue
Looking at the Vue
Robert MacLean
 
Kotlin 101
Kotlin 101Kotlin 101
Kotlin 101
Robert MacLean
 
Features of Kotlin I find exciting
Features of Kotlin I find excitingFeatures of Kotlin I find exciting
Features of Kotlin I find exciting
Robert MacLean
 
JavaScript Gotchas
JavaScript GotchasJavaScript Gotchas
JavaScript Gotchas
Robert MacLean
 
DevConf Survival Guide
DevConf Survival GuideDevConf Survival Guide
DevConf Survival Guide
Robert MacLean
 
The state of testing @ Microsoft
The state of testing @ MicrosoftThe state of testing @ Microsoft
The state of testing @ Microsoft
Robert MacLean
 
Visual Studio ❤ JavaScript
Visual Studio ❤ JavaScriptVisual Studio ❤ JavaScript
Visual Studio ❤ JavaScript
Robert MacLean
 
What is new in C# 6?
What is new in C# 6?What is new in C# 6?
What is new in C# 6?
Robert MacLean
 
Putting the DOT in .NET - Dev/Ops/Test
Putting the DOT in .NET - Dev/Ops/TestPutting the DOT in .NET - Dev/Ops/Test
Putting the DOT in .NET - Dev/Ops/Test
Robert MacLean
 
A Developer Day 2014 - Durban
A Developer Day 2014 - Durban A Developer Day 2014 - Durban
A Developer Day 2014 - Durban
Robert MacLean
 
ASP.NET
ASP.NETASP.NET
LightSwitch
LightSwitchLightSwitch
LightSwitch
Robert MacLean
 
How to build a Mobile API or HTML 5 app in 5 minutes
How to build a Mobile API or HTML 5 app in 5 minutesHow to build a Mobile API or HTML 5 app in 5 minutes
How to build a Mobile API or HTML 5 app in 5 minutes
Robert MacLean
 
Protection of Personal Information Bill (POPI)
Protection of Personal Information Bill (POPI)Protection of Personal Information Bill (POPI)
Protection of Personal Information Bill (POPI)
Robert MacLean
 
Open Source Licensing
Open Source LicensingOpen Source Licensing
Open Source Licensing
Robert MacLean
 
How to give a great presentation
How to give a great presentationHow to give a great presentation
How to give a great presentation
Robert MacLean
 

More from Robert MacLean (20)

14 things you need to be a successful software developer (v3)
14 things you need to be a successful software developer (v3)14 things you need to be a successful software developer (v3)
14 things you need to be a successful software developer (v3)
 
Git
GitGit
Git
 
OWASP TOP 10
OWASP TOP 10OWASP TOP 10
OWASP TOP 10
 
Building a µservice with Kotlin, Micronaut & GCP
Building a µservice with Kotlin, Micronaut & GCPBuilding a µservice with Kotlin, Micronaut & GCP
Building a µservice with Kotlin, Micronaut & GCP
 
Looking at the Vue
Looking at the VueLooking at the Vue
Looking at the Vue
 
Kotlin 101
Kotlin 101Kotlin 101
Kotlin 101
 
Features of Kotlin I find exciting
Features of Kotlin I find excitingFeatures of Kotlin I find exciting
Features of Kotlin I find exciting
 
JavaScript Gotchas
JavaScript GotchasJavaScript Gotchas
JavaScript Gotchas
 
DevConf Survival Guide
DevConf Survival GuideDevConf Survival Guide
DevConf Survival Guide
 
The state of testing @ Microsoft
The state of testing @ MicrosoftThe state of testing @ Microsoft
The state of testing @ Microsoft
 
Visual Studio ❤ JavaScript
Visual Studio ❤ JavaScriptVisual Studio ❤ JavaScript
Visual Studio ❤ JavaScript
 
What is new in C# 6?
What is new in C# 6?What is new in C# 6?
What is new in C# 6?
 
Putting the DOT in .NET - Dev/Ops/Test
Putting the DOT in .NET - Dev/Ops/TestPutting the DOT in .NET - Dev/Ops/Test
Putting the DOT in .NET - Dev/Ops/Test
 
A Developer Day 2014 - Durban
A Developer Day 2014 - Durban A Developer Day 2014 - Durban
A Developer Day 2014 - Durban
 
ASP.NET
ASP.NETASP.NET
ASP.NET
 
LightSwitch
LightSwitchLightSwitch
LightSwitch
 
How to build a Mobile API or HTML 5 app in 5 minutes
How to build a Mobile API or HTML 5 app in 5 minutesHow to build a Mobile API or HTML 5 app in 5 minutes
How to build a Mobile API or HTML 5 app in 5 minutes
 
Protection of Personal Information Bill (POPI)
Protection of Personal Information Bill (POPI)Protection of Personal Information Bill (POPI)
Protection of Personal Information Bill (POPI)
 
Open Source Licensing
Open Source LicensingOpen Source Licensing
Open Source Licensing
 
How to give a great presentation
How to give a great presentationHow to give a great presentation
How to give a great presentation
 

Recently uploaded

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 

Recently uploaded (20)

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 

3 things your app API is doing WRONG

  • 1. 3 things your app API is doing WRONG Robert MacLean  @rmaclean
  • 2. Introduction  I’m Robert  that is all you get, I have 18 slides to get through  Not covering the obvious (security, validate input, use REST etc…)  Do this regardless if you plan for apps or not
  • 3. Be agnostic  REST won  REST is about HTTP  Stop pushing your C#, PHP or JavaScript views on the world  Tip: SQLite data structures
  • 4. Be agnostic – bad example 1 [{ “title”: { “en”: ”this is an awesome talk” } }] [{ “title”: { “fr”: ”Il s'agit d'un discours génial” } }] Magically appearing properties. Assumption of dynamic languages & objects
  • 5. Be agnostic – good example 1 [{ “title”: { “value”: ”this is an awesome talk”, “lang”:”en” } }]Be consistent and state intent
  • 6. Be agnostic – bad example 2 [{ “data”: [ { “user”:”paul smith”, “id”:12, “type”:”actor” }, { “title”:”theseus”, “id”:232, “type”:”game” }, { “delete”:1, “id”:12, “type”:”actor” }] }] Arrays that contain different types
  • 7. Be agnostic – good example 2 [{ “actors”: [ { “user”:”paul smith”, “id”:12, }], “games”: [ { “title”:”theseus”, “id”:232, }], “deleted”: [ { “id”:12, “type”:”actor” }] }] Separate arrays or totally separate calls would be good.
  • 8. Identify and respond  Your API should allow the app to say what type of app it is  Do not expect technical information  Respond accordingly to the identity
  • 9. Identify– bad example [{“user”:”1234”}] [{“user”:”1234”, “deviceId”:”76879902”}] [{“user”:”1234”, “deviceId”:”76879902”,”wresolution”:480,”hresolu tion”:800}] 1. Assuming user without device 2. No device identification info 3. Asking for technical information
  • 10. Identify – good example [{ “user”:”1234”, “deviceId”:”76879902”, ”os”:”windows”, ”platform”:”phone”, ”resolution”:”medium” }] Using sets of identifiers which are not fixed to hardware details
  • 11. Respond – bad example [{ “image”:{ “50x50”: “http://fqdn/image50x50.png”, “400x400”: “http://fqdn/image400x400.png”, } }] 1. Fixed content regardless of device 2. Same respond data type
  • 12. Respond – good example [{ “image”:{ “thumbnail”: “http://fqdn/image50x50.png”, “image”: “http://fqdn/image400x400.png”, } }] <image thumbnail=“http://fqdn/image50x50.png” image=“http://fqdn/image400x400.png” /> 1. Provide data based on info 2. Different data types
  • 13. Send more data  Send data that isn’t shown  Send data that has been computed already  Send data in raw formats
  • 14. Send more data – bad example 1 [{ “videos”:[ “1”:”http://fqdn/video1.mp4”, “2”:”http://fqdn/video2.mp4”, ] }] Out of band:  Adverts can’t be skipped  Advert is any clip less than 30sec Send data that isn’t shown Send data that has been computed already
  • 15. Send more data – good example 1 [{ “videos”:[ { “id”: “1”, “url”: “http://fqdn/video1.mp4”, “isAdvert”: “false”, “hash”:”8736426348726387462123123123” }, { “id”: “2”, “url”: “http://fqdn/video2.mp4”, “isAdvert”: “true”, “hash”:”8739487298734987329847298343” } ] }] Send data that isn’t shown Send data that has been computed already
  • 16. Send more data – bad example 1 [{ “description”:”<h1>Jump by Van Halen</h1><div class=‘artist’ id=‘1’>Van Halen</div><div class=‘title’ id=‘9000’>Jump</div><div class=‘content’>Jump is a song by the American rock group Van Halen. It was released in December 1983 as the lead single from their album 1984. It is the only single the group released in their career to reach number one on the U.S. Billboard Hot 100.</div> }] Send the raw data
  • 17. Send more data – good example 1 [{ “title”:”Jump by Van Halen”, “artist”:1, “title”:9000, “description”:”Jump is a song by the American rock group Van Halen. It was released in December 1983 as the lead single from their album 1984. It is the only single the group released in their career to reach number one on the U.S. Billboard Hot 100.” }] Send the raw data. Identify and respond works here too.
  • 18. Thanks  Be agnostic  Identify and respond  Send more data @rmaclean www.sadev.co.za