SlideShare a Scribd company logo
1 of 15
Data To Go
Mobile API Design
Chuck Greb
Mobile Platform Architect
AWeber Communications
@ecgreb
Data To Go
Good Mobile API Design
Chuck Greb
Mobile Platform Architect
AWeber Communications
@ecgreb
A Brief Survey
What is an API?
An application programming interface (API)
is a specification of how software
components should interact with each other.
In most cases an API is a library that
includes specification for routines, data
structures, object classes, and variables.
http://en.wikipedia.org/wiki/Application_programming_interface
Remote Service API
● Remote (web-based) services
● Desktop, laptop, or mobile client
● Communication protocol and data model
(HTTP + REST + JSON)
Web API Request
Mobile API Request
Mobile API requests are
generally slower and more
prone to timeouts and other
failures!
3 Principles of Good Mobile APIs
1. Reduce round trips to the server
2. Control verbosity
3. Restrict access
These 3 rules don't always get along!
Principle #1
Reduce round trips to the server
● Resources are limited (battery,
bandwidth, memory, CPU)
● Eliminate network overhead
● Brevity trumps discoverability
● Users are impatient
Batch Request (3 in 1)
POST https://www.example.com/api/v1/login
Input
{"username":"chuck@example.com", "password":"Kronos"}
Output
{
"user_id": 123
"access_token":"Y2h1Y2tAZXhhbXBsZS5jb20=",
"name":"Chuck Greb",
"email":"chuck@example.com",
"avatar":"http://www.example.com/images/dh3d67kfb.jpg",
"recent_messages": [
{"message_id":"101", "subject":"Hey!", "sender":{...}},
{"message_id":"102", "subject":"What's up?", "sender":{...}},
...
]
}
Principle #2
Control Verbosity
● Slow connection speed
● Limited data plans $$$
● Purge irrelevant and empty data
● Specify verbosity level per request
● Object expansion
Object Expansion
GET https://www.example.com/api/v1/user/123/recent_messages
{"recent_messages": [
{
"message_id":"101", "subject":"Hey bro!", "sender":{
"name":"Jeff Greb",
"avatar":"http://www.example.com/images/dh3d67kfb.jpg"}
},
...
]}
GET https://www.example.com/api/v1/message/101
{
"message_id":"101", "subject":"Hey bro!", "sender":{
"name":"Jeff Greb",
"avatar":"http://www.example.com/images/dh3d67kfb.jpg",
"interests":["English", "Japanese", "Music", "Comedy", ...]},
"timestamp":"2013-6-12T13:38:22",
"body":"Long time no see. What's new? I was thinking last..."
}
Principle #3
Restrict Access
● Identify the source of all requests
● Prevent unauthorized access
● Protect sensitive data
● Mobile-friendly security model
Authentication & Authorization
POST https://www.example.com/api/v1/login
Input
{"username":"chuck@example.com", "password":"Kronos"}
Output
{
"user_id": 123,
"auth_token":"Y2h1Y2tAZXhhbXBsZS5jb20="
...
}
Header
"Access-Token":"Y2h1Y2tAZXhhbXBsZS5jb20="
Thank You
Questions?
Chuck Greb
Mobile Platform Architect
AWeber Communications
@ecgreb

More Related Content

Viewers also liked

Creating an Effective Mobile API
Creating an Effective Mobile API Creating an Effective Mobile API
Creating an Effective Mobile API Nick DeNardis
 
Jordi Romero Api for-the-mobile-era
Jordi Romero Api for-the-mobile-eraJordi Romero Api for-the-mobile-era
Jordi Romero Api for-the-mobile-era.toster
 
Api mobile first
Api mobile firstApi mobile first
Api mobile firstChris Saez
 
Mobile Api and Caching
Mobile Api and CachingMobile Api and Caching
Mobile Api and CachingNew Relic
 
Mobile API: Design & Techniques
Mobile API: Design & TechniquesMobile API: Design & Techniques
Mobile API: Design & TechniquesFred Brunel
 
Data to Go: Mobile API Design
Data to Go: Mobile API DesignData to Go: Mobile API Design
Data to Go: Mobile API DesignChuck Greb
 
Data to Go: Mobile API Design (SXSW)
Data to Go: Mobile API Design (SXSW)Data to Go: Mobile API Design (SXSW)
Data to Go: Mobile API Design (SXSW)Chuck Greb
 
