api world conference
TRANSCRIPT
![Page 1: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/1.jpg)
Zeb Mahmood
@zebonic
Alexander Khimich
in/alexanderkhimich
![Page 2: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/2.jpg)
Assumption: This audience understands what’s an API
![Page 3: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/3.jpg)
What do we mean by Enterprise APIs?
Similarities with Public API
More ‘business’ will be conducted over API than UI
Security is critical. DDoS attack and un-authorized access are real threats
Mutations of your application will evolve via its API
Developers don’t like to read documentation
You have competition
Internal API
Public API
Private API
![Page 4: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/4.jpg)
Darwin’s theory of natural selection
Evolution of Life:
“Natural selection is a process by which animals and plants
with traits considered desirable by nature
are systematically favored.
Natural selection is thus the key mechanism of evolution for life.”
![Page 5: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/5.jpg)
Darwin’s theory of natural selection
Evolution of Life Applications:
“Natural selection API is a process means by which animals applications and plants
with traits considered desirable by nature developers
are systematically favored.
Natural selection API is thus the key mechanism of evolution for life applications.”
![Page 6: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/6.jpg)
Typical drivers for Enterprise APIs
Pluggable architecture. Reduce time-to-market. Build fine grain
application UI. For everything else, expose API.
Monetization. Data is king. Expose your app’s data via API.
Modernization. Days of file transfers and direct database are over.
![Page 7: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/7.jpg)
The ‘textbook’ recommendations for APIs
API first
Single version of APIs
Always use the right verb
SOAP/XML is history. Always use REST/JSON
![Page 8: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/8.jpg)
The ‘textbook’ recommendations for APIs
API first - However, most APIs are retrofitted to old enterprise systems
Single version of APIs - Hard to avoid while supporting backwards compatibility
Always use the right verb – But read operations don’t always use POST e.g. search
SOAP/XML is history. Always use REST/JSON – SOAP is like mainframe. We want to
believe it’s dead. But it’s not!
![Page 9: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/9.jpg)
API first
Think API first
Build APIs for internal features
Eat your own dog food
Go versioning
![Page 10: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/10.jpg)
API Versioning
Versioning of URL
Versioning of API Schema
Versioning of API business logic
Versioning of tests/automation
Versioning of Docs
![Page 11: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/11.jpg)
URL versioning and releases
Recommendation is to increment versions each major release, regardless if there were changes or not. /v1/contact/{id} - Release 4.0
/v2/contact/{id} - Release 5.0
![Page 12: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/12.jpg)
{
firstName:”Bob”, lastName:”Smith”, middleName:”Tony”
}
V2 request
V2 response
{ fullName:”R A Smith”, confidence: 0.93
}
API Versioning
V1 request
V1 response
{ firstName:”Bob”, lastName:”Smith”
}
{ fullName:”Robert Smith”
}
![Page 13: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/13.jpg)
API Versioning
V1 request
V1 response
{
firstName:”Bob”, lastName:”Smith”, middleName:”Tony”
}
V2 request
V2 response
{ fullName:”R A Smith”, confidence: 0.93
}
{ firstName:”Bob”, lastName:”Smith”
}
{ fullName:”Robert Smith”
}
V1 V2 V3 V4
![Page 14: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/14.jpg)
API Versioning - schema - v1
V1 request
{
fullName:”Robert Smith” }
V1 response
{ firstName:”Bob”, lastName:”Smith”
}
Rev1 request adapter
Rev1 Request Object
Business Logic
Rev1 Response Object
Rev1 response adapter
Internal Request Object - 3 fields:[Fname, LName, MName]
Internal Response Object - 2 fields: [fullName, confidence]
![Page 15: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/15.jpg)
API Versioning - schema - v2
V2 request {
fullName:”R A Smith”, confidence:0.93
}
V2 response {
firstName:”Bob”, lastName:”Smith”, middleName:”Tony”
}
Rev2 request adapter
Rev2 Request Object
Business Logic
Rev2 Response Object
Rev2 response adapter
Internal Request Object - 3 fields:[Fname, LName, MName]
Internal Response Object - 2 fields: [fullName, confidence]
![Page 16: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/16.jpg)
API Versioning - schema - v3
V3 request {
fullName:”R A Smith”, confidence:0.93
}
V3 response {
firstName:”Bob”, lastName:”Smith”, middleName:”Tony”
}
Rev2 request adapter knows he can accept v2 and v3
Rev2 Request Object
Business Logic
Rev2 Response Object
Rev2 response adapter knows he can accept v2 and v3
Internal Request Object - 3 fields:[Fname, LName, MName]
Internal Response Object - 2 fields: [fullName, confidence]
![Page 17: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/17.jpg)
API Versioning – Business logic
Factory design pattern. Get version implementation by version number.
In code, “if” statements based on version execution context.
![Page 18: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/18.jpg)
API Versioning – Testing
Black box API testing with version respecting. The same test might be applied to multiple versions if nothing was changed. Test1 - v1
Test2 - v2* (any after v3)
![Page 19: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/19.jpg)
Documentation It has to be automatic!
To enable automatic documentation “contract first” development model is preferable.
Some documentation standards to consider
WADL
Swagger
RAML
![Page 20: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/20.jpg)
Sandbox
It’s a must have for any company
Worth investing in it
Should have production SLAs
Should be treated as production
API design should respect Sandbox
Must be easy to try and use
Right data is a must
![Page 21: API World Conference](https://reader033.vdocuments.mx/reader033/viewer/2022042717/55d26b5bbb61eb44418b4634/html5/thumbnails/21.jpg)
Product Owner’s role for Enterprise API’s success
Recruit early adopters e.g. pilot, beta
Evangelize to sponsors and champions
Nurture developer community
Market via how-to videos, 101 tutorials, hackathons, ….
Monitor API usage