8. The API Contract Is Critical
• tells consumer devs what they'll get
• tells implementer devs what to deliver
• enables parallel development
• ensures they'll meet in the end
9. My Experience: Barnes & Noble /
the layer cake
of APIs
Don't expose dirty laundry
users
products
orders
invoices
11. The traditional enterprise
sits comfortably behind the firewall
Packaged apps
Custom apps
The Traditional Enterprise
Databases
12. Welcome to the New Enterprise
SaaS
Social
Cloud platforms
Mobility and Devices
Customers / Partners / Suppliers
Packaged apps
Custom apps
The New Enterprise
Databases
14. Backend to SaaS
SaaS
Social
Cloud platforms
Mobility and Devices
Customers / Partners / Suppliers
Packaged apps
Custom apps
The New Enterprise
Databases
15. Everything needs to connect
SaaS
Social
Cloud platforms
Mobility and Devices
Customers / Partners / Suppliers
Packaged apps
Custom apps
The New Enterprise
Databases
16. The Anypoint Platform:
integration on-premises and cloud
SaaS
Cloud platforms
Social
Anypoint Platform
Mobility and Devices
Customers / Partners
/ Suppliers
Mule Studio
Anypoint Connectors
Anypoint
DataMapper
Enterprise
Mgmt
DataSense
Packaged apps
Business
Insight
Custom apps
Big Databases / Big Files
17. The Anypoint Platform:
integration on-premises and cloud
1,000s
100s
SaaS
1,000,000s
Cloud platforms
100,000s
Social
1,000,000,000s
Anypoint Platform
Mobility and Devices
Customers / Partners
/ Suppliers
Mule Studio
Anypoint Connectors
Anypoint
DataMapper
Enterprise
Mgmt
DataSense
Packaged apps
Business
Insight
Custom apps
Big Databases / Big Files
18. The Anypoint Platform for APIs
SaaS
Cloud platforms
Social
Anypoint Platform
Design/Dev Portal
API Manager
APIkit
Anypoint Connectors
Mobility and Devices
API Gateway
Studio
Customers / Partners
/ Suppliers
Anypoint
DataMapper
Business
Insight
Enterprise
Mgmt
DataSense
Packaged apps
Custom apps
Big Databases / Big Files
22. Focus on the Interface: The Contract
where consumers touch you
your front door, your lobby, your façade
how you want to be seen; your brand
versioned more carefully than code
better interfaces better code
an organizing principle; alignment forcing function
the ultimate testing surface
23. What kind of interface do we want?
1. Describe APIs simply and clearly
2. Design APIs easily and soundly
3. Engage users in compelling ways
24. Practically-RESTful APIs
•
•
•
•
•
•
nouns: resources, described by URI paths
verbs: HTTP methods
metadata: HTTP headers
responses: HTTP status codes
representations: appropriate media types in the body
use hypermedia – not necessarily, not yet
33. No Need to Start From Scratch!
•
•
•
•
•
•
•
well-known superset of JSON
optimized for human readability
great for hierarchies
cruft-free
broad tooling base
extensible-ish
broad tooling base
34. Introducing: RAML
RESTful API Modeling Language
A new open spec
for RESTful APIs
that's as clean
and as structured
as REST itself
the RAML Workgroup:
raml.org
35. RAML: How Clean? How Structured?
Take what you would have typed yourself…
/users:
get:
description:
post:
description:
/users/{userId}:
get:
description:
put:
description:
delete:
description:
Get a collection of users
Create a new user in the collection
Get a single user
Update a single user
Delete a single user
39. Covers Full HTTP
optional version in baseUri
template URIs
query parameters
headers (on request and response)
response per status code
example (and schema) per media type