Build a REST API for your Mobile Apps using Node.js
Build a REST API for your Mobile Apps using Node.jsBuild a REST API for your Mobile Apps using Node.js
Build a REST API for your Mobile Apps using Node.jsStormpath
 
We we should be Mobile API - First, by Brad Hipps
We we should be Mobile API - First, by Brad HippsWe we should be Mobile API - First, by Brad Hipps
We we should be Mobile API - First, by Brad HippsPuerto Rico Tech Summit
 
Designing API for mobile apps (MobileWarsaw 19.01.2015)
Designing API for mobile apps (MobileWarsaw 19.01.2015)Designing API for mobile apps (MobileWarsaw 19.01.2015)
Designing API for mobile apps (MobileWarsaw 19.01.2015)Wojtek Erbetowski
 

Viewers also liked (11)

Creating an Effective Mobile API
Creating an Effective Mobile API Creating an Effective Mobile API
Creating an Effective Mobile API
 
Jordi Romero Api for-the-mobile-era
Jordi Romero Api for-the-mobile-eraJordi Romero Api for-the-mobile-era
Jordi Romero Api for-the-mobile-era
 
Api mobile first
Api mobile firstApi mobile first
Api mobile first
 
Mobile Api and Caching
Mobile Api and CachingMobile Api and Caching
Mobile Api and Caching
 
Mobile API: Design & Techniques
Mobile API: Design & TechniquesMobile API: Design & Techniques
Mobile API: Design & Techniques
 
Data to Go: Mobile API Design
Data to Go: Mobile API DesignData to Go: Mobile API Design
Data to Go: Mobile API Design
 
Data to Go: Mobile API Design (SXSW)
Data to Go: Mobile API Design (SXSW)Data to Go: Mobile API Design (SXSW)
Data to Go: Mobile API Design (SXSW)
 
Build a REST API for your Mobile Apps using Node.js
Build a REST API for your Mobile Apps using Node.jsBuild a REST API for your Mobile Apps using Node.js
Build a REST API for your Mobile Apps using Node.js
 
We we should be Mobile API - First, by Brad Hipps
We we should be Mobile API - First, by Brad HippsWe we should be Mobile API - First, by Brad Hipps
We we should be Mobile API - First, by Brad Hipps
 
Designing API for mobile apps (MobileWarsaw 19.01.2015)
Designing API for mobile apps (MobileWarsaw 19.01.2015)Designing API for mobile apps (MobileWarsaw 19.01.2015)
Designing API for mobile apps (MobileWarsaw 19.01.2015)
 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
 

Similar to Data To Go: Mobile API Design (Lightning Talk)

apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...apidays
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfAparna Sharma
 
zendframework2 restful
zendframework2 restfulzendframework2 restful
zendframework2 restfultom_li
 
Fullstack Interview Questions and Answers.pdf
Fullstack Interview Questions and Answers.pdfFullstack Interview Questions and Answers.pdf
Fullstack Interview Questions and Answers.pdfcsvishnukumar
 
REST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionREST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionGlenn Antoine
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfAparna Sharma
 
Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack CA API Management
 
APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013Jerome Louvel
 
From Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web SitesFrom Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web SitesRestlet
 
Developing Profitable APIs - John Fraser - Platform A
Developing Profitable APIs - John Fraser - Platform ADeveloping Profitable APIs - John Fraser - Platform A
Developing Profitable APIs - John Fraser - Platform Aauexpo Conference
 
aip-developer-intro_pag2015
aip-developer-intro_pag2015aip-developer-intro_pag2015
aip-developer-intro_pag2015Matthew Vaughn
 
Starting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for OpsStarting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for OpsDynatrace
 
What is the difference between an api and web services
What is the difference between an api and web servicesWhat is the difference between an api and web services
What is the difference between an api and web servicesAparna Sharma
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developersPatrick Savalle
 
SPTECHCON - Rev Your Engines - SharePoint 2013 Performance Enhancements
SPTECHCON - Rev Your Engines - SharePoint 2013 Performance EnhancementsSPTECHCON - Rev Your Engines - SharePoint 2013 Performance Enhancements
SPTECHCON - Rev Your Engines - SharePoint 2013 Performance EnhancementsEric Shupps
 
