Building Web Services   for Mobile Apps   Brent Simmons @brentsimmons     Nick Bradbury @nbradbury     Brian Reischl @bria...
IntroductionsBrent Simmons: NetNewsWire and Mars EditNick Bradbury: HomeSite, TopStyle, FeedDemon.Brian Reischl: 5+ years ...
Glassboard- Private Group Messaging- Available on iOS, Android and WP7
History- Idea formally born in December 2010- Development began in January 2011- First beta in mid-May- Second beta in Jul...
Platform Details- Built on Microsoft Windows Azure- Both WebRoles and Worker Roles- Table, Queue and Blob Storage- SQL Azu...
Initial API Design- REST Implementation- JSON body content when possible- Multi-part Form otherwise
Why REST?- Main idea of REST is uniquely addressable objects- Easier for client developers to understand- Supported with b...
REST API Examples:                BoardsGET /api/boardsgets the boards for a userPOST /api/boardscreates a new board with ...
Why REST cont...- HTTP Status Codes- Additional HTTP Headers  POST /api/boards/  RESPONSE:  Status Code: 409 Conflict  X-Gl...
Why JSON?- Smaller “on the wire” footprint
JSON Example{    "AttachmentHasThumbnail":true,    "AttachmentId":"XXX-XXXX-XXXX-XXX",    "AttachmentType":0,    "AuthorId...
XML Output<StatusInfo> <AttachmentHasThumbnail>true</AttachmentHasThumbnail> <AttachmentId> XXX-XXXX-XXXX-XXX </Attachment...
{                                                                <StatusInfo>    "AttachmentHasThumbnail":true,           ...
iOS Client- Built by Brent Simmons
Android Client- Build by Nick Bradbury
What we learned...
The Problem...- Stringent REST implementations have limitations- Mobile applications have their own limitationsMobile apps...
The Newsfeed Solution- Single call to get all new statuses and comments- One out-bound request on startup- Data body just ...
Platform API Future- More “newsfeed like” REST hybrid calls- Open to 3rd parties?
Q&A(with your host @jennyblumberg        aka @glassboard        aka @sepialabs)
Upcoming SlideShare
Loading in …5
×

Building Web Services for Mobile Apps

1,422 views

Published on

Sepia Labs presentation on build web services. Presented at 360iDev.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,422
On SlideShare
0
From Embeds
0
Number of Embeds
804
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Building Web Services for Mobile Apps

    1. 1. Building Web Services for Mobile Apps Brent Simmons @brentsimmons Nick Bradbury @nbradbury Brian Reischl @brianreischl Nick Harris @nick_harris @SepiaLabs @Glassboard
    2. 2. IntroductionsBrent Simmons: NetNewsWire and Mars EditNick Bradbury: HomeSite, TopStyle, FeedDemon.Brian Reischl: 5+ years at NewsGatorNick Harris: 5+ years at NewsGator
    3. 3. Glassboard- Private Group Messaging- Available on iOS, Android and WP7
    4. 4. History- Idea formally born in December 2010- Development began in January 2011- First beta in mid-May- Second beta in July- Initial Release August 2011
    5. 5. Platform Details- Built on Microsoft Windows Azure- Both WebRoles and Worker Roles- Table, Queue and Blob Storage- SQL Azure for diagnostic data
    6. 6. Initial API Design- REST Implementation- JSON body content when possible- Multi-part Form otherwise
    7. 7. Why REST?- Main idea of REST is uniquely addressable objects- Easier for client developers to understand- Supported with basic frameworks on any platform- Encourages more universal architecture decisions
    8. 8. REST API Examples: BoardsGET /api/boardsgets the boards for a userPOST /api/boardscreates a new board with the information supplied in the JSON bodyGET /api/boards/{board_id}/statusesgets the latest statuses for the boardGET /api/boards/{board_id}/statuses/{status_id}/commentsgets the latest comments for the status
    9. 9. Why REST cont...- HTTP Status Codes- Additional HTTP Headers POST /api/boards/ RESPONSE: Status Code: 409 Conflict X-GlassboardPlatform-Exception-Code: 200002 **Error code 200002: A board with this name already exists for this chairman
    10. 10. Why JSON?- Smaller “on the wire” footprint
    11. 11. JSON Example{ "AttachmentHasThumbnail":true, "AttachmentId":"XXX-XXXX-XXXX-XXX", "AttachmentType":0, "AuthorId":"XXX-XXXX-XXXX-XXX", "BoardId":"XXX-XXXX-XXXX-XXX", "CommentCount":0, "LikeCount":0, "LikedByUsers":["XXX-XXXX-XXXX-XXX", “XXX-XXXX-XXXX-XXX”], "Link":"http://www.link.com", "Location":"+12345 -12345", "PubDate":"01/01/1001", "Status":"Hello World", "StatusId":"XXX-XXXX-XXXX-XXX", "Updated":"XXX-XXXX-XXXX-XXX"}
    12. 12. XML Output<StatusInfo> <AttachmentHasThumbnail>true</AttachmentHasThumbnail> <AttachmentId> XXX-XXXX-XXXX-XXX </AttachmentId> <AttachmentType>NONE</AttachmentType> <AuthorId> XXX-XXXX-XXXX-XXX </AuthorId> <BoardId> XXX-XXXX-XXXX-XXX </BoardId> <CommentCount>0</CommentCount> <LikeCount>2</LikeCount> <LikedByUsers> <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> XXX-XXXX-XXXX-XXX </string> <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> XXX-XXXX-XXXX-XXX </string> </LikedByUsers> <Link>http://www.link.com</Link> <Location>+12345 -12345</Location> <PubDate>01/01/1001</PubDate> <Status>Hello World</Status> <StatusId>XXX-XXXX-XXXX-XXX </StatusId> <Updated>XXX-XXXX-XXXX-XXX </Updated></StatusInfo>
    13. 13. { <StatusInfo> "AttachmentHasThumbnail":true, <AttachmentHasThumbnail>true</AttachmentHasThumbnail> "AttachmentId":"XXX-XXXX-XXXX-XXX", <AttachmentId> XXX-XXXX-XXXX-XXX </AttachmentId> "AttachmentType":0, <AttachmentType>NONE</AttachmentType> "AuthorId":"XXX-XXXX-XXXX-XXX", <AuthorId> XXX-XXXX-XXXX-XXX </AuthorId> "BoardId":"XXX-XXXX-XXXX-XXX", <BoardId> XXX-XXXX-XXXX-XXX </BoardId> "CommentCount":0, <CommentCount>0</CommentCount> "LikeCount":0, <LikeCount>2</LikeCount> "LikedByUsers":["XXX-XXXX-XXXX-XXX", “XXX-XXXX-XXXX-XXX”], <LikedByUsers> "Link":"http://www.link.com", <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> XXX-XXXX-XXXX-XXX </string> "Location":"+12345 -12345", <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> XXX-XXXX-XXXX-XXX </string> "PubDate":"01/01/1001", </LikedByUsers> "Status":"Hello World", <Link>http://www.link.com</Link> "StatusId":"XXX-XXXX-XXXX-XXX", <Location>+12345 -12345</Location> "Updated":"XXX-XXXX-XXXX-XXX" <PubDate>01/01/1001</PubDate>} <Status>Hello World</Status>{ <StatusId>XXX-XXXX-XXXX-XXX </StatusId> "AttachmentHasThumbnail":true, <Updated>XXX-XXXX-XXXX-XXX </Updated> "AttachmentId":"XXX-XXXX-XXXX-XXX", </StatusInfo> "AttachmentType":0, <StatusInfo> "AuthorId":"XXX-XXXX-XXXX-XXX", <AttachmentHasThumbnail>true</AttachmentHasThumbnail> "BoardId":"XXX-XXXX-XXXX-XXX", <AttachmentId> XXX-XXXX-XXXX-XXX </AttachmentId> "CommentCount":0, <AttachmentType>NONE</AttachmentType> "LikeCount":0, <AuthorId> XXX-XXXX-XXXX-XXX </AuthorId> "LikedByUsers":["XXX-XXXX-XXXX-XXX", “XXX-XXXX-XXXX-XXX”], <BoardId> XXX-XXXX-XXXX-XXX </BoardId> "Link":"http://www.link.com", <CommentCount>0</CommentCount> "Location":"+12345 -12345", <LikeCount>2</LikeCount> "PubDate":"01/01/1001", <LikedByUsers> "Status":"Hello World", <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> XXX-XXXX-XXXX-XXX </string> "StatusId":"XXX-XXXX-XXXX-XXX", <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> XXX-XXXX-XXXX-XXX </string> "Updated":"XXX-XXXX-XXXX-XXX" </LikedByUsers>} <Link>http://www.link.com</Link>{ <Location>+12345 -12345</Location> "AttachmentHasThumbnail":true, <PubDate>01/01/1001</PubDate> "AttachmentId":"XXX-XXXX-XXXX-XXX", <Status>Hello World</Status> "AttachmentType":0, <StatusId>XXX-XXXX-XXXX-XXX </StatusId> "AuthorId":"XXX-XXXX-XXXX-XXX", <Updated>XXX-XXXX-XXXX-XXX </Updated> "BoardId":"XXX-XXXX-XXXX-XXX", </StatusInfo> "CommentCount":0, <StatusInfo> "LikeCount":0, <AttachmentHasThumbnail>true</AttachmentHasThumbnail> "LikedByUsers":["XXX-XXXX-XXXX-XXX", “XXX-XXXX-XXXX-XXX”], <AttachmentId> XXX-XXXX-XXXX-XXX </AttachmentId> "Link":"http://www.link.com", <AttachmentType>NONE</AttachmentType> "Location":"+12345 -12345", <AuthorId> XXX-XXXX-XXXX-XXX </AuthorId> "PubDate":"01/01/1001", <BoardId> XXX-XXXX-XXXX-XXX </BoardId> "Status":"Hello World", <CommentCount>0</CommentCount> "StatusId":"XXX-XXXX-XXXX-XXX", <LikeCount>2</LikeCount> "Updated":"XXX-XXXX-XXXX-XXX" <LikedByUsers>} <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> XXX-XXXX-XXXX-XXX </string>{ <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> XXX-XXXX-XXXX-XXX </string> "AttachmentHasThumbnail":true, </LikedByUsers> "AttachmentId":"XXX-XXXX-XXXX-XXX", <Link>http://www.link.com</Link> "AttachmentType":0, <Location>+12345 -12345</Location> "AuthorId":"XXX-XXXX-XXXX-XXX", <PubDate>01/01/1001</PubDate> "BoardId":"XXX-XXXX-XXXX-XXX", <Status>Hello World</Status> "CommentCount":0, <StatusId>XXX-XXXX-XXXX-XXX </StatusId> "LikeCount":0, <Updated>XXX-XXXX-XXXX-XXX </Updated> "LikedByUsers":["XXX-XXXX-XXXX-XXX", “XXX-XXXX-XXXX-XXX”], </StatusInfo> "Link":"http://www.link.com", <StatusInfo> "Location":"+12345 -12345", <AttachmentHasThumbnail>true</AttachmentHasThumbnail> "PubDate":"01/01/1001", <AttachmentId> XXX-XXXX-XXXX-XXX </AttachmentId> "Status":"Hello World", <AttachmentType>NONE</AttachmentType> "StatusId":"XXX-XXXX-XXXX-XXX", <AuthorId> XXX-XXXX-XXXX-XXX </AuthorId> "Updated":"XXX-XXXX-XXXX-XXX" <BoardId> XXX-XXXX-XXXX-XXX </BoardId>} <CommentCount>0</CommentCount> <LikeCount>2</LikeCount> <LikedByUsers> <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> XXX-XXXX-XXXX-XXX </string>
    14. 14. iOS Client- Built by Brent Simmons
    15. 15. Android Client- Build by Nick Bradbury
    16. 16. What we learned...
    17. 17. The Problem...- Stringent REST implementations have limitations- Mobile applications have their own limitationsMobile apps need to be not only useable but usefulas soon as possible - that means new data...
    18. 18. The Newsfeed Solution- Single call to get all new statuses and comments- One out-bound request on startup- Data body just a set of existing JSON objects
    19. 19. Platform API Future- More “newsfeed like” REST hybrid calls- Open to 3rd parties?
    20. 20. Q&A(with your host @jennyblumberg aka @glassboard aka @sepialabs)

    ×