This talk explores the motivation for creating APIs, common approaches organizations take when building an API program, the types of standards that architects should strive to put in place, and common pitfalls that organizations encounter.
35. Stable Versions
URI Based Accept Header
/v1/endpoint
!
/v2/endpoint
Accept-‐Version:
1.0
!
Accept-‐Version:
1.1
Content Type
Accept:
application/vnd.your.api.v2+json
!
Accept:
application/vnd.your.api.v2.1+json
36. Predictable Response Codes
2xx Successful 4xx Client Error
400
Bad
Request
401
Unauthorized
403
Forbidden
404
Not
Found
5xx Server Error
500
Server
Error
502
Bad
Gateway
503
Unavailable
200
Success
201
Created
!
38. Intuitive URI Structure
URI Description
/group/{id} A Facebook group
Using this Template
/group/{id}/feed This group’s feed
/group/{id}/files Files uploaded to this group
/group/{id}/events This group’s events
42. Partial Responses
Get Full Response
/feeds/api/users/default/uploads
Get Partial Response
/feeds/api/users/default/uploads?
fields=entry(title,gd:comments,yt:statistics)
43. Result Filtering
Get List of Videos
/feeds/api/videos?q=surfing&max-‐results=10
Get Videos with 1,000,000+ Views
/feeds/api/videos?q=surfing&max-‐results=10
&fields=entry[yt:statistics/@viewCount
>
1000000]
44. Customized Responses
ItemLookup - Default
ItemId=B00008OE6I
ItemLookup - Default With Reviews
ItemId=B00008OE6I
&ResponseGroup=Reviews
ItemLookup - Large With Reviews and Offers
ItemId=B00008OE6I
&ResponseGroup=Large,Reviews,Offers
45. Easy to Learn and
Experiment With
Using this Template