Building A Mobile First API When You're Not Mobile First - Tyler Singletary
Building A Mobile First API When You're Not Mobile First - Tyler SingletaryBuilding A Mobile First API When You're Not Mobile First - Tyler Singletary
Building A Mobile First API When You're Not Mobile First - Tyler SingletaryProgrammableWeb
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Jackson F. de A. Mafra
 

Similar to Data To Go: Mobile API Design (Lightning Talk) (20)

REST != WebAPI
REST != WebAPIREST != WebAPI
REST != WebAPI
 
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
apidays LIVE Hong Kong 2021 - Multi-Protocol APIs at Scale in Adidas by Jesus...
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdf
 
zendframework2 restful
zendframework2 restfulzendframework2 restful
zendframework2 restful
 
Fullstack Interview Questions and Answers.pdf
Fullstack Interview Questions and Answers.pdfFullstack Interview Questions and Answers.pdf
Fullstack Interview Questions and Answers.pdf
 
REST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of ConfusionREST & RESTful APIs: The State of Confusion
REST & RESTful APIs: The State of Confusion
 
Modern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdfModern REST API design principles and rules.pdf
Modern REST API design principles and rules.pdf
 
Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack Protecting Your APIs Against Attack & Hijack
Protecting Your APIs Against Attack & Hijack
 
APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013APIdays San Francisco, 06/22/2013
APIdays San Francisco, 06/22/2013
 
From Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web SitesFrom Web APIs to Cross-Device Web Sites
From Web APIs to Cross-Device Web Sites
 
Developing Profitable APIs - John Fraser - Platform A
Developing Profitable APIs - John Fraser - Platform ADeveloping Profitable APIs - John Fraser - Platform A
Developing Profitable APIs - John Fraser - Platform A
 
aip-developer-intro_pag2015
aip-developer-intro_pag2015aip-developer-intro_pag2015
aip-developer-intro_pag2015
 
REST API
REST APIREST API
REST API
 
Starting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for OpsStarting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for Ops
 
What is the difference between an api and web services
What is the difference between an api and web servicesWhat is the difference between an api and web services
What is the difference between an api and web services
 
REST-API introduction for developers
REST-API introduction for developersREST-API introduction for developers
REST-API introduction for developers
 
SPTECHCON - Rev Your Engines - SharePoint 2013 Performance Enhancements
SPTECHCON - Rev Your Engines - SharePoint 2013 Performance EnhancementsSPTECHCON - Rev Your Engines - SharePoint 2013 Performance Enhancements
SPTECHCON - Rev Your Engines - SharePoint 2013 Performance Enhancements
 
Building A Mobile First API When You're Not Mobile First - Tyler Singletary
Building A Mobile First API When You're Not Mobile First - Tyler SingletaryBuilding A Mobile First API When You're Not Mobile First - Tyler Singletary
Building A Mobile First API When You're Not Mobile First - Tyler Singletary
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
 
Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015Phalcon 2 High Performance APIs - DevWeekPOA 2015
Phalcon 2 High Performance APIs - DevWeekPOA 2015
 

More from Chuck Greb

Testable Android Architecture
Testable Android ArchitectureTestable Android Architecture
Testable Android ArchitectureChuck Greb
 
Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)Chuck Greb
 
What's the deal with Android maps?
What's the deal with Android maps?What's the deal with Android maps?
What's the deal with Android maps?Chuck Greb
 
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)Chuck Greb
 
Building Location-Aware Apps with Open Source & Open Data
Building Location-Aware Apps with Open Source & Open DataBuilding Location-Aware Apps with Open Source & Open Data
Building Location-Aware Apps with Open Source & Open DataChuck Greb
 
AnDevCon 2013 Roundup
AnDevCon 2013 RoundupAnDevCon 2013 Roundup
AnDevCon 2013 RoundupChuck Greb
 
Google Charts for native Android apps
Google Charts for native Android appsGoogle Charts for native Android apps
Google Charts for native Android appsChuck Greb
 
HowAboutWe... Build an Android App
HowAboutWe... Build an Android AppHowAboutWe... Build an Android App
HowAboutWe... Build an Android AppChuck Greb
 

More from Chuck Greb (11)

Testable Android Architecture
Testable Android ArchitectureTestable Android Architecture
Testable Android Architecture
 
Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
Building Location-Aware Apps with Open Source & Open Data (SXSW 2015)
 
Bu
BuBu
Bu
 
What's the deal with Android maps?
What's the deal with Android maps?What's the deal with Android maps?
What's the deal with Android maps?
 
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
Building Location-Aware Apps using Open Source (AnDevCon SF 2014)
 
Building Location-Aware Apps with Open Source & Open Data
Building Location-Aware Apps with Open Source & Open DataBuilding Location-Aware Apps with Open Source & Open Data
Building Location-Aware Apps with Open Source & Open Data
 
Notifunk
NotifunkNotifunk
Notifunk
 
AnDevCon 2013 Roundup
AnDevCon 2013 RoundupAnDevCon 2013 Roundup
AnDevCon 2013 Roundup
 
Android TDD
Android TDDAndroid TDD
Android TDD
 
Google Charts for native Android apps
Google Charts for native Android appsGoogle Charts for native Android apps
Google Charts for native Android apps
 
HowAboutWe... Build an Android App
HowAboutWe... Build an Android AppHowAboutWe... Build an Android App
HowAboutWe... Build an Android App
 

Recently uploaded

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 

Data To Go: Mobile API Design (Lightning Talk)

  • 1. Data To Go Mobile API Design Chuck Greb Mobile Platform Architect AWeber Communications @ecgreb
  • 2. Data To Go Good Mobile API Design Chuck Greb Mobile Platform Architect AWeber Communications @ecgreb
  • 4. What is an API? An application programming interface (API) is a specification of how software components should interact with each other. In most cases an API is a library that includes specification for routines, data structures, object classes, and variables. http://en.wikipedia.org/wiki/Application_programming_interface
  • 5. Remote Service API ● Remote (web-based) services ● Desktop, laptop, or mobile client ● Communication protocol and data model (HTTP + REST + JSON)
  • 7. Mobile API Request Mobile API requests are generally slower and more prone to timeouts and other failures!
  • 8. 3 Principles of Good Mobile APIs 1. Reduce round trips to the server 2. Control verbosity 3. Restrict access These 3 rules don't always get along!
  • 9. Principle #1 Reduce round trips to the server ● Resources are limited (battery, bandwidth, memory, CPU) ● Eliminate network overhead ● Brevity trumps discoverability ● Users are impatient
  • 10. Batch Request (3 in 1) POST https://www.example.com/api/v1/login Input {"username":"chuck@example.com", "password":"Kronos"} Output { "user_id": 123 "access_token":"Y2h1Y2tAZXhhbXBsZS5jb20=", "name":"Chuck Greb", "email":"chuck@example.com", "avatar":"http://www.example.com/images/dh3d67kfb.jpg", "recent_messages": [ {"message_id":"101", "subject":"Hey!", "sender":{...}}, {"message_id":"102", "subject":"What's up?", "sender":{...}}, ... ] }
  • 11. Principle #2 Control Verbosity ● Slow connection speed ● Limited data plans $$$ ● Purge irrelevant and empty data ● Specify verbosity level per request ● Object expansion
  • 12. Object Expansion GET https://www.example.com/api/v1/user/123/recent_messages {"recent_messages": [ { "message_id":"101", "subject":"Hey bro!", "sender":{ "name":"Jeff Greb", "avatar":"http://www.example.com/images/dh3d67kfb.jpg"} }, ... ]} GET https://www.example.com/api/v1/message/101 { "message_id":"101", "subject":"Hey bro!", "sender":{ "name":"Jeff Greb", "avatar":"http://www.example.com/images/dh3d67kfb.jpg", "interests":["English", "Japanese", "Music", "Comedy", ...]}, "timestamp":"2013-6-12T13:38:22", "body":"Long time no see. What's new? I was thinking last..." }
  • 13. Principle #3 Restrict Access ● Identify the source of all requests ● Prevent unauthorized access ● Protect sensitive data ● Mobile-friendly security model
  • 14. Authentication & Authorization POST https://www.example.com/api/v1/login Input {"username":"chuck@example.com", "password":"Kronos"} Output { "user_id": 123, "auth_token":"Y2h1Y2tAZXhhbXBsZS5jb20=" ... } Header "Access-Token":"Y2h1Y2tAZXhhbXBsZS5jb20="
  • 15. Thank You Questions? Chuck Greb Mobile Platform Architect AWeber Communications @ecgreb