Your SlideShare is downloading. ×
0
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Data To Go: Mobile API Design (Lightning Talk)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Data To Go: Mobile API Design (Lightning Talk)

230

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
230
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 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
  • 3. A Brief Survey
  • 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)
  • 6. Web API Request
  • 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